Master Data Reference of GS2-Inventory

Reference of the format of master data and various models to be imported
{
  "version": "2019-02-05",
  "inventoryModels": [
    {
      "name": "[string]Inventory Model Name",
      "metadata": "[string?]Metadata",
      "initialCapacity": "[int]Initial Capacity",
      "maxCapacity": "[int]Maximum Capacity",
      "protectReferencedItem": "[bool?]Item Sets with registered references cannot be deleted",
      "itemModels": [
        {
          "itemModelId": "[string]Item Model GRN",
          "name": "[string]Item Model Name",
          "metadata": "[string?]Metadata",
          "stackingLimit": "[long]Maximum stackable quantity",
          "allowMultipleStacks": "[bool]Allow items to be stored in multiple slots when the maximum stackable quantity is exceeded",
          "sortValue": "[int]Display order"
        }
      ]
    }
  ],
  "simpleInventoryModels": [
    {
      "name": "[string]Simple Inventory Model Name",
      "metadata": "[string?]Metadata",
      "simpleItemModels": [
        {
          "itemModelId": "[string]Simple Item Model GRN",
          "name": "[string]Simple Item Model Name",
          "metadata": "[string?]Metadata"
        }
      ]
    }
  ],
  "bigInventoryModels": [
    {
      "name": "[string]Big Inventory Model Name",
      "metadata": "[string?]Metadata",
      "bigItemModels": [
        {
          "itemModelId": "[string]Big Item Model GRN",
          "name": "[string]Big Item Model Name",
          "metadata": "[string?]Metadata"
        }
      ]
    }
  ]
}
TypeConditionRequiredDefaultValue LimitsDescription
version
2019-02-05Format version of master data
inventoryModelsList<InventoryModel>~ 50 itemsInventory Model
Inventory is like a bag that stores items owned by game players.
Inventory can have a set capacity and cannot be owned beyond its capacity.
simpleInventoryModelsList<SimpleInventoryModel>~ 50 itemsSimple Inventory Model
In a normal InventoryModel, you could limit the amount of items that could be stored in your inventory.
Simple Inventory, however, has no such functionality and simply stores the number of items in the inventory.

However, the Simple Inventory provides an API that can increase or decrease the number of items in a single process.
bigInventoryModelsList<BigInventoryModel>~ 50 itemsBig Inventory model
In the normal InventoryModel and SimpleInventoryModel, the number of items that can be stored in the inventory is limited to the range of 64bit integer values.
In inflationary games, you may need a wider range of values.

In the Big Inventory Model, the number of items that can be stored in the inventory can have an integer value of 1024 digits.

AcquireCount

Quantity of simple items obtained

TypeConditionRequiredDefaultValue LimitsDescription
itemNamestring
~ 128 charsSimple Item Model Name
countlong
1 ~ 9223372036854775805Quantity to be obtained

ConsumeCount

Consumption quantity of simple items

TypeConditionRequiredDefaultValue LimitsDescription
itemNamestring
~ 128 charsSimple Item Model Name
countlong
1 ~ 9223372036854775805Quantity to be consumed

HeldCount

Quantity of simple items in possession

TypeConditionRequiredDefaultValue LimitsDescription
itemNamestring
~ 128 charsSimple Item Model Name
countlong
0 ~ 9223372036854775805Number of items held

InventoryModel

Inventory Model

Inventory is like a bag that stores items owned by game players. Inventory can have a set capacity and cannot be owned beyond its capacity.

TypeConditionRequiredDefaultValue LimitsDescription
inventoryModelIdstring
~ 1024 charsInventory model GRN
namestring
~ 128 charsInventory Model Name
metadatastring~ 2048 charsMetadata
initialCapacityint
0 ~ 2147483646Initial Capacity
maxCapacityint
0 ~ 2147483646Maximum Capacity
protectReferencedItembool?falseItem Sets with registered references cannot be deleted
itemModelsList<ItemModel>
[]1 ~ 1000 itemsList of item models that can be stored in inventory

ItemModel

Item Model

Items can be held in groups within a single inventory slot, such as Potion ×99. This grouping of multiple items into one slot is called “stacking,” and a maximum stack size can be set for each item.

The behavior when the stack limit is reached can also be set for each item. Specifically, you can choose one of the following:

  • Add a new inventory slot to allow further acquisition
  • Prevent further acquisition once the limit is reached
TypeConditionRequiredDefaultValue LimitsDescription
itemModelIdstring
~ 1024 charsItem Model GRN
namestring
~ 128 charsItem Model Name
metadatastring~ 2048 charsMetadata
GS2-Enhance features a mechanism that works in conjunction with GS2-Inventory to perform enhancements. It sets the experience value when used as enhancement material in JSON format within the ItemModel metadata.
Details are explained in the Microservices Introduction / GS2-Enhance section.
stackingLimitlong
1 ~ 9223372036854775805Maximum stackable quantity
allowMultipleStacksbool
Allow items to be stored in multiple slots when the maximum stackable quantity is exceeded
sortValueint
0 ~ 2147483646Display order

SimpleInventoryModel

Simple Inventory Model

In a normal InventoryModel, you could limit the amount of items that could be stored in your inventory. Simple Inventory, however, has no such functionality and simply stores the number of items in the inventory.

However, the Simple Inventory provides an API that can increase or decrease the number of items in a single process.

TypeConditionRequiredDefaultValue LimitsDescription
inventoryModelIdstring
~ 1024 charsInventory model GRN
namestring
~ 128 charsSimple Inventory Model Name
metadatastring~ 2048 charsMetadata
simpleItemModelsList<SimpleItemModel>
[]1 ~ 1000 itemsList of simple item models that can be stored in inventory

SimpleItemModel

Simple ItemModel

ItemModel allowed setting a maximum stackable quantity, enabling implementation where items exceeding a certain number could be split into multiple stacks. SimpleItem does not have such a function and simply stores the number of items in the possession of the item.

TypeConditionRequiredDefaultValue LimitsDescription
itemModelIdstring
~ 1024 charsSimple Item Model GRN
namestring
~ 128 charsSimple Item Model Name
metadatastring~ 2048 charsMetadata

BigInventoryModel

Big Inventory model

In the normal InventoryModel and SimpleInventoryModel, the number of items that can be stored in the inventory is limited to the range of 64bit integer values. In inflationary games, you may need a wider range of values.

In the Big Inventory Model, the number of items that can be stored in the inventory can have an integer value of 1024 digits.

TypeConditionRequiredDefaultValue LimitsDescription
inventoryModelIdstring
~ 1024 charsInventory model GRN
namestring
~ 128 charsBig Inventory Model Name
metadatastring~ 2048 charsMetadata
bigItemModelsList<BigItemModel>
[]1 ~ 1000 itemsList of big item models that can be stored in inventory

BigItemModel

Big ItemModel

ItemModel allowed setting a maximum stackable quantity, enabling implementation where items exceeding a certain number could be split into multiple stacks. SimpleItem does not have such a function and simply stores the number of items in the possession of the item.

TypeConditionRequiredDefaultValue LimitsDescription
itemModelIdstring
~ 1024 charsBig Item Model GRN
namestring
~ 128 charsBig Item Model Name
metadatastring~ 2048 charsMetadata