Tuesday, February 26, 2013

Game Graphics Assignment 7

Not too bad of an assignment. I had done a bit of alpha stuff in both Game Engineering and more in an XNA prototype for game projects 1.
I also didn't have to redesign much of my code. I redid how i was going the draw. Since now i needed to be able to draw objects in different orders, which meant two seperate locations for the draw call, I decided to make a function out of it. So now i have a DrawEntity function that will set all of the effect, material, uniforms that need to be changed and make the draw call.
Then for the Opaque entities i call that function in order of Effect->Material. For the transparent objects i draw them in order of distance away from the camera.

But for the files i only had to update the format for one of the file types, my effect. I added an enum (saved as an int) for whether it was transparent, additive, opaque...

The one part i didn't like is how i had to loop through every entity to check if it had a material that used an effect that was transparent, when drawing the transparent objects. It is a lot of finds that take place (2 * the number of entities you have). I couldn't think of an easy way to divide my entities into opaque and transparent. I can fairly easily do this for the effects, but i have no quick way to get all of the entities that use a specific effect.
So that section is a bit slow, but still fast enough.

Everything should work.
Link To Code

Pix screenshot of events collapsed

Pix screenshot of the Translucent events expanded


Friday, February 15, 2013

Productive week

We are really getting a hang of the engine now. This last weekend i spend the whole weekend (it felt like) trying to get the push area to be spawn able  I made a post on the Crytek forums asking how to do it. I got three responses within 24 hours, the last one giving me the answer. The answer was i needed to do it in c++ and not lua, although i could expose it to lua if i wanted.
Link to Post
At that point i learned that the real logic of the engine is in C++ and i should do as much in there as i can. If i want to do it in Lua i now find out how to do it in the C++ code then find corresponding function in Lua, or make the function for Lua. This has been working much better. And now that i have been playing around with the C++ so much, and reading their functions, i have a much better understanding of the engine.
I love being able to hit F12 and see  the class or function, with some documentation (Video game documentation, crazy germans). also being able to find the references to the functions so i can see them in use.

And the rest of the team is also getting a lot more done with the engine. We have gotten over much of the learning curve and are really starting to make progress.

Game Graphics Assignment 6

This ended up taking longer than i thought it would. but still didn't take too long.
Once i read that we were making a Maya Exporter i dreaded the assignment. After making an FBX parser for Game Engineering i was not looking forward to dealing with that api again. However all of the maya stuff was already done, and that part of the assignment was super easy.
The binary file part was very easy too, I deal with binary files all the time with my work on the search engine

And as for putting all the vertices and indices in a block, again I had to do that for game engineering 2.

I also changed around the pix events for this assignment (and replaced the zip for the last assignment) because i had them implemented incorrectly.

everything should be working
Link To Code

Picture of pix events, fixed.

Monday, February 11, 2013

Game Graphics Assignment 5

Overall not too difficult of an assignment. Took some time, but not too bad. I am not sure what was taken out of the assignment, would be interested to know how much more work the original assignment was.

I had implemented specular lighting before (for game engineering 2), so i didn't have much trouble there. Had to play with which direction the normal should face a bit, but got it quickly.

One thing that came up was that i had the wrong arguments to my draw call. It wasn't an issue because i was only daring a single box (so all the offsets were 0), but adding the floor caused problems. After taking a look at my draw call in my engine, it was quick to switch the arguments around and get it drawing the floor.

The biggest part decision wise was how to structure the uniforms. I changed how i was doing it twice while developing it. But I ended up with a nice system that can take any size of a float array and set it only when it needs to be set. How i do this is every time i set a uniform i keep track of its name and value. Then when i try to set the next one i look to see if it is already set. In this case even if i change materials, if they both have the same uniform (name and value) it will not set it again. This all gets cleared when i change the shader.

Everything should be working in the assignment.
Link To Code

Picture from pix debugging


Friday, February 8, 2013

Game Graphics Assignment 4


this assignment took a large amount of time, but was not too difficult. I make may own file format every few weeks it seems, so that was simple. I had already been separating out my code into classes so all i had to do was add in a new class for each part of this assignment.

I was deciding between having a manager class for each of the new types of things. then i could either pass those around or make them all singletons. That way when the material file was loading it could tell the effect manager to load an effect that the material just read. However i decided to instead keep all of the class instances in the scene class and have the scene class be the one that calls load for each object.
So the entity class has its load function called. that function opens up and parses the file. It then returns the names of the mesh and material that it uses. The scene file then will look to see if that mesh has been loaded, if it hasn't then it creates a new Mesh instance and calls the load (giving it the filename).
So each class object has its own information and the name of the other objects it needs. So when i draw i ask for each objects information. The entity returns its world transform and the name of the mesh and material it uses. The scene the looks the mesh up and calls for its information, which returns the vertex buffer offset and index buffer offset.

Everything should be working, as long as i didn't miss something.

To move the camera use w, a, s, d
To move the light use the numpad:
numpad 8: up
numpad 2: down
numpad 4: left
numpad 6: right
numpad 7: in (-Z)
numpad 9: out (+Z)

here is a screenshot of the depth buffer in pix

final week of preproduction?

Well we think we have the final version of the game. at least before Gate 1. We really don't have time to change again before Gate 1 anyway.
But I am happy with the game we have. It has two very nice parts about it. One is that the gameplay is very similar to the Impulse prototype. So we know if we can get it executing it will be fun to play. The other nice thing is that it is something i would be proud to talk to an industry professional about this game. because it takes a game, breaks it down into its formal elements and then puts the game back together one formal element at a time.

The rest of my time has been spent trying to get the force push to work. However i have not been able to get it to work. I have been trying to create the entity as an area box, load a model as a collision box. I think the next thing i will work on will be loading a model and using it as collsiion geometry. I spent some time with it, but not enough. and I believe if i get it right it will work.