Indie Game Development - "Having fun, making fun"

Monday, July 16, 2012

Dev Log - Multiplayer Part II

I've discovered that I've been somewhat naïve concerning multiplayer.  I have multiplayer games working again over system link but when I added a full eight players and balls, the system got bogged down and fell out of sync.  After looking into the issue some more I discovered an excellent resource by Shawn Hargreaves that both explained my problem as well as offered strategies to address it. 

Shawn is part of Microsoft's XNA development team, and has taken the time to explain many technical issues on his blog.  His writings were extremely helpful when I tried to wrap my mind around 3D and he came to the rescue again in helping me understand online multiplayer.

Apparently multiplayer games are relatively "easy" to get working on a local network, but often fail when trying to get them to work in the real world over the internet.  This is because bandwidth is much more limited over the internet, packets of information take much longer to arrive, and some simply never arrive.  In my case, it seems I had forced the server to send so much information that I was having bandwidth problems even on my local network.  Ouch!

The good news it that I now understand what I need to do, its an interesting problem to solve and I'm excited to finally conqour multiplayer.  Using the compression techniques Shawn described I've already been able to reduce the client's bandwidth by 50%!  Sending the packets less frequently reduce it another 50%.  I'm now going to apply those techniques to the server, as well as offload some of the work to the clients.  Ever onward!

No comments:

Post a Comment