question

contact-3 avatar image
contact-3 asked

Inventory with large custom data. Initialization and updates.

Hi,

We have a specific setup for our game "catalog" and "inventories", we have something working great with player data yet I'm wondering how would be the best way to implement it through PlayFab api. I've looked at different answers on the subject but didn't find my answer.

We have a large "catalog" of items, (around 1000 but could grow more) these items are characters, equipments, skills, buffs, etc... They can have components that are c# serialized data with $type infos from Json.net. This catalog is for now stored in a json file in the server assets.

Effective binary size of these items in the catalog can greatly vary from a simple set of key/pair values to a much complexe structure with several serialized components and other items references.

Then an inventory is created that reference those catalogs items. They themselves have custom data over the catalog items, like progression components (xp component and equipment component for characters for instance) and so on. These inventories are stored in the player data title. We split them so they can fit within the Player data value size limit.

Now this is working well, but we feel it's a bit hacky and that it could be enhanced to better fit the PlayFab model, like being able to update inventory items individually.

So basically the questions are :

- Should we keep using player data ?

- Should we instead create PlayFab catalog items with ours and use the inventory + characters API ? => I feel we're going to be stuck by limits of Inventory item data key size / Inventory item data value size, and update limite rates at initialization.

- Or should we go to PlayFab entities files instead of player data? So we won't have to bother spliting the inventory anymore (as there files seems to handle large amount of data, and the sum of all player data will hardly reach 50go of json data), is it efficient enough though? Any thottling on files API ?

We basically update the inventories when changing the teams composition or equipments (as we change the attached components), when we loot/gain xp at the end of a game and when the player sells/buy things. So nothing realtime.

Thank you.

dataPlayer InventoryCharacter Data
10 |1200

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

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

To better fit the PlayFab model and make the most out of our system, it’s suggested that you use our Economy System (Catalog, Inventory, etc.). I understand that you may be stuck by limits of Inventory item data key/value sizes, for that you can still use player data to store the data. Regarding using entity files, I don’t think it would be cost-effective since updating a small fraction of the data would require updating the whole file, which could meter high volume of Content & Configuration Writes when you have a large player base.

2 comments
10 |1200

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

contact-3 avatar image contact-3 commented ·

Thanks for your answer,
So basically you're saying that we should try to migrate to the inventory/catalog system.
But that we could as well stick with the player data?
Or are you suggesting using a hybrid approach with most of the data in the catalog/invent and what does not fit goes in the player data?

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan contact-3 commented ·

Yes, a hybrid approach is what i was talking about:)

1 Like 1 ·

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.