A client/server game consists of the individual players' computers (the "game clients") connected to a central server computer. The topology of a four-player client/server game is depicted in the following illustration.
Game play is handled by having each user's game client communicate with the server. The server is responsible for passing information on to the other users. For instance, when one user moves, the user's computer sends a message to the server. The server then sends messages to the other players to inform them of a change in game state. The server can have a number of responsibilities; it can:
- Act as the session's messaging hub. Each computer needs to send messages only to the server. The server handles the logistics of synchronizing all the other users. This arrangement can substantially reduce message traffic, especially for large games.
- Host the game. The server typically takes care of the tasks that must be handled by the session host in a peer-to-peer game.
- Support many aspects of the game. The server often does much more than support game logistics. With many games, especially large ones, much of the processing that maintains the "game universe" takes place on the server. The game clients are primarily responsible for handling the user interface (UI).
A client/server game is typically arranged and launched through a lobby client application that resides on the user's computer. The lobby client acts as a link to a lobby server application, which usually runs on the same remote computer that is hosting the game. When the game has been launched, the game server application becomes the host and handles tasks such as admitting new users to the game.
There are a number of advantages to client/server games.
- They are more efficient, especially for large-scale games. In particular, they scale much better than peer-to-peer games because additional players cause only a linear increase in the messaging traffic. The client/server topology is necessary for massively multiplayer games.
- You are not limited by the processing power of your users' computers. You can locate much of the processing required to maintain a large complex "game universe" on a single powerful computer, and let the users' computers handle the UI.
- You can control key aspects of your game at a central site. For instance, you can often update the game or fix bugs by modifying the server application, thereby avoiding the need to update large numbers of game clients.
Once you have developed and shipped a peer-to-peer game, you are essentially finished. The game clients are largely self-sufficient. However, with a client/server game, you have an ongoing responsibility to your users that goes beyond providing support services. You must also provide and maintain a game server computer and the associated software, along with the network links to handle all the messaging, for the lifetime of the application. In the case of massively multiplayer games, you may need to operate your servers for extended periods with few or no breaks in service, or risk angering users by disrupting their game play.