question

David James avatar image
David James asked

Dynamic entity tied to character, data design advice

I've granted a character to my player, and now he requests a personal habitat. This habitat could be thought of as a base, a place with stats that others (more than Shared Group) can visit.

Because each character is assigned 1 habitat, (or more, potential for IAP) I would like advice on which category would best suit this entity. I thought of Item because yes it might be purchased, and it is indeed associated with a character- but maybe a generic Object structure would fit for the dynamic data it needs to store (items don't have this I'm assuming). Or maybe a series of generic player data?

Apologies if the question is a little vague, I'm just trying to work out the best solution for this situation of a player-owned "entity" which also contains dynamic data, as an evolving base would often have. (Building levels, cooldown timestamps, etc)

Thank you, any feedback greatly appreciated.

Player DataapisIn-Game EconomyCharacter 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

·
Neils Shi avatar image
Neils Shi answered

Since players can acquire additional habitats by purchasing, so the item could be a good choice. You can store the Building levels, cooldown timestamps, etc in inventory item custom data. For inventory item custom data, the maximum value size of one key is 100 bytes, and PlayFab doesn't limit the numbers of keys (KVP).

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

David James avatar image David James commented ·

I thought of items as strictly static definitions, since cooldown timestamps are dynamic would this not be a problem?

0 Likes 0 ·
David James avatar image David James commented ·

@Neils Shi I notice this in my catalog:

Note that individual item instances only store the following information:

...

All other item information (such as tags, description, or custom data) is only stored on the root catalog item.

So custom data is in fact static? Doesn't that mean if I had two habitat items, they would both be sharing the same custom data? In which case my only other option would be to create a "character" which represents the habitat, who's custom data I could then update dynamically..

0 Likes 0 ·
Neils Shi avatar image Neils Shi David James commented ·

The custom data of Catalog item is static, but inventory item is dynamic. The catalog item’s custom data only exists in the catalog, it is not copied to instances when they are created. You can call API UpdateUserInventoryItemCustomData to modify the custom data of user inventory item.

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.