question

pyrogamestudio avatar image
pyrogamestudio asked

Are there built-in ways to make RTS/Resource management games with PlayFab?

Hi,

I'm in the process of creating a "FarmVille/SimCity Build It" type game. I want users to be able to click on an object to get a resource (like wood or iron).... and here's where I need the help of PlayFab.

The wood or iron will take time to complete (lets say 10 mins). How can I store and validate this in PlayFab? I want to show a progress bar with the time left.

Is the answer to this as simple as storing a timestamp in PlayFab and checking it when the player reloads the game?

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

Yep, it's really that simple. :)

In general, for games where you'll have frequent updates of the game state, the way to approach this is to only save to PlayFab a) when something major changes - an achievement, a real money purchase, etc., b) when the player clicks a manual save button you put in a settings screen, or c) after a few minutes have passed. That way, you can keep the player's state up to date without an excessive number of calls.

In this case, the route to use would be to periodically send the summary of changes up to a Cloud Script, so that you can do a pass on that to make sure the changes are legitimate (that the player isn't cheating). You could also potentially use a custom game server if you want to have a higher level of security.

But yes, store the timestamp on when the build was started (getting the current time in the Cloud Script call and modifying it based on how long ago the player started it locally - checking first to make sure the player's timestamps aren't outrageous), and then you can just check that to see when the build should be completed.

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.