question

tonylin avatar image
tonylin asked

How do I desgin Weapons/Armor that inherit from base type

Hi, we are trying to use PlayFab as our new project's back end.

But I am wondering how to setup equipment info.

For example we have 3 gun that's all machine gun.

so in equipment info there will be machine gun's base stats like speed 10 and ammo 10

and in each weapon have their own stats like ammo 10 15 and 20.

when change machine gun's stats eg. speed to 15

all 3 guns will get the same change.

Is this possible in PlayFab?

And if all parts have exp, level, or durability that need to change time by time

all I can do is cloud script?

Thank you for your 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.

1 Answer

·
brendan avatar image
brendan answered

For all global info you want to store about the items, use CustomData in the catalog. The CustomData in the catalog lives only in that space - it is never copied to the inventory item instances, as it is meant as global data. So configuration info, like the speed of an item, can live there and when you change it, all players will be using the new value (since they get it from the catalog).

You can additionally write to the item instance's CustomData, for data which is distinct to that item instance. So, for example, if an item starts with 10 bullets and you're going to consume them as you use the item, you could store that in the instance's data (but note: please do not try to update CustomData at a high rate, as that could get your title throttled or blocked - in the case of bullets, aggregate the change over time and update the backend periodically).

It sounds like you're saying that you want all the guns of a certain type to inherit from a "parent" item. That's not supported in the catalog right now, so you would either need to have a distinct Item ID which represents that parent object, so that you can store the data there, or else you would have the base values stored on each Item ID separately in the catalog.

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.

tonylin avatar image tonylin commented ·

Thank you for the reply,

So looks like most of data change will be CustomData, so what's the maximum update rate we can do? I'm not sure don't update it at high rate mean.

Basically we have 2 types equipment, 1 is weapon another is buff part. So every time you equip a buff part, your weapon will gain the effect from buff parts. Eg. your machine gun damage will increase from 100 to 150. So it means every time player do a equip action, we will need to update 1 ore more part's CustomData. Is this update rate too high?

Also can we track changes in custom data and analyze it? Like player's XP, we would like to see changes on all weapon's level, damage and etc.

Thank you for your help

0 Likes 0 ·
brendan avatar image brendan tonylin commented ·

You should be aiming for only making a few calls per minute from the client overall, across all the various calls, over the lifetime of the player session. So, bursts of several calls in a short period are fine, as long as the average rate is kept within reason.

For what you describe, I'm assuming you have some player interface around the experience of modifying the weapons? What I would do is let the player make all the changes they want to, and only update the backend data in PlayFab when they "save" (exit the interface or switch weapons).

We do not generate events for changes to data, but if you want to track on usage, you could use WritePlayerEvent to generate a custom event.

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.