Game Development Reference
In-Depth Information
used to minimize this and only send out the minimal amount, removing the bottle-
neck of having all the data have to arrive at a single point and leave from a single
point. One example is to have all the players maintain a copy of the game state, and
only the basic changes need be communicated across, rather than the state of the
entire game world. Each client sends data about its own player to everyone else, ul-
timately reducing the amount of data travelling around.
There are negatives here as well. One popular aspect of online first person shooters
is the dedicated server , which can then be connected to at any time. Want to jump
on and practice against random people on the internet? Just jump online. However,
with a peer-to-peer setup you need to use a matchmaking service to set this up. If
you want to allow the players to remain together, you need to consider implementing
group functionality to ensure that the players always join the same games.
Maybe a hybrid?
But what about taking the best of both worlds to try and get all of the benefits? Some
developers make use of a hosted peer-to-peer model, where the players connect in
a P2P fashion, and then the game decides on a host who will run the game. If that
host has connection difficulties and drops out of the game, a new host will be selec-
ted, creating a momentary disruption to gameplay; however, the game will still con-
tinue. This is known as host migration . Although not perfect, this is an interesting
model because it allows for a central authority alongside the disconnections and ad
hoc style of games that you have often seen on home consoles. This model will gen-
erate more traffic than a peer-to-peer model; however, it can be quite useful to have
a central authority that can decide if player A actually hit player B.
The first stage
What about the other stage of networked games that we mentioned? The game cre-
ation and joining stage is where players will set up a game or seek out others to
play against. For some games this may not exist; however, for most this will be the
first stop for players before they can enter the game itself and start playing. As usual
there are different ways to accomplish this, and your options may vary depending on
what resources you have available both on the device being used and externally.
Most PC games with a client/server model utilize a server list system. In this setup,
all game servers register with a master server that acts as a catalog for ongoing
Search WWH ::




Custom Search