Howdy!
I am working on a game that requires stacks of items in the inventory. Players of the game can store their items in one of N locations, let's say at the very least in a box and on their person. Furthermore, when a player enters a server, we rely on Playfab to let us know what's in each of these locations.
I see Playfab has a stackable functionality for items, specifically using the "Is stackable" flag which showcases a "Remaining uses" amount; however, I also saw that only one stack is allowed per item. Since our game technically allows you to store some of Item A in a box and some of Item A on the person, what's the recommended way to structure this in Playfab?
We currently have two options that we are considering. Is there a better way than these two, or perhaps something I'm misunderstanding with regards to how Playfab's economy is meant to be structured?
-----
Option 1:
Avoid using "Is stackable" entirely and instead store item amounts inside of the item's custom data. Within the player's title data, we then keep a list of item IDs that are on the person. This way, we can have multiple stacks of items, some of which may be stored on the person. We do not get the benefit that Playfab stackables provide, but we at least get full control over how to stack items and get to keep all item-specific data on the item itself. This also means we have to maintain and merge stacks ourselves, which is less ideal.
Option 2:
Use "Is stackable" and come up with an additional data structure on the title data to show which items, as well as how many of each item, are on the person. We get the benefits that Playfab stackables provide (automatic increment / decrement when granting / revoking items, etc.), but now our additional data structure on the title data has to keep track of an amount that represents a subset of how much of an item we actually have, which may lead to data desynchronization if we're not careful.
-----
While I would love to take advantage of Playfab stackables and go for Option 2, I'm leaning toward Option 1 to keep the data simpler. If stackables allowed for multiple stacks, this would be an easy win for Option 2, but without that, I just can't wrap my head around the feasibility.
Any and all advice would be greatly appreciated. Thank you so much!