Multiplayer Game

From GPWiki

Files:GUITutorial_warn.gif The Game Programming Wiki has moved! Files:GUITutorial_warn.gif

The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server.

However, the GPWiki forums are still active! Come say hello.

The Multiplayer Game category is in most cases an aditional category for your game. For example, if you decide to write a simple Pong clone, it can be interessting to be able to play with an opponent (maybe even on a different PC). There are two different types of multiplayer games, those that are played on a single PC and those that are played on different PCs. Those games for one PC are quite simple to write, since you just have to grab some more keys. The games running on different PCs have some more difficult issues.

Issues

  • Network Protocol

For an over view see http://warriors.eecs.umich.edu/games/

Connection Types

Client-Server

There are two different methods of managing a connection. A nice and often used solution is connecting via a server. This says that you have to write an own executable to handle a server sided connection. This does not mean you have to run it on a different PC, but if it has to handle a high load (like for an MMORPG) it is recommend to do so.
A client-server communication structure
Enlarge
A client-server communication structure

Peer-2-Peer (P2P)

You can also handle the conection between 2 PC's directly. This means you don't have a seperate Server and both clients have to do the job. This is in most cases difficult, but sometimes really nice to have.
A peer-2-peer communication structure
Enlarge
A peer-2-peer communication structure