question

Terry Evans avatar image
Terry Evans asked

Recommendations for nested inventory items ?

In a character's inventory we need to be able to support nested items. For example, a weapon may have several attachments on it, or a backpack may have items inside of it - all of which will vary from character to character.

I'm not sure how best to approach that design using PlayFab. Any recommendation on how to proceed?

Player Inventory
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

element808 avatar image element808 commented ·

I'm adding this as a comment cause there may be a better answer out there and this is more of a suggestion.

I'd suggest not using PlayFab for handling nested items. I'd let PlayFab handle what's equipped, but in a linear fashion (i.e. (gemslot1: diamond, gemslot2: ruby, weapon: sword of truth). Then let the game logic determine what to do when a player has a diamond and ruby equipped when the sword of truth is also equipped.

0 Likes 0 ·
Citrus Yan avatar image
Citrus Yan answered

PlayFab does not natively support nested inventory items, however, each item in the inventory, including character inventory, can have its own custom data where you can store states, attachments info, etc. to help you handle the logic in the app. The API to do that is:

Server/UpdateUserInventoryItemCustomData

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Terry Evans avatar image
Terry Evans answered

Thank you for the reply. We will handle the game logic in the app, so that shouldn't be an issue. It's more how do we store the items in PlayFab so they can be nested - each item with their own item state like health, etc.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.