Team Inventory #

Preview
The features described below are in preview at the moment.

Overview #

The Team Inventory facilitates cooperative management and usage of shared items among team members, enhancing collaborative strategies and efficient resource utilization. It allows teams to collectively manage, use, and evolve item collections.

Key Operations #

Team Inventory supports various collaborative operations such as maintaining, updating, and consuming shared items, enabling cooperative gameplay and resource management.

  • Retrieve full inventory lists.
  • View and manage current inventory items.
  • Admin-exclusive item granting and consumption.
  • Update specific item properties and track changes.

InventoryList #

  • Retrieve comprehensive inventory lists, with filters by category or item sets.

InventoryListInventoryItems #

  • Accessible by all members to view current items, their counts, and properties.

InventoryGrantItems (Admins only) #

  • Grants new items to the inventory, supporting both stackable and non-stackable items.
  • Adheres to predefined inventory item limits.

InventoryConsumeItems (Admins only) #

  • Allows admins to consume items from inventory, triggering configured rewards and achievements.
  • Validates item availability before consumption.

InventoryUpdateItems #

  • Updates specific properties of item instances, such as enchantments or durability.
  • Tracks and triggers events related to item property changes.

Example Implementation #

Cooperative Crafting Game Scenario #

Teams collaboratively gather resources such as wood, stone, and magic essences:

  • Contribution: Player A contributes 20 units of wood.
  • Additional Contribution: Player B adds 15 units of stone.
  • Usage: Admin Player C consumes these items to construct a fortress, triggering team-wide rewards or achievements.

This example highlights how Team Inventory enables collective effort and achievement.

Key Terms #

  • Stackable vs Non-Stackable Items:

    • Stackable items (e.g., wood) accumulate quantity.
    • Non-stackable items (e.g., unique gear) exist as distinct instances.
  • Item Instance Properties:

    • Unique item characteristics (enchantment levels, durability).
  • Item Sets:

    • Grouped items managed collectively for efficient categorization and utilization.
  • Consumable Items:

    • Items removed upon use, typically linked with progression, rewards, or achievements.

Inventory Limits #

  • max_count: Maximum allowable items in the inventory.
  • Category or Set Limits: Restrictions applied to item categories or predefined sets.

Limits are team-wide, independent of team size.

Technical Considerations #

Granting Zero Items #

  • Items granted with a count of zero will be added only if KeepZero is explicitly enabled.

Over-Consumption Protection #

  • Validates available item quantities prior to removal, preventing negative inventory states.
  • Triggers errors if insufficient quantity is detected.

Concurrent Grants/Updates #

  • Employs Nakama storage versioning for concurrency management.
  • Ensures data consistency, preventing overwrites during simultaneous updates.
  • Requires robust retry mechanisms to handle version conflicts.

UpdateItem Edge Cases #

  • Property updates necessitate valid item instance IDs.
  • Invalid or missing IDs generate logged warnings, skipping the updates.