Game Development Reference
In-Depth Information
Anatomy of multiplayer games
In a single-player game, there is only one player, so talking about the game as an object
that maintains all of the game behavior, whereas if we understand the anatomy of multi-
player games, we'll see that it's totally different. In multiplayer games, there are multiple
players playing the same game, so technically for every device, there is a player who is act-
ively driving the game on that device. This is called the local player, and all other players
are treated as remotes players for that device. The local player's activities should ideally be
updated on the remote players' devices, which is the foremost challenge in multiplayer de-
velopment. The update of the local player is called syncing the game on some other device,
and is done by the game object that resides in the game. It's the responsibility of the game
object (that is, the instance of game running on the device) to make the game look the same
on all devices as a live game is played.
So, moving further in this section, we will be creating a fresh multiplayer game, called
TankRace, using SpriteKit, in which game sessions will be instantiated. We will incorpor-
ate multiplayer game states with their explanation and essentiality. All the session and mul-
tiplayer related processes will be done using the Multipeer Connectivity framework intro-
duced in iOS 7, which was a part of GameKit in iOS 6.
Search WWH ::




Custom Search