Post Mortem on the Spacewar Clone

The challenge was to make a clone of the 1985 game “Spacewar” that supported networked play. I’m disappointed that I was not not in class on the day of the game jam since I was flying to NY. Because of that, I was not assigned to a team so I am doing this on my own, and as a result am not able to look at how other people implemented their networking or have the experience of working as a group on this project.

There’s not really much that I can say was a “biggest” success since most of the things that needed to be implemented were fairly simple as far as I am concerned.

I would have liked to fix the hacked together things I have. For instance, I am doing draw calls directly on the sprite batch each time I want to draw something. This should be encapsulated in a Sprite class. The gamerobject contains whether the player is dead or not this should be moved into the Actor class.

The last major issue is that all clients are close to receiving their cap of 8KB/s in traffic and the host sits at > 15KB/s upload. There are several reasons for this. The first issue is that the host and clients send packets through different paths. This leads having the host call SendData twice per frame (See UpdateLocalGamer() and UpdateServer() in GameplayScreen.cs). If I make the data get queued and sent only once per frame I can save ~ 3KB/s. I can further reduce this by only sending queued data once every 2 or 3 frames. I’m not certain that this will be able to bring the upload speed of the host back down to under 8KB/s from the host. Once I get prediction and smoothing set in the following projects I should be able to decrease the rate that actors need to have their state broadcast in order to further cut down on the traffic. This is something that is not very difficult, but I would probably need to handle sender identification myself, and add two bytes to the packet header to identify the sender and whether there is a valid sender (some things may not have a defined sender like projectiles).

My professor’s website: http://prof.johnpile.com

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>