Inventory - Pruning Deprecated Items

Inventory Pruning is an optional feature to keep player inventories lean when your content is constantly changing

Normally inventory item types are meant to be long-lasting, and the corresponding items may be owned by players indefinitely. However, in some styles of game, there are item types that are only meaningful for a limited time period, and it makes sense to remove the content definitions when the relevant time period ends. This can lead to Deprecated Items, described below. To prevent deprecated items from building up, you can enable Inventory Pruning on your realm.

Deprecated Items

When a player owns an item but the content entry defining that item type has been deleted, the item stays in the player's inventory but is considered to be "deprecated". In the Beamable Portal, items' deprecated status will appear in the Permission section of the inventory view.

Items that are deprecated cannot be used effectively in game code, since the Beamable SDK has no way of knowing what their fields should be. Without the content definition, the SDK cannot determine the schema for those items.

Inventory Pruning

When you know that you will be causing items to become deprecated, you can enable Beamable's optional inventory pruning feature. This feature is enabled by a setting in your realm's configuration, and lazily performs pruning logic when a player's inventory is loaded into memory.

To enable inventory pruning, go to the Operate > Config section of the Beamable Portal and add two entries in the "inventory" namespace using the Add + button. The two configuration values to add are pruneItems and deprecatedContentTtlDays. Item pruning is turned off by default (that is, the default value for pruneItems is false), and the default time-to-live (TTL) is 10 days.

Note that pruning is "lazy": the criteria for inventory pruning will only be evaluated by Beamable services when the player's inventory is loaded into memory. As such, pruning will NOT occur for players who have not played recently.