question

studioalfredwalker avatar image
studioalfredwalker asked

How can I handle catalog item upgradable?

Hi there.

I am trying to sell bundles including player units in my game. Units in bundles have "level" (0~3), and the user can upgrade units by consuming virtual currency defined. The cost of upgrade varies by level.

In this case, should I add catalog items correspond to every unit level and track current level by setting "Player Data"? I am currently planning to keep all player data (like equipped & purchased unit, current unit level, cleared stages) using "UpdateUserData/GetUserData" but feel less confident on this way.

Please let me know if any additional information is required.

Thanks.

Player DatapricingPlayer 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

·
brendan avatar image
brendan answered

The service is designed for flexibility, so that you can use it in whatever way works best for your architecture and requirements. In general, I'd say that you would want to minimize the number of catalog items by having the units only have entries in the catalog by their actual type, rather than type + level. For level, you could store that in CustomData on the inventory item instances you grant to players, or you could store that in player data - either way. But do bear in mind that there are three levels of security on player data:

UserData: Read/write from the client, so a hacked client could write anything in it.

UserReadOnlyData: Read only from the client. Update it via Cloud Script or a custom game server, so that you can put appropriate cheat checking logic in your server-side code.

UserInternalData: Cannot even be read by the client. If you want to track on things you don't want the player to know about at all, this is the place for it. Again, write to it from Cloud Script or a custom game server.

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.