Allocations
Note: The content on this page pertains to Multiplay Hosting, available on the Unity Cloud Dashboard. If you’re using Clanforge, refer to Clanforge documentation.
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).
Note: You can also use an allocations payload to send a file to a server along with the allocation request.
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 several ways:
- Using the Multiplay Hosting API
- Using the Multiplay Hosting SDK
- Using the Unity Cloud Dashboard (to create a test allocation)
When you create an allocation request, you must supply an allocation UUID (unless it’s a test allocation made through the Unity Cloud Dashboard). After you create the allocation, you can access the allocation UUID from the server.json
file or the Multiplay Hosting SDK.
After Multiplay Hosting receives an allocation request, it uses information from the request and QoS to select the best possible server for the game session while considering the following:
- The server region.
- The quality of the connection between the server and the game client.
- The build and build configuration of the server.
This way, the allocation system always fulfills allocation requests with a game server instance that optimizes performance, availability, and costs.