Successfully reported this slideshow.
Your SlideShare is downloading. ×

Building Multiplayer Games (w/ Unity)

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 45 Ad

Building Multiplayer Games (w/ Unity)

Download to read offline

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

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

Advertisement
Advertisement

More Related Content

Slideshows for you (19)

Viewers also liked (20)

Advertisement

Similar to Building Multiplayer Games (w/ Unity) (20)

Recently uploaded (20)

Advertisement

Building Multiplayer Games (w/ Unity)

  1. 1. MULTIPLAYER MOBILE GAMES (UNITY)
  2. 2. Hello! MY NAME IS NOAM GAT CTO @ Tacticsoft We make strategy MMOs And you are?
  3. 3. 1 MULTIPLAYER GAMES Definition and scope
  4. 4. “A multiplayer game is a game played by multiple people” - Captain Obvious
  5. 5. HOWEVER There are several criteria to distinguish between them, with technical consequences.
  6. 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. 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
  8. 8. Turn Based Chess Hearthstone HOW OFTEN ARE PEOPLE UPDATED? Real Time World of Warcraft Quake Fifa Clash of Clans?
  9. 9. Clients (P2P) Old games WHO RUNS THE WORLD? Servers New games
  10. 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.
  11. 11. 2 MULTIPLAYER CHECKLIST Building blocks for most multiplayer games
  12. 12. MULTIPLAYER FLOW Match Conclusion Lobby
  13. 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.
  14. 14. MULTIPLAYER FLOW Match Conclusion Lobby
  15. 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. 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. 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. 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.
  19. 19. State Based Robust Simple TRADEOFFS Delta / Action Based Secure Compact Cheap
  20. 20. Game Conclusion Lobby
  21. 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.
  22. 22. 3 UNITY MULTIPLAYER Let's build stuff.
  23. 23. Many different possibilities ▪ WWW Class (HTTP requests) ▪ Legacy Unity Networking ▪ UNet (New in Unity 5.1) ▪ Asset Store (Photon, Parse etc)
  24. 24. Many different possibilities ▪ WWW Class (HTTP requests) ▪ Legacy Unity Networking ▪ UNet (New in Unity 5.1) ▪ Asset Store (Photon, Parse etc)
  25. 25. UNet
  26. 26. UNet Latest in-house evolution of Unity’ s networking efforts. Lets you select which GameObjects to synchronize, and how.
  27. 27. UNet (1 of 4) Create a NetworkManager. Select Offline (Lobby), online (Match) scenes and per-client Prefab. Debugging Lobby GUI
  28. 28. UNet (2 of 4) Create a NetworkIdentity. Decide who takes care of this network-synced object, and how data is transferred.
  29. 29. UNet (3 of 4) Manage objects. Enable / disable components based on whether the client controls this instance of a player.
  30. 30. UNet (4 of 4, optional) Manage sync. Smoothly transition between state snapshots rather than pop between them.
  31. 31. UNet Video Tutorials gamertogamedeveloper.com 21 episode long video tutorial of creating a project with UNet. Includes source code of final project!
  32. 32. Legacy Warning Legacy Unity Networking and UNet don’t mix! Check documentation to make sure you are using consistent components.
  33. 33. Parse
  34. 34. Parse A “Backend as a Service” owned by facebook. Not created just for game development, but is useful in this domain.
  35. 35. Parse (1 of 3) Create objects.
  36. 36. Parse (2 of 3) Retrieve objects (from the same client or others).
  37. 37. Parse (3 of 3) Query objects (from the same client or others).
  38. 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. 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.
  40. 40. 4 HACKATHON TIPS Let's build stuff.
  41. 41. AIM FOR THE SUNNY SCENARIO Robust multiplayer handling is hard. Assume everything with the connection is fine.
  42. 42. FORGET ABOUT SECURITY / CHEATING Its OK to give clients more than they need to know if it makes things easier for you. For now.
  43. 43. GET THE NETWORKING POC DONE QUICK Think of the solution that suits your game. Get to a point where two clients share data ASAP.
  44. 44. LOVE THY NEIGHBOUR You will share similar difficulties with the other groups. Use the power of the group to solve things faster.
  45. 45. Thanks! ANY QUESTIONS? You can find me at: @noamgat noam@tacticsoft.net

×