question

Akshith avatar image
Akshith asked

Inventory size limit

In my game I have limitations on Inventory, So while granting an item to a user, if the size exceeds the user inventory size limit, I will be adding a custom data(a flag) to that item to identify that item is not moved inventory. Later when he has enough size in inventory to claim this reward, I will be remove the flag.

Do you think this approach will work? Is there any limitations that I have to worry about?

Player Inventory
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

·
Sarah Zhang avatar image
Sarah Zhang answered

Edit: there is no Essentials tier anymore - the only limit difference between titles is that when titles are in Development Mode, they are limited to only 100K total player accounts created.

>> Is there any limitations that I have to worry about?

Firstly, PlayFab has a native limit on the number of player inventory items. For essentials tier it would be 100, for paid tier, it would be 1500, you can navigate to https://developer.playfab.com/en-US/[YourTitleId]/limits to check the PlayFab limit about inventory items for your title.

>> Do you think this approach will work?

If the items’ total number in a player’s inventory exceeds the PlayFab inventory item limit, this item would not be granted to the player, so the inventory instance item’s custom data cannot be set too, catalog items’ “item custom data” would be global data not suitable for these situations. We would recommend you use Player Read-only Data to set a flag for the item.

If you want to set a limitation less than PlayFab‘s limit on your own, like a limit whose number is 50, your approach would work. If so, what you want to do is to hide a part of items on clients based on the inventory instance item custom data. But once the number exceeds the PlayFab’s limits, you need to store the flag on somewhere else other than inventory instance item’s custom data, such as Player Read-Only Data.

Another idea is to grant the items based on your custom limits. You can let clients call a custom CloudScript function to validate if the items’ number exceeds your limit. If the existing number has been equal to the limit number, don’t grant the item to the players. When their inventory has an empty slot, let players decide for themselves whether to pick up the corresponding items again.

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.