question

Kai Schuhmacher avatar image
Kai Schuhmacher asked

How should I handle an unlimited number of randomly generated Items?

Hello,

I'm pretty new to PlayFab and so I wanted to ask, how I should handle randomly generated items in my game. I want to create a manager game, where a user has a team and will be able to add new players to the team by opening something like a card pack. Such a pack should add a randomly generated player with randomly generated stats to the users list of players. So if we for example have 1000 users and everyone has 3 Players, then I would already exceed the pre configured Limit of Items of 3000 when the next pack is opened. Or even if I would say the item in the inventory is not a single player but the whole team containing those players in the json. When hitting 3000 Users, the next one will exceed the number of items, as every team is different etc. Or should something like that be stored in an external DB?

I hope you can get my point, if not, I will try to provide more information for you!

Thank you in advance.

multiplayerPlayer 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

·
Xiao Zha avatar image
Xiao Zha answered

If you are using Economy V1, there is a limit of 3000 items in the Catalog and a limit of 1500 items in each user’s inventory. You may store the player templates in the Catalog, and when user use a card pack, you may add random players to a user’s inventory and the random statistics can be saved in the custom data of the item. If the limits of Economy V1 do not meet your requirements, you may consider using Economy V2. In Economy V2, the Catalog can store an unlimited number of items and each player’s inventory has a limit of 3500 items per player inventory collection.

4 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.

Kai Schuhmacher avatar image Kai Schuhmacher commented ·

Okay, that really helps me, but another question for me is, where can I find the custom data of an item? this seems a bit old: https://community.playfab.com/questions/3752/read-custom-data-from-iteminstance.html Or am I on the wrong page? 6310-bildschirmfoto-2023-08-30-um-170609.png

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha Kai Schuhmacher commented ·

The replacement for custom data feature in Economy V2 is DisplayProperties, and you can store custom data in DisplayProperties. Remember that the DisplayProperties for player Inventory Items and Catalog Items are different and you need to set them separately. You can use Inventory - Update Inventory Items - REST API (PlayFab Economy) | Microsoft Learn to update DisplayProperties for Inventory Item and use Catalog - Update Draft Item - REST API (PlayFab Economy) | Microsoft Learn to update DisplayProperties for Catalog Item.

0 Likes 0 ·
Kai Schuhmacher avatar image Kai Schuhmacher Xiao Zha commented ·

Okay, but how is any request to PlayFab Economy Inventory separated for players? Where can I specify which player inventory I want to update?

0 Likes 0 ·
Show more comments

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.