Documentation

Multiplayer Services SDK

All Services

Multiplayer Services SDK

Integrate multiplayer sessions

Learn how multiplayer sessions manage connected players, session ownership, and game state in Unity Multiplayer Services.
Read time 2 minutesLast updated 10 days ago

Implement multiplayer functionality in your games using sessions, a unified system that manages player connections and interactions across multiple Unity Gaming Services.
Sessions provide an abstraction layer for managing multiplayer game states, including initial player connections and gameplay interactions, and automatically handle complex multiplayer operations such as host election, players joining or leaving, and network connection establishment.
Beginning with Unity 6.0 LTS, developers can use session operations to create their multiplayer experiences. Instead of having to manually coordinate between the SDKs for Lobby, Matchmaker, and Relay, the Multiplayer Services (MPS) SDK merges the functionality previously spread across these individual services' SDKs into a unified API centered around sessions. For example, when creating a session, the MPS SDK automatically handles lobby creation, relay allocation, and manages the Netcode connection. Similarly, while joining a session, the MPS SDK manages lobby joining, and Netcode connection establishment. This combined approach maintains all the capabilities of the underlying Unity Gaming Services (UGS) Multiplayer services while reducing implementation complexity.
Important
Starting with Multiplayer Services SDK version 1.2, the default network handler implementation for Netcode for Entities automatically creates client and server worlds if none are available when starting a network connection through sessions.
Older versions of the MPS SDK require you to create your Netcode for Entities client and server worlds before you can create or join a Multiplayer Services session. When you first add the Netcode for Entities package to your project, the default bootstrap automatically creates the client and server worlds at startup.
For more advanced use cases, use a custom network handler to override the default integration with Netcode for Entities.