A new Player Data service has been released that is more up to date and supported with this current release of Pragma Engine. We recommend you check it out by viewing the Player Data Overview page.

Inventory Service #

Pragma Engine’s Inventory service manages inventory data with a sound transactional model that accounts for real-world scenarios like service outages and database instabilities. The Inventory service offers a rich content management system to address live migration so invenotry data can be evolved throughout the lifecycle of a live service game.

Items #

Items are the building blocks of the Inventory service. They store data for anything from the traditional in-game items (gear, currency) to metadata items (player’s stats, loadouts). Pragma Engine has two main data types: instanced items and stackable items. The contents of instanced and stackable items are created within Pragma Engine’s predefined protobuf files. Custom protobuf definitions can be added to ext fields.

Pragma Engine supports hidden inventory items with service calls that return filtered inventory information based on the tags in the configuration. Sensitive information such as matchmaking rating can be stored as an instanced item and hidden from players.

Features #

In this section, we’ll briefly go over several features within the Inventory service:

Store #

The Store system handles the creation of store catalogs. This includes managing the exchange of instanced and stackable items. Stores can be individually managed, enabling special events such as limited-time content sales.

The Inventory service verifies if a player meets the cost requirements of a purchase. Additional custom logic for the requests can be defined in the optional Store Plugin.

Example: Arrow bundles

Consider a game where you want the cost of an arrow to be equivalent to 1 gold coin. Below are what various bundle options could look like in a store:

  • 1 arrow for 1 coin
  • 10 arrows for 10 coins
  • 25 arrows for 25 coins

Crafting #

Pragma Engine’s Crafting system is feature-rich and extensible to fit any game’s needs. The Crafting system supports anything from a simple exchange of instanced and stackable items to granting randomized rewards.

The logic to verify the requests and the items granted to players is defined within the Crafting Plugin. This allows studios to set dynamic exchange rates of items for players based on their requests and set item limitations.

Example: Arrow purchasing

Consider a game where the cost of an arrow is equivalent to 1 gold coin with a max of 100 arrows that a player can hold in their inventory at once. Below are the request results for two players purchasing arrows with their remaining account balance:

  • Player 1 currently has 85 arrows in their inventory and 20 coins. They are only able to spend 15 coins to cap at a total of 100 arrows.
  • Player 2 currently has 60 arrows in their inventory and 35 coins. They are able to spend their entire account balance and now have a total of 95 arrows in their inventory.
For an in-depth guide, see the Crafting tutorial.

Rewards #

The Rewards system powers weighted random rolls of rewards content. Pragma Engine has reward tables which provide a lot of flexibility for defining rewards content without the need of additional plugin code.

Limited grants #

Limited grants are one-time grants given to players on login. They can contain any combination of instanced or stackable items. Below are several scenarios for when players might be granted a limited grant:

  • starter pack for new players
  • an incentive for returning players
  • seasonal events for the entire player base

A start and end time can be set on limited grants, enabling items to only be granted to players during a specified time window.

Network authority #

The following are the features within the Inventory service catagorized by their network authority:

  • client authoritative:
    • Stores
    • Crafting
  • server authoritative:
    • Rewards
    • Limited Grants

Client authoritative notifications #

When updates are requested to the inventory database through client authoritative endpoints, the response contains information which the SDK Inventory service will use to update the client-side cache.

Server authoritative notifications #

When updates are requested to the inventory database through server authoritative endpoints, the Inventory service will first send out a notification to the game-client SDK. The Inventory service SDK will then update the client-side cache accordingly.

Pragma Engine Inventory Service Plugins #

PluginDescription
InstancedItemPluginenables creation and update of an instanced item
StorePluginenables the customization of requirements for purchase requests
CraftingPluginenables the customization of requirements of craft requests and houses the logic for what items to grant players from successful craft requests
RewardSelectorPlugindetermines the reward selected
InventoryOperationsPluginenables granting, updating, and destroying items during match end processing

Topics in this section #

TopicDescription
ItemsUse instanced items and stackable items to build out your inventory system.
StoreCreate store catalogs to manage exchanging stackable and instanced items.
CraftingFrom simple exchanges of materials for gear to complex, nested, pseudo-random rolled item grant and upgrade systems.
RewardsPowers weighted random rolls of rewards content.
Limited GrantsUse limited grants to send players items.