Allocating based on GameServer Player Capacity
GameServerthat has room for a specific number of players.
The Player Tracking and Allocation Player Filter features are currently Alpha, not enabled by default, and may change in the future.
Use the FeatureGates
to enable and test these features.
See the Feature Gate documentation for details on how to enable features.
The Allocation State Filter feature is currently Beta, and while it is enabled by default it may change in the future.
Use the Feature Gate
StateAllocationFilter to disable this feature.
See the Feature Gate documentation for details on how to disable features.
Using this approach, we are able to be able to make a request that is akin to: “Find me a
GameServer that is already
allocated, with room for n number of players, and if one is not available, allocate me a
Common applications of this type of allocation are Lobby servers where players await matchmaking, or a persistent world server where players connect and disconnect from a large map.
The below allocation will attempt to find an already Allocated
GameServer from the
Fleet “lobby” with room for 10
to 15 players, and if it cannot find one, will allocate a Ready one from the same
apiVersion: "allocation.agones.dev/v1" kind: GameServerAllocation spec: selectors: - matchLabels: agones.dev/fleet: lobby gameServerState: Allocated players: minAvailable: 10 maxAvailable: 15 - matchLabels: agones.dev/fleet: lobby
NoteWe recommend doing an extra check when players connect to a
GameServerthat there is the expected player capacity on the
GameServeras there can be a small delay between a player connecting and it being reported to Agones.
- Have a look at all commands the Client SDK provides.
- Check all the options available on
- If you aren’t familiar with the term Pod, this should provide a reference.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified March 29, 2023: Helm test content update in Agones doc (#3052) (60f72f0)