question

Daisuke avatar image
Daisuke asked

Data Structure of Card Collection Game

Hi, I’m thinking how to integrate new CCG, Card Collecting Game onto PlayFab LiveOps. The CCG system has synthesis to grow cards. Player will get many character-card like items through Loot box and Store. Each card has values related battle and importance, like HP, MP, ATK, DEF, XP for card, and Level and rarity value.

Question 1

- Where is the best place to store character-card state? Is it correct to store on custom data in player's inventory?The values are changed with synthesis process. I think to avoide GrantCharacterToUser, character-card values should be stored as item, is it good thought?

Question 2

- How to hold deck state?Is it need to use InstanceID of Player's Inventory to lookup custom data?

- Player pick some favorite strong cards of his all card inventory.

- Player join battle with this deck,

- no need to hold latest each HP and each MP. These values are reset always.

- The deck state is like this JSON.

{

"ClassDetails": {

"Description": "Fireregistance and Magic attack.",

"Code": "Deck01",

"Icon": "Flame",

"Card1":{"ItemID":"Paladin","InstanceID":"2DDBE7FF05B1ECE9"}

"Card2":{"ItemID":"Knight","InstanceID":"3604A23F6C4076D3"}

"Card3":{"ItemID":"Wizard","InstanceID":"634CA4E052077BFB"}

"Card4":{"ItemID":"Wizard","InstanceID":"4E052077FF0A5ECE9"}

"Card5":{"ItemID":"Fighter","InstanceID":"2D2077FFF05B1EC53"}

"Card6":{"ItemID":"Elf","InstanceID":"2077FFBE7FF05B1EC"}

}

Question 3

- Where is the best place to store player's data?

- In my mind, Player state should be saved on Player Data (Title) ReadOnly.

- I still didnt understand what's difference betwee, ReadOnly and nomal Player Data (Title).

- Also, I don't know which is better to save on Player or Character system

-Player state is saved on Character, in Unicorn battle. Please give some comment is it best practice or not?

{

"ClassDetails": {

"Description": "An undead champion from another realm.",

"CatalogCode": "Nightmare",

"Icon": "Nightmare",

"Spell1": "Fireball",

"Spell2": "Eye of Flame",

"Spell3": "Hellstorm",

"BaseHP": 125,

"HPLevelBonus": 5,

"BaseMP": 75,

"MPLevelBonus": 5,

"BaseDP": 150,

"DPLevelBonus": 5,

"BaseSP": 50,

"SPLevelBonus": 5,

"Prereq": null,

"DisplayStatus": null

},

"TotalExp": 4620,

"ExpThisLevel": 3520,

"Health": 140,

"Mana": 90,

"Speed": 65,

"Defense": 165,

"CharacterLevel": 4,

"Spell1_Level": 3,

"Spell2_Level": 0,

"Spell3_Level": 0,

"CustomAvatar": null

}

entities
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

·
Seth Du avatar image
Seth Du answered

Question1:

Yes, it is a good solution that using inventory items for card collections. Those pre-defined properties can be stored in Catalog items custom data, meanwhile changes made by players can be stored in inventory item instance custom data.

Question2:

The Desk information can be stored in Player Data, because players are able to modify it at any time. I will also be fine to store somewhere player cannot directly change, for example, Player Read-Only Data. Your Deck state JSON file looks great.

Question3:

Player Data can be updated by the Player, however, Read-Only Data can be only modified by Server/Admin API, which is the case of using Cloud Script. There is always data that developers don’t want players to change on their own, like XP, achievements, progress of the game and etc. In terms of Player Data, it will be free for players to change, like custom signature, nick name, gender and etc. It really depends on how much freedom you want to give players.

Character is a substitute of a players. In fact, if your game doesn’t have a character system, you may just use the player account. The Character system what I mean here is like in MMORPG, you can create characters of different classes and it is what PlayFab character system is designed for – independent inventory, statistics and so on.

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.