question

eric@begoodi.fr avatar image
eric@begoodi.fr asked

Towers Upgrades possible ?

In my game I have some items that can be upgraded (like towers in Clash of Clans for example). So this action takes potentially a lot of time.

The client begins an upgrade, and it lasts 3 hours for example. Then the client can leave.

- If he comes back 1 hour later, he has to see that time remaining is 2 hours
- If he comes back the day after, the upgrade has to be done with all associated actions if needed

This kind of action can't be managed client side because of the hacking problems it can occurs.

Is it possible to do that with Playfab ?

Thanks

10 |1200

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

brendan avatar image
brendan answered

Certainly. The way to do this would be to use UserReadOnlyData to store the timestamp for when the item was started, along with any modifiers so that you can re-calculate the remaining time at the client and the server using the same (server-authoritative) data.

Since many games that use this design also sell a virtual currency which can be used to buy down the remaining time, if you have an option to reduce the time by a set amount (rather than just "finish now"), I would recommend storing any purchased time reductions as additional data in the record for that item. That way, you keep the information for the full object - start time, and any time reductions.

10 |1200

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

eric@begoodi.fr avatar image
eric@begoodi.fr answered

OK thanks, I will handle it that way...

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.