question

iniside avatar image
iniside asked

Randomly Generated items - best practices

I have a game with randomly generated items.

Items are split into two parts. Metadata which is shared between instances of the same item (like class, rarity, icons, data needed to generate stats) and item instance itself.

Once player get item (drop, grant doesn't matter), new instance with random stats derived from metadata is generated and should be saved to player inventory. Pretty standard item generation like Diablo or Path of Exile.

Players should be able to trade item to other players, sell it to vendor, deconstruct etc.

The Item generation is handled on my own server.

My question is. How to best store those generated items on PlayFab ? The data about item can be quite hefty (more than 1KB per item, as there is a lot of generated/customization data), but i don't expect to be that much items.

And if there is no feasible way to do it right now, is there any system planned, which would allow to handle such cases, where there is not that much entries, but the entries on their own are quite complex ?

Player DatadataPlayer InventoryTrading
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

·
Andy avatar image
Andy answered

We provide you the ability to store metadata on an item instance in a player's inventory. (https://docs.microsoft.com/en-us/rest/api/playfab/server/player-item-management/updateuserinventoryitemcustomdata?view=playfab-rest) We do limit the size of the meta data values and the number of values that can be updated at once. You can find these listed on your title's limits page.

The other option is to store the item customization data as part of player data. Limits there are more generous, but it's not quite as elegant a solution.

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.

iniside avatar image iniside commented ·

Hey

Thanks for answer :).

If I understand that right, to give any item to inventory, it first must be in Catalog ? That would mean I would need store every randomly generated Item possible in Catalog first and then move it to player inventory ?

0 Likes 0 ·
Andy avatar image Andy ♦♦ iniside commented ·

You need something in the catalog, yes. The breadth of items you choose to put in the catalog is up to you. For instance, you could have a Sword entry to which you just add instance-specific info when it's created. You could, also have a rapier entry that has some basic data to differentiate it from other swords, but then is further customized by instance data. How far you take that is up to you.

0 Likes 0 ·

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.