Book Image

iOS Game Programming Cookbook

Book Image

iOS Game Programming Cookbook

Overview of this book

Table of Contents (19 chapters)
iOS Game Programming Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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 multiplayer 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 actively 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 development. 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...