Quote:Original post by gamergamer
The fact that the energy progress is marked by the device's time and the fact that very very easy can every user change the time cancels the idea...unfortunately...:(
Why?
The application will not be only filling the bar. Everything in the simulation will be based on this time.
On shutdown, store the last application time.
When the application starts:
- load the old time
- while (old_time < current_time) advance(1 minute)
This handles everything, including the bar.
If user increments time by cheating, they will not be able to cheat their way of inactivity over a period of one hour.
Then, do what this type of games did long ago (X-Com was one of them) - offer the "fastest simulation speed until event occurs" option. So if someone needs to wait for some bar to fill up, let them. But, if something happens in between that requires their attention, fall back to regular speed.
This way, if they do cheat, they'll also skip all the important events they would have handled if game were running legally, or they'll need to "catch up" by playing regularly, regardless of how long ahead they cheated.
And if they roll back the time, they'll probably break something else, especially if you also store some other history that is linked to this timer.
Such system can also be implemented as a transaction log - record all important events, replay them when application starts. Then cheating becomes next to impossible without completely breaking the state in unpredictable ways.