Monday, April 11, 2011

Second assignment posted… and done! Let me introduce you to Serialization!

Sup dudes!

Week #2 is over, second assignment is posted and I already finished it, sweet! This is a new for me. I am usually (99% of the time) the kind of guy that leaves everything for the last minute (not that I am proud of, but I am honest at least).

The assignment is due this Friday 4/15 and was about Serialization, which basically is the process of converting data structures or objects into a format that can be stored in a buffer so that it can be saved to a file, transmitted over a network, and many other options.

The task was to take four (4) classes already defined by the professor and implement their respective serialize and deserialize methods. In order to test what we are doing, we were given a test unit that does the following: creates an object for each one these classes, serializes them to buffers in memory, then creates new empty objects for each class, reconstructs the former objects from these buffers and finally compares the objects values (members) to check for inconsistencies.

Here is a little description of the classes so you have an idea of what kind of data we were handling:
  • Cat (1 double, 2 floats, 1 int, and 3 chars): serialize/deserialize was just a memcpy to/from buffer with length equal to sizeof(Cat).
  • Dog (2 int, 1 float and 1 char): same procedure as Cat.
  • Bird (1 int and 1 char*): when serializing I copy the int, one extra int to store the length of the c-string and the actual char array. Therefore, when deserializing I just copy the int back, read the length of the c-string and then read the respective number of chars from the buffer to reconstruct the object.
  • Fish (1 int, 1 float, 1 char, 1 apple* and 1 orange*): this one might seem complicated, but is not. Basically this one is done by using memcpy three (3) times: one for the actual fish data (sizeof(Fish)-2*sizeof(void*)), one for the apple and another one for the orange.
Well my fellow readers, there you have it. My second assignment is done and explained to you. Next week project should be about Sockets. I will be back as soon as it gets posted.

Adios!

Tuesday, April 5, 2011

Welcome you all to my fun networking adventure!

Hi! My name is Diego Guerrero. I am a grad student of the M.Sc. in Computer Game Development at DePaul University. I am currently finishing the first year of my degree and as part of this quarter's classes I am taking "Multiplayer Game Development". One of the tasks for this class is to write a blog and keep it up-to-date about class’ projects status (kind of like a development journal), so here you have it.

For our first week of the quarter we got three (3) small assignments to warm-up our muscles. Here is the list:
  • Create a blog and write my first post ... CHECK!
  • Create a small Visual Studio C++ project to convert a lowercase c-string into uppercase (this one was just to warm-up our programming fingers and keyboard) ... CHECK!
  • Download the Spacewar game Visual Studio project (XNA and C#), compile it and play it. We will be working on this game during the quarter; it is currently just playable locally, so we will convert it to data-driven and make it playable across the network, sweet! ... CHECK!

So my fellow readers (if there is anyone out there), this is all I have for now. I will be back again as soon as the next assignment get posted!

Adios!

P.S.: In case you want to check it out I also have another blog for my “Game Engine Programming II” class. Enjoy it!