Tuesday, February 1, 2011

And they thought they would live happily ever after…


The Object System is about 95% ready, it just needs some code review here and there (there are a couple nuts that need to be tightened). I also need to setup the demos before submitting the final code in a couple of weeks, but I will get back to coding this system later.

The Object System is the first piece in a four-part Project which also includes the following three assignments: Memory System, File System and Math System. Allow me to explain the other three parts briefly.

The Memory System is a memory manager build on top the Win32 Library that allocates/frees memory based on user requests. This system creates/destroys Heaps using the Win32 Library, and allocates/frees blocks of memory from those heaps. The idea behind this system is to have control over the memory being used by the Game Engine, therefore be able to detect & fix possible memory leaks and improve performance by allocating objects in specific heaps, i.e. having different heaps for models, maps, sounds, etc., and as a result achieving data locality (much better than having your data spread all over the main memory).

The third one, the File System, is meant to manage data transfers from files to memory and vice versa. Since reaching out for data in your hard drive or optical medium is way much slower than accessing main memory (milliseconds vs. nanoseconds), you want to minimize those access as much as you can. Thus, the idea is to store the game data (models, maps, animations, etc.) in binary-format files, and have the File System manage the file loading efficiently (that’s what those loading screens are for).

The final one (for now) is the Math System, which basically translates into a Vector and Matrix Library. This system has to be able to handle all kind of operations for vectors, matrices and in-between: dot product, cross-product, matrix multiplication, determinant, transpose, inverse, etc. More than difficult, this one implies thousands lines of code and plenty of testing.

In my next posts I will go into more detail about each one of these last three systems. At least the first one is working right (at least I think so), but also made me realize that I am quite rusty in this thing called CODING. Hopefully, by the end of the quarter I will be a little bit more relaxed and skilled working with C++.

Off I go! Memory System you shall be mine!

Adios!

No comments:

Post a Comment