question

thornewill avatar image
thornewill asked

Pokemon-like game in economy V2 - inventory item stacks

Good day everyone,

I would like to develop a game similar to Pokemon Go - player is walking in the game world, fighting monsters (their level, xp, etc. is based on player level, so it will be varying) and eventually catching them and storing them in the inventory.

My question is how to approach data model regarding these pokemon-like monsters in economy V2. Previous economy model offered custom data on inventory item instances, which seems not to be the case with V2 (but I read about stacks and display properties). So far I was able to come up with two feasible solutions:

1) Using full inventory solution - item stacks + display properties

I would simply define all monsters in my inventory, default stack would be the level1 monster and the other stacks would represent all other levels with custom display properties defined for each stack. After player catches the monster, it's corresponding stack is added to his inventory. With this solution I would end up like with 50 stacks for one monster which for me feels bit weird.

2) Using inventory for base monster definition, keep monster variations in player data

Here I would just define base monsters (only level1) in the inventory, in display properties there would be range of values for certain levels and then in the game all level1+ monsters'stats would be computed. After player catches them they will not be an inventory items, but a JSON in player data with specific catched monster description.

Which solution makes more sense to use? Or is there some other which I maybe missed? Thanks in advance for your answers!

Player DataPlayer Inventory
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

·
Xiao Zha avatar image
Xiao Zha answered

>> Using full inventory solution - item stacks + display properties

You can define all monsters in the Catalog. Then you can add the monster in the inventory once you catch it and store the info of the monster in the display properties. For the same monster you can use different stackIds to distinguish them. Please remember that the inventory V2 can store 3500 items with different StackId and the Display Properties field has a 1000 bytes limit.

>>Using inventory for base monster definition, keep monster variations in player data

You can use Catalog for base monster definition. And since you store monster variations as JSON files in player data, you don’t need to add monsters in the player inventory. Also, there is a 300,000 bytes limit on player data value size which is much higher than display properties. You can find the player data related limits in the [Title Settings]->[limit] page.

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.