Thursday, October 3, 2013

Spacewars Game Jam

In my networking class last Friday our professor John Pile surprised us with a Spacewar themed game jam. The goal was to group with one other person and make a networked game similar to the 1985 version of Spacewar. I choose to group with my friend Evan Schipellite. We decided to use his game for the last assignment as a starting point. From here we both just looked at the requirements and started to code. I started to work on game-play features such as the player class while he converted the architecture to work better with our new game. After I finished creating a few classes I needed to merge them with his architecture in order to test if they worked. Evan at this point had already setup some classes to make it relatively easy to merge our work. With just a little help I was able to get everything linked up and ready to go. The player class started to work with little need for fixes. The speed and some other values weren't the best but it worked and that was good. At this point there was still much to be done and with only very little time left. I was able to squeeze in bullets and the display of health within the last few minutes but there was not time for perfection. I had initially set it up so each player would be authoritative over when they took damage from a bullet but when I looked at the clock and saw less than five minutes left I realized that sending health data over the network was not going to happen in time. So I decided to comment out the line making it authoritative and just had everyone decided the score for everyone else. At the end we had working ships that could move around in a way fairly similar to space wars, bullets that hurt enemies, a awesome star field background made by Evan and a win state. To be able to create all of these things in a somewhat working fashion in such a short period of time was a success that I could feel good about. In retrospect though it would have been good to have a little bit more planning as to what we each were going to get done and what we wanted to accomplish during the time period. While we were doing the game jam both of us had very little idea what we were going to do let alone what the other person was doing. We just looked at the list and started programming things that needed to be done.

After the game jam we decided to improve upon the game and take our own spin on Spacewar rather then trying to make an exact copy. I came up with the idea that instead of in space we could be in quick sand because this would still work for the idea of gravity in the game. We evolved the idea from there and decided to make it a group of tourist that got stuck in quicksand and the tour guide only being able to save the last one. From here I went into polishing the old game features and adding on new ones. One of the requirements for the game was to have the bullets limited to 10 per player but last forever (with screen wrap). This caused a lot more difficulties than originally intended. Having this happen wasn't to difficult but as we watched the game go on the bullets would lag behind on different player screens. If a bullet was only alive for a second than the difference was so minor that it couldn't be noticed but if it were on the screen for 10 seconds a bullet on one screen would be maybe 3 seconds behind another. This was a pretty major problem so we tried our best to fix it. First we attempted to have all the computers sync up without sending bullet information over the network. We used methods such as having a physics timer so the bullets would only update every 50 milliseconds, multiplying the elapsed time by the speed and reducing the frame rate. All of this went to no avail so in the end we made the host authoritative over bullets sending their positions with a byte ID over the network. In the end I am happy with how both versions of the game worked out.