An introduction to what multiplayer games are, what makes them different from normal games, how to approach building them and specifically how to begin building them with the Unity game engine.
Talk given at the GameIS & Dragonplay mobile multiplayer hackathon, 30/7/2015
6. Local (Single Device)
Badlands
King of the Opera
HOW DO THE PEOPLE PLAY THE SAME GAME?
Network
World of Warcraft
Clash of Clans
Hearthstone
Fifa ?
7. THIS (TECHNICAL) LECTURE IS ALL ABOUT NETWORKED
▪ Local Multiplayer is awesome
▪ IMO very unexplored territory
▪ But it is technically equivalent
to a single player game
10. WHY DID P2P ARCHITECTURES FALL OUT OF FASHION?
▪ Servers are cheaper
▪ Less connectivity issues (port
forwarding etc)
▪ Easier to prevent cheating
▪ If one of the players has the
authority, it is called a server.
13. LOBBY
▪ Devices don’t know about each
other yet
▪ They come to a central place and
get grouped to each other
▪ Not the most interesting of tasks
▪ Don’t reinvent.
15. MATCH
▪ One central entity (Server) is in
charge of the PERSISTENT GAME
STATE
▪ The clients send actions to it,
it notifies everyone of changes
to the world
▪ The server can be one of the
clients.
16. PERSISTENT GAME STATE?
The compact representation of the
game’s state. (The Model of MVC)
▪ Chess ? Game board
▪ FPS ? Player positions, stats
The clients have to be able to
build their perspective of the game
from it.
17. SINGLE AUTHORITY FOR EACH OBJECT
Make sure not to have two entities
in charge of the same object
▪ Character owned by client
▪ Projectiled owned by server
▪ Environment simulated separately
Multiple management causes desyncs,
flickers and unnecessary overhead
18. ACTIONS AND CHANGES
The client has to notify the server
of its actions. It can do so in
several ways:
▪ State updates (I am in X=1,Y=4)
▪ State deltas (I moved up)
▪ Actions (Jump)
The client has to update from the
server. Not always symmetric.
21. Conclusion
In case of a metagame, server
updates “the bookkeeper” of the
match results.
▪ High scores
▪ Rankings
▪ XP
The bookkeeper is often the lobby.
36. Parse (2 of 3)
Retrieve objects (from the same
client or others).
37. Parse (3 of 3)
Query objects (from the same
client or others).
38. Parse
A simpler and slightly less “Unity-
ish” solution.
If you can define your multiplayer
layer as database interactions,
this is be a very simple way to
approach it.
39. Parse
Very well documented SDK.
Costs money to scale up, but has a
generous free offer that you won’t
pass until you have MANY users.