question

Anh Le avatar image
Anh Le asked

Proper way to handle player' abilities (skill)

Hi,

What is the correct way to handle player' abilities (skill) in Playfab? Should I use Player Data (Title) for it?

Player 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

·
brendan avatar image
brendan answered

It depends upon your requirements. The simplest way would be to track on all the attributes of the player in a JSON blob, as an Entity Object on the player (or using the older player data model). If you want to be able to segment on the value, or otherwise use it for PlayStream triggers, I'd recommend using a statistic.

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

Anh Le avatar image Anh Le commented ·

Hi,

Thank you.

How about the ability system (upgradable, unlockable, categorize-able) ? Which way is the best one to handle it on Playfab?

0 Likes 0 ·
brendan avatar image brendan Anh Le commented ·

Can you detail out what your ability system is, what type of values it would have, and how it is used in gameplay in your title? It sounds like you'll want to simply store the data in JSON and only allow changes via Cloud Script or custom game server logic, to prevent cheating.

0 Likes 0 ·
Anh Le avatar image Anh Le commented ·

It will look like the abilities of MOBA games such as DOTA 2 or League of Legends. However, our game is just an asynchronous game (not realtime but only sync data after the match finish) which user will compete with an AI representing other players.

0 Likes 0 ·
brendan avatar image brendan Anh Le commented ·

That doesn't actually change anything about the implementation. The only thing you need to decide is if you want the abilities to be something you can use in a PlayStream Rule or for user segmentation. If so, track them as Statistics. Otherwise, track them in a JSON blob with other data for the player. In either case, you will need to use Cloud Script or a custom game server to process when those attributes can change, and to what, so that the client cannot cheat.

0 Likes 0 ·
Anh Le avatar image Anh Le commented ·

Sorry we are new with Playfab. Could you please brief the cons and pros of these two method? We are using JSON at the moment.

0 Likes 0 ·
brendan avatar image brendan Anh Le commented ·

Storing the data in a JSON blob, either in Player Data or a player Entity Object, would mean that all the data is conveniently in one place, but that it cannot be used for PlayStream Rules or player segmentation (at the moment, Entity Objects do generate an event, but we don't allow for sub-element checks of that data in Rules or segmentation yet).

Storing the data in statistics would mean that it's usable for PlayStream Rules and player segmentation, but it would also distribute the data across multiple statistics (and possible some data - see above). Also, you have a fairly limited number of statistics - particularly if you're in the Essentials tier.

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