Data Stores #
Custom game and player data #
You can store custom data about a game instance and its players on the ExtData
proto. Information on this proto is managed using the Game Instance DataStore
interface.
Most game instance data should remain on the game server and be sent directly to players. However, you may want to use the data store when:
- Players need to communicate with each other before a game server is allocated
- The game server needs to send information to the Pragma backend that impacts finding more players for the game instance
- You need to select which player will host a peer-to-peer game
- Players are required to pass a ready check before a game server is allocated
- Players have to select a unique character from a pool of characters before a game server is allocated
Game instances and games players have an associated DataStore property (GameInstance.dataStore
and GamePlayer.dataStore
, respectively) that can be used to create and update ExtData
related to the game instance or game player.
When a player leaves or is removed from a game instance, their GamePlayer object is removed along with the data in their data store.
See the Manage game data tasks for instructions about customizing a DataStore
.
Data synching #
Each item in the DataStore can be synced to specific players, players in a party, players on a team, or made public. Sync options determine what players (if any) are notified of data store changes.
To configure data sync options, specify one of the following when creating a DataStore
:
Hidden
: Data is not synced with any player/party/team and is accessible only from theGameInstancePlugin
Player
: Data is sent to a specific player client in the game instanceParty
: Data is sent to player clients for all players in a specific party in the game instanceTeam
: Data is sent to player clients for all players on a specific team in the game instancePublic
: Data is sent to all players clients in the game instance