question

bunzaga@gmail.com avatar image
bunzaga@gmail.com asked

More than one Inventory? (material grid, equipped items, merchants, etc)

I would like to implement several dictionaries or lists of items or abilities spread across several aspects of my game.  I'm having a difficult time thinking through where to put these things within the PlayFab services.

For example, I wanted a resource grid: as players accumulate materials, it will be added to this dictionary.

As users craft items, I wanted these to go into their 'inventory'(a list of items).

As users equip items, I wanted these to go into the equipped items, based on slots.  A slot can only have a specific type of item.

Using these altogether, a user would kill an enemy, obtain a resource item dropped from a table based on the enemy type, use a few resource items with a crafting station to obtain a crafted item.  These crafted items can then be enhanced with other items to create some uniqueness.  The user can take this item from their inventory and equip it.  

Eventually they user could trade the item to other players for other items, resources, or in game currency via a 'Vendor' or in game store front.

What is the best way to manage something like this?

10 |1200

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

brendan avatar image
brendan answered

In general, most of the data you'll be storing for the player's "state" would go in User Data of one form or another. If it's something that a player could cheat if they could write arbitrary values, you're best bet would be to use User Read Only Data, and only update it via server-side operations (like Cloud Script). 

To me, it sounds like your craft ingredients and resulting items would all be inventory items, added and removed by Server calls. The enhancements would then be custom data you write to the item instances.

Meanwhile, your equipment slots would be stored in User (Read Only) 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.

bunzaga@gmail.com avatar image
bunzaga@gmail.com answered

If I wanted to load only the materials into a resource grid, I could tag them as such, and get all items in the inventory by tag?  The equipment slots would be specific fields of ReadOnly User Data?  I just need to research  cloud scripting next :D  Thank you for the help!

10 |1200

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

brendan avatar image
brendan answered

To be clear, we don't have filtering on Tags in the service API calls yet - though we do plan to add them later. I was referring to filtering in your own tools and on the client, using the Tags.

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.