Allocations

Note: The content on this page pertains to Game Server Hosting (Multiplay) available on the Unity Cloud Dashboard. If you’re using Game Server Hosting (Clanforge), refer to the Game Server Hosting (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 Game Server Hosting finds the best possible server based on information from the request and quality of service (QoS) data.

After finding the best available server, Game Server 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 Game Server 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:

  1. The matchmaker groups players for a game session.
  2. The matchmaker requests an allocation from the Game Server Hosting (Multiplay) API, and Game Server Hosting queues the allocation request.
  3. Game Server Hosting asynchronously finds the best server for the game session based on the parameters of the allocation request.
  4. Game Server Hosting removes the selected server from the available servers pool and marks it as allocated.
  5. Game Server Hosting applies configurations from the build configuration (or the allocation payload) to the server and ensures the server is ready.
  6. Game Server Hosting returns the server information to the matchmaker when the server is ready.

Allocation requests

You can create an allocation in several ways:

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 Game Server Hosting SDK.

After Game Server 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:

This way, the allocation system always fulfills allocation requests with a game server instance that optimizes performance, availability, and costs.