Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent time-based cheats on a time-based simulation game?

Tags:

algorithm

In the iphone game "Tiny Tower", I'm guessing it uses some kind of simulation based on the time spent between the last play and the current time, because you can set the current time forward and you will get the benefit from the fake elapsed time span.

Is there an algorithm that I can use to prevent this sort of thing? (Or at least make it difficult enough for the average user to pull off!)

Edit: thanks, I understand that, despite my wording, there's no way to prevent things you store on the client side, but I want to make it at least more difficult than "changing the time" to hack it!

like image 448
Timmy Avatar asked Jan 18 '12 22:01

Timmy


1 Answers

The gamecube had a way to do this so it must be possible.

Is there an event triggered when the iphone time is set ? In that case you can react that.

Another solution is to require to be online when the game is launched, this way you can check time on a remote server.

You could has well check if you got an event on the phone login or wake up react to it, saving the time at that moment in your DB. You would have the last non modified time.

A last possible trick is to check for a file you know is going to be modified by an action prior to time change (such as login), and check the 'last modification' date.

You can investigate in the GPS direction as well. A GPS need to be synchronised with the satellite it contact, so it must keep track of time in some way, and maybe there is an API for that.

Unfortunatly you are on an iphone, which mean your possibilities are limited since applications got very few rights and are sandboxed.

EDIT:

Just though about it but, can you create event in the iphone calendar ? And check if it has been trigered ? Cause you could set a fake meeting or something for every day. Not clean, but creative.

EDIT 2: can you set a timer as a code for IOS to execute in 60 minutes ? If you can, set this timer, pass the time expected to be when this code run, then when the code run, compare and inform your program.

like image 52
e-satis Avatar answered Oct 29 '22 23:10

e-satis