question

Luca W avatar image
Luca W asked

Is it possible to store stats of player's team monsters in PlayFab?

Hey, I want to make a mobile game with Unity using PlayFab to store user data / player stats. In the game, the player can put together a team of 3 "heroes" out of 100 possible heroes. I want to make it possible that every player has the choice to improve the stats of his heroes. For example the "Attack" value of "Hero1". So that "Hero1" can have different stats for every player playing the game, depending on how he improved the stats. I'm new to PlayFab and I want to know, if it is possible to have a "collection of monsters" with different stats for every player using PlayFab. I'd be grateful for every help and information I can get :)

,

Hey,


I want to make a mobile game with Unity using PlayFab to store user data / player stats.


In the game, the player can put together a team of 3 "heroes" out of 100 possible heroes.
I want to make it possible that every player has the choice to improve the stats of his heroes.
For example the "Attack" value of "Hero1".
So that "Hero1" can have different stats for every player playing the game, depending on how he improved the stats.

I'm new to PlayFab and I want to know, if it is possible to have a "collection of monsters" with different stats for every player using PlayFab.


I'd be grateful for every help and information I can get :)

Player DataContent
1 comment
10 |1200

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

Luca W avatar image Luca W commented ·

I don't know, why it posted my text twice :)
- sorry

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

>>3 "heroes" out of 100 possible heroes

Regrading this scenario, we usually use inventory items to manage them. Consider items defined in Catalog is C# Class, while inventory items are initiated C# Class instance, which is unique for each player. Catalog items won’t share the “custom data” field with inventory items, so that custom data in Catalog items can be used to contain the pre-defined properties of a hero type. Meanwhile, the custom data in Inventory item can store players’ customized updates like ‘Attack’.

>>it is possible to have a "collection of monsters"

Would you share more details about this requirement?

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.

Luca W avatar image Luca W commented ·

Thank you for your answer @SethDu


What I mean with "collection" is that the player gets more and more of the monsters while playing the game. So he has a "collection" of amount X different unique monsters.
But his team can only have 3 different unique monsters.

How/where could I store which 3 monsters he chose for his team using PlayFab?
If I use the inventory system he should have like an extra Inventory called "Team" where he can put in 3 monsters out of his "Monster Collection".
Is it possible to do this somehow?

I want to make an API Call from my game to PlayFab to get the current "Team" of a player in order to start a fight for example and spawn his 3 monsters.



And again: thanks for helping me out. :)
PlayFab is just a little overwhelming for beginners because of it's huge amount of features etc.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Luca W commented ·

The collection will work similar to a 'equipment' feature, which means player will be able to change on their own. I will suggest storing the instance IDs of the monsters that a player owns in the inventory as a KVP with JSON value in Player Data or Player Read-Only Data, like

Key: CollectionOfMonster
Value : 
{
 "instance1Id":"xxxxxxxxxxx",
 "instance2Id":"xxxxxxxxxxx",
 "instance3Id":"xxxxxxxxxxx"
}

// Please understand you will need to stringify the value.

Based on your gaming design, it is reasonable to store the data in Player Read-Only Data if you don't want players to change the data freely at any time and Cloud Script/Azure Function with predefined verification steps in the function will be necessary.

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.