Search Unity

Build a production-ready multiplayer game with Netcode for GameObjects

April 5, 2023 in Games | 5 min. read
Still from Unity's Boss Room sample game
Still from Unity's Boss Room sample game
Share

Is this article helpful for you?

Thank you for your feedback!

Are you building a cooperative multiplayer game with Unity? We’ve got the perfect on-demand resource for you: A four-part webinar series from the Multiplayer team – now available on YouTube. This series dives into the Boss Room sample game to explore how you can build a production-ready multiplayer game with Unity and Netcode for GameObjects.

1. Understand basic game implementation and server authority

Creating multiplayer games isn’t just about using the right APIs. The first episode in the series covers best practices and provides advice when introducing a chaotic tech like the internet between your players when developing a multiplayer game.

In the first episode, we cover:

  • What is Netcode for GameObjects (NGO) and Unity Gaming Services (UGS)? 
  • NetworkVariables vs RPCs and reasons to choose which for each feature
  • Authority and why we chose server authority for most of our gameplay
  • Movements and alternative models like Client Authority for dealing with lag, and optimization tricks for pathfinding-based movements
  • Basic game implementation and how we used State (netvar, network list) and RPCs

This content is hosted by a third party provider that does not allow video views without acceptance of Targeting Cookies. Please set your cookie preferences for Targeting Cookies to yes if you wish to view videos from these providers.

2. Build out character abilities, spawning, and scene objects

Episode two covers the implementation of character abilities in Boss Room and how to approach ability implementation in your game. 

We dive into:

  • The general flow of implementing server-driven abilities
  • Reliability and what it means for RPCs to be unreliable
  • Melee attacks and the anticipation of animation issues
  • Tank shield functionality and interaction with the environment 
  • Archer powershots and Area of Effect (AOE), which require tracking inputs over time on the client side only
  • Mage firebolt and bandwidth use
  • The general architecture of our ability system

We also look at:

  • Dynamically spawned objects
  • Spawning static in-scene placed objects
  • Spawning destroyable in-scene placed objects
  • Lessons learned around zombie imps when late joining
  • Custom spawning logic like pools and how to integrate them with NGO

This content is hosted by a third party provider that does not allow video views without acceptance of Targeting Cookies. Please set your cookie preferences for Targeting Cookies to yes if you wish to view videos from these providers.

3. Make your multiplayer game resilient to your players

In the third session, we cover a few more game implementation details before diving into making your multiplayer game resilient to players.

We explore:

  • Physics interactions, objects and parenting, scenes and scene management
  • Using Relay and Lobby to take your game online and why you can’t use NGO for joining players
  • Character selection screen syncing between players using NGO and custom serialization
  • Making your game resilient to players coming and going, and reconnection flows, late join support, disconnection, and timeouts
  • Handling race conditions and various tests to perform

This content is hosted by a third party provider that does not allow video views without acceptance of Targeting Cookies. Please set your cookie preferences for Targeting Cookies to yes if you wish to view videos from these providers.

4. Optimize bandwidth and gamedev processes

In the fourth and final session of the series, we explore game development best practices for multiplayer games.

This episode covers:

  • Bandwidth optimizations and tools to profile, optimizing NetworkTransforms, and other tips
  • Debugging tools like network condition simulators, stats monitoring, and custom debug flows
  • Project architecture (action system, player architecture, etc.)
  • The future of Boss Room

This content is hosted by a third party provider that does not allow video views without acceptance of Targeting Cookies. Please set your cookie preferences for Targeting Cookies to yes if you wish to view videos from these providers.

Get started with multiplayer development

Watch the series? Share your feedback so we can plan even better sessions in the future.

If you’re ready to dive into your next multiplayer project with Unity and Netcode for GameObjects, here are some helpful resources to get you started:

Got questions or feedback about multiplayer game development in Unity? Feel free to join the discussion on Discord or in the forums.

April 5, 2023 in Games | 5 min. read

Is this article helpful for you?

Thank you for your feedback!

Related Posts