Fleet Service Components #

Fleet Plugin #

The Fleet Plugin methods that interact with the Fleet service allow developers to manage game server capacity for fulfilling game instance requests. In the Fleet Service Tasks topic we’ll see how to use the Fleet Plugin methods, along with the SDKs that invoke them.

initProvides an HTTP client through which Pragma can communicate with external resources for capacity.
selectServerPoolUses custom logic to determine what server pool should be used when allocating game servers for the given game allocation request.
getServerPoolByIdAssociates the provided server pool ID with a new or existing server pool. Executed when Pragma does not recognize the game server reporting its capacity.
addAllocates additional game servers for a specific server pool. Executed when the current available capacity cannot fulfill a request to create a game instance.

Pragma provides some reference examples for existing platforms:

  • PragmaNomadFleetPlugin - Run servers using Nomad. Selects server pools based on game server version. All server pools map to the default server management policy.
  • LocalProcessFleetPlugin - Run servers using local hardware. Selects server pools based on game server version.
  • DefaultFleetPlugin - This implementation does not allocate game servers. Includes one server pool with the default server management policy.

You can view more details about the Fleet Plugin methods and their properties in the reference section of the documentation.

Server Pool Interface #

serverPoolIdUnique ID for the server pool
managementPolicyIdUnique ID for the server pool management policy associated with this server pool
extThe ExtServerPool payload containing extra information that can be used when allocating game servers

Server Pool Management Policy Configuration #

The ServerPoolManagementPolicyConfig configuration block provides a place to define values for server pool management policies. The following configuration values are available in the game: serviceConfigs: FleetServiceConfig: serverPoolManagementPolicies: block

idUnique ID for this server capacity pool management policy
gameCapacityPerServerMaximum number of game instances that can run on a single game server. Value must be at least 1.
capacityFloorMinimum game capacity allocated at all times
capacityCeilingMaximum game capacity allocated at all times
capacityBufferPreferred available game capacity defined as a percentage of used game capacity
serverMaxStartDurationMillisMaximum duration, in milliseconds, a game server can take to start before the allocation is declared failed
serverHeartbeatPeriodMillisMillisecond interval at which a game server should report its capacity
serverHeartbeatExpiryFactorNumber of heartbeats that can be missed before a game server is considered unresponsive
gameCapacityResolvedTimeoutMillisMaximum duration, in milliseconds, the platform will wait for capacity to resolve for a game instance before ejecting it
Consider what capacityFloor and capacityCeiling values are appropriate for your environment. Setting these values too low or too high can lead to undesirable game instance load.

Extension Data #

ExtHostRequestData to assist in game server allocation. Populated by GameInstanceHostPlugin.findHostForGameInstance and used in the Fleet service to determine which server pool to assign for the game instance. Example value: game mode (3v3, 1v1, etc.) or game version (beta, trial, etc.)
ExtServerPoolPopulated by the Fleet Plugin selectServerPool method and used when allocating game servers. Example value: game mode (3v3, tutorial, etc.) or game version (0.4, 0.5, etc.)