Game Development Reference
In-Depth Information
What largely affects and limits the performance is the number of messages that the
server has to relay to all the players within the same game room. What constitutes a
message could be anything that others need to know when a player does some action.
For example, a player picks up an item off the ground, a player chooses a card, the
player hits the gas driving a car, etc. A server that's hosting a card game would serve
more concurrent players than, for example, a racing game. As you will see in the very
last example presented in this topic, in a racing game the rest of the players must
know at all times where you are, by the second or in a lesser interval. This means that
messages must be sent up to the server at rapid intervals and the game server must
reply to all other players within the room as quickly as possible.
What was just described is only the gameplay part of messaging. But there are
others; for example, when someone created a room, joined a room, chats, etc. These
messages also become significant when there are more and more players actively
connected to the game server and not necessarily playing the game.
Besides game message communication, there is a lot that the game server must do
as a commercial deployment, such as storing the account information of players in a
persistent database, managing rooms in a lobby, maybe managing multiple lobbies,
monitoring chatting activity, keeping track of high scores, sometimes hosting AI
bots to play with players, and validating players' moves and making sure no one is
cheating with a hacked client, and so on.
If you are planning to write a multiplayer game, you have to deal with all the
previous items and much more as opposed to a single player game, where much of
the work is actually dealing with writing the game and nothing else. This point is
exactly what discourages many game developers from ever writing a multiplayer
game. Fortunately, the situation is not that bad, as there are several commercial APIs
or SDKs that take care of all these issues and let you focus on the game. Some well-
known SDKs are Pulse, which we will use in this topic, ElectroServer, and SmartFox.
There are also some open source ones such as Red5. Adobe also has a solution in the
market—the Flash Media Server— which you could use to implement games on, but
it is mostly designed and suited for hosting video or image-sharing services.
If you were to write a game server on your own, you would need to be very familiar
with the network protocols such as TCP or UDP. You also need to know how best
to write all the bookkeeping and services on the server side as well as deal with
the database.
 
Search WWH ::




Custom Search