Player Data #

Pragma’s Player Data service is used to implement game features for managing individual player’s data. Such features include inventory, loadouts, vendors, progression systems, and more.

Using the Player Data service involves authoring a feature’s APIs and persisted data models, which are then made available as part of SDK generation. Behind the scenes, the Player Data service handles persistence, transactions, client and server side caching, and generating deltas for client updates.

Orange, yellow, and green diagram with boxes and lines.

How Pragma Engine can use the Player Data service to manage players unlocking heroes.

Structure of persisted data #

Player data persists in developer-defined data types called Components. Components are registered to an Entity, which is used to organize related Components. For example, to persist hero data, a player might have an Entity called Hero-Achilles with a collection of Components that store that hero’s loadout and level data.

Yellow box with smaller yellow and white boxes inside.

Players’ data is persisted under their playerId using the Entity and Component structures

APIs #

APIs for player data are called Operations and are written by the developer. Defining an Operation includes specifying the Operation’s SDK access and defining the request and response payloads.

Within any Operation, you can:

  • Access a snapshot of one player’s entities and components
  • Add, update, and remove entities and components
  • Call other Operations

Sub Services #

Operations are defined in a class that inherits from PlayerDataSubService. This allows Operations to be grouped together to help create maintainable code.

SDK generation #

Each Sub Service and its Operations are used to generate a Player SDK for game clients and a Partner SDK for game servers.

Content #

Most player data features will need access to global game data. Pragma refers to such data as Content. Examples include: tiers in a ranking system, heroes to unlock, collectable materials, and progression steps through a battlepass.

Pragma provides a suite of tools for defining and cataloging Content Data. Operations can easily access all Content and use it to inform how to modify a player’s data.

See our Game Data documentation for more information.

Topics in this section #

TopicDescription
How-To GuidesGet started in Pragma Engine’s Player Data service with our How-To Guides.
ReferenceSupported code gen types, classes, interfaces, SDKs, and errors related to the Player Data service.