- Home /
Tycoon Game / Earning Some Cash While The Game Is Closed
Is there a way I can make my game keep earning "cash" even when the game is closed?
I'm making an offline tycoon-like game, something like Tiny Tower or Disco Zoo, where even if the game is closed, it's still earning the player some coins.
I've tried googling and searching everywhere on UnityAnswers but still can't find a definitive answer.
Thanks!
What if the player changes its clock? That would be a game-breaker.
Is there a way I can prevent them from cheating by changing the time and date?
$$anonymous$$eep track of several time stamps and if it gets set backwards on one of them you can remove cash, but honestly on a single player game why would you bother preventing this style of cheating? It only hurts their game, and some players love figuring out ways to break games.
One way to prevent against duping is not to rely on time reported by the local system, but retrieve time from a (trusted) remote server. That obviously requires internet connection though (you don't mention what platform you're building for). However, I tend to agree with @Jeffrey$$anonymous$$arkBaldridge - does it really matter?
Answer by Vandell · Dec 19, 2014 at 08:43 PM
You can try something a little different. What if everytime the player opens the game the current datetime gets compared with the last datetime the player played the game and them apply some earning based on the difference between the two?
Answer by HYPERSAVV · Dec 19, 2014 at 08:45 PM
You could create the illusion that the game was still running. When the game is closed/killed, record a timestamp. When the application resumes, grab that timestamp and take the diff to determine how much cash they should be awarded.
This of course could be easily duped depending on the platform (setting the clocks forward manually). It's a start though.