Game Development Reference
In-Depth Information
Client-to-client interaction
Given that multiple clients must communicate among each other to play a game
together, traditionally there are two models for achieving network communication
between them:
• Client server
• Peer-to-peer
In a client-server model, all data communication among all clients goes through
a server. The server is publicly accessible to all the players' computers and has
a significantly high bandwidth allocation. The advantage of this model is the
accessibility of the game server to anyone who is connected to the internet. Also, the
programming model for the game developer is straight forward. The server is also a
place where the user's actions may be monitored to ensure fairness to all the players
within the community. The biggest drawback of this model is the amount of time
taken for data to be sent from one player's computer to another. All data packets
must travel to the server from the client and then back to the receiving client.
In a peer-to-peer model, two computers create a direct socket link among the players'
computers. In this model, the time spent in sending data from one player to another
is cut in half compared to the client-server model. But this model is less secure
compared to the client-server architecture. The model has other limitations as well:
the number of players each player may communicate with is severely restricted, as
each player's computer must open socket connections to each of the other computers
that it wants to interact with. Most often, games implemented in the P2P model are
limited to 32 or at most 64 players within a game room. Accessibility is also an issue
with P2P because of the firewalls and multiple computers connected to the router
inside a home, office, or Internet game rooms, though the games that use this model
are as famous as Warcraft, CounterStrike, and the like.
The server modules
For any multiplayer programming, you must either know how to deal with sending
and receiving data from the server, or use a third-party SDK/API that does all the
low-level work for you and presents the developer with a high-level API.
 
Search WWH ::




Custom Search