How to restore player`s resources with time, but stay protected from user`s time manipulation

Hi! I am working on a game, where player has energy, which restores with time. I could use DateTime.Now, but user can easily change datetime on device, so time system must be protected from it (looking for free solutions). Thanks in advance for any help!

Yep. Totally expected, fully understood.

If you’re concerned about the user ‘hacking your save files,’ or ‘cheating in your game,’ which is playing on their computer, just don’t be.

There’s nothing you can do about it. Nothing is secure, it is not your computer, it is the user’s computer.

If it must be secure from tampering, store it on your own server and have the user connect to download it. Remember they can still change it after they download it and before your program uses it.

If it must have secure user authentication, use Apple login or Google login. Nothing else is worth it.

Anything else is a waste of your time and the only person you’re going to inconvenience is yourself when you’re debugging the game and you have savegame errors. Work on your game instead.

Remember, it only takes one 12-year-old in Finland to write a script to read/write your game files and everybody else can now use that script. Read about Cheat Engine to see more ways you cannot possibly control this.

NOTE: if you begin your response with “So you’re saying that…”, then you haven’t read the above. Go back and read it carefully or you are going to waste a lot of your own development time for nothing.

2 Likes

I’m just building on what Kurt mentioned and reinforcing his point. When it comes to client-side games, I do a lot of anti-cheat testing and reverse engineering for testing purposes, even on games with large budgets and big teams. Many of those games can be cheated with relatively little effort and time.

If you’re serious about preventing cheating, server-side time tracking would be your best approach. In fact, even newer AAA games are experimenting with advanced methods, such as blockchain data validation, to secure their values.

1 Like