Allocations
Learn how allocations match players to available game servers for multiplayer sessions.
Read time 2 minutesLast updated 3 days ago
An allocation is a reservation of a game server for a game session. It’s a way to temporarily put aside a specific game server for a game session so that it’s unavailable for other purposes (such as another game session).
You can think about allocations from different perspectives, depending on the stage of the allocation lifecycle.
When you first request an allocation, it’s just that–an allocation request. It remains a request until Multiplay Hosting finds the best possible server based on information from the request and quality of service (QoS) data.
After finding the best available server, Multiplay Hosting removes the selected server from the available server pool and sends its information back to the caller.
The selected game server remains allocated until you (or Multiplay Hosting) deallocates it, freeing it up for the next game session. Deallocations usually occur when a game session ends, but a few other scenarios might trigger deallocation, such as an unexpected exit.
Although it varies depending on the game, a typical allocation flow (using a matchmaker) looks something like this:
- The matchmaker groups players for a game session.
- The matchmaker requests an allocation from the Multiplay Hosting API, and Multiplay Hosting queues the allocation request.
- Multiplay Hosting asynchronously finds the best server for the game session based on the parameters of the allocation request.
- Multiplay Hosting removes the selected server from the available servers pool and marks it as allocated.
- Multiplay Hosting applies configurations from the build configuration (or the allocation payload) to the server and ensures the server is ready.
- Multiplay Hosting returns the server information to the matchmaker when the server is ready.
Allocation requests
You can create an allocation in multiple ways:- Using the Multiplay Hosting API
- Using the Unity Dashboard (to create a test allocation)
server.json- The server region.
- The quality of the connection between the server and the game client.
- The build and build configuration of the server.