Build a competitive multiplayer game using the recommended Unity multiplayer services and packages.
Read time 1 minuteLast updated 10 hours ago
In fast-paced competitive games, multiplayer gameplay involves constantly exchanging player actions and game state information in real time. Common games types are first-person shooters, fighting games, and battle royales.To automatically install all the recommended Unity multiplayer services and packages for a competitive multiplayer game, use the Multiplayer Center.
Connecting players
Recommended package: Multiplayer Services SDK.The Multiplayer Services SDK provides a unified API to access Unity's multiplayer services, including multiplayer session management, hosting game sessions, matching players together, browsing games and inviting friends.
Networking
Recommended packages: Netcode for Entities and Unity Transport.Because competitive games often have many players and require real-time synchronization of all game state information, you will likely need to use a client-server architecture where a dedicated server manages the game state and clients connect to it. Netcode for Entities is built on the Entity Component System (ECS) and provides high-performance networking for large-scale multiplayer games with a server-authoritative architecture that supports client prediction and lag compensation.Unity Transport is the default transport layer for Netcode for Entities and provides a low-level API for sending and receiving data over the network. It supports both reliable and unreliable communication, which can be useful for different types of game state information in a competitive multiplayer game.
Development and testing
Recommended package: Multiplayer Play Mode.The Multiplayer Play Mode package allows you to test your multiplayer game in the Unity Editor by simulating multiple players and network conditions on a single local development machine. Netcode for Entities also includes its own testing tools such as thin clients and a Network Profiler.