question

Nicolaj Hammerbo avatar image
Nicolaj Hammerbo asked

Storing custom game data specific to a player (card game example),Inventory management data structure in a card like game

I'm building a game where players use different cards that they unlock throughout the game.

All cards exist in a catalog as well as different chests/card packs they can acquire. All this works well and I can easily access the cards a player is in possession of.

Each player has the option to create decks and fill them with the cards from their inventory. Say a player has two decks filled with cards they own. One card can be in multiple decks at once.

What would be a good approach to store and handle this data? As Entity Objects? can they then be manipulated through CloudScripts? (if a player destroys a card, it needs to be removed from the decks as well)

I hope this isn't too confusing of a post

,

I'm building a game where players use different cards that they unlock through different rewards.

All cards exist in a catalog as well as different chests/card packs they can acquire. All this works well and I can easily access the cards a player is in possession of.

Each player has the option to create decks and fill them with the cards from their inventory. Say a player has two decks filled with cards they own. One card can be in multiple decks at once.

What would be a good approach to store and handle this data? As Entity Objects? can they then be manipulated through CloudScripts? (if a player destroys a card, it needs to be removed from the decks as well)

I hope this isn't too confusing of a post



Player DataentitiesdataPlayer Inventory
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.

Nicolaj Hammerbo avatar image Nicolaj Hammerbo commented ·

I see both the new and old title got posted

0 Likes 0 ·

1 Answer

·
Rick Chen avatar image
Rick Chen answered

You could make a deck by storing the reference of the card items, for example the item instance id, in Player data, Entity files or Entity Objects. They can be manipulated through CloudScripts. When the player chooses to destroy a card, your CloudScript can remove the corresponding item instance and update the decks to remove the reference. But please note that there are limits for those data storing service. You could check the limits in [Your Game Manager]->[Title Settings]->[Limits] page. Normally, for entity objects, the max Number of objects stored for the title player account entity is 5 and the Maximum size of each object stored on the title player account entity is 20 bytes.

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.