[SOLVED] Checking Time Offline Without Player Abuse

Hey! I want to make a sort of “event” in my game. (I am being super vague to not spoil the game!) Anyways, I want this even to happen on a specific month. The only problem is, if players change their device clock, they could access this event early. I thought of using API’s but those have rate limits, are difficult to use, and don’t work offline. Does anyone have a solution?

Thanks in advance!
– Snowy

Edit: Fixed and made a tutorial you can find HERE!

1 Like

Sending this up again. Is this even possible?

Not without some sort of online connectivity, no.

Any offline time checks that use tral time will require the system clock, which will always be player controllable.

That’s also true for most bigger games focused on time progression, like Hero Clicker.

2 Likes

If I have an event that’s only for a specific month, do you think it would be alright if players technically can cheat and access it not during that month? My game doesn’t have any leaderboards, and the event isn’t anything substantial, but I feel like players might feel that it’s a bit unfair. What do you think?

Maybe you can force your players to be online if they want to access certain events? At least this is what I plan to do with my game.

Still if somebody wants to hack or cheat they will still find a way, so don’t stress too much about it unless you have a heavy multiplayer, online game :slight_smile:

1 Like

True. Having the event be online only could work fine. I could also set it so if the online verifies that it is the specific month, then it relies on client date until it isn’t December anymore, then will rely on API. Do you know a way to parse JSON from api? All the API’s I’ve found leave me with something like “2025-10-09” and I need just the month number. Any ideas how to convert it or any API that gives just the month?

I use Unix Timestamp when I want to compare the time. Discovered it last month :smiley: Computers take the timestamp and convert it into the date you see, at least this is what I read.

Much easier to save and easier to compare, as you just compare one number.

Unix Time Stamp - Epoch Converter

Not sure which API to use… there are many online.

EDIT: As for the conversion, if you only want the month I’m sure that is possible. Some of the smart people here should be able to assist you.

1 Like

Found out how to parse the JSON (Ai helped me figure it out lol) but still can’t find a reliable api. I found worldtimeapi.org but it seems to bug out and not fetch the api 9/10 times.
If anyone knows a good, free, commercial usable API to get the date/month, lemme know!

Wait, you can quote in your own post with that quote…

Edit 1: worldtimeapi seems to work fine now. Might just be my trash wifi! If anyone else has experience with api though, please still let me know!
Thanks in advance
– Snowy

Alright. After a ton of bug fixing, I have finally got a system that can verify the player date with almost no way to cheat it! The system is…
Step 1: Gets the time and date from online. If you are offline, it instantly switches to offline mode and disables anything that requires online time.
Step 2: Once it gets the online time, it saves it in storage. (Since I am using months, this system just save what month it is.)
Step 3: The next time the player plays, if they play online, it repeats step 1 and 2. If they play offline then it checks whether or not the device’s month is the same as the storage saved month. If it is, then they get to access online stuff. If not, set them to offline mode.

I don’t remember where I saw it, but I remember @ZeroX4 talking about how there is always a way to cheat the system, so that gives me an idea.
Edit 2: Ahh yes. Mindlessly looking around until I finally found it!

Can anyone figure out a way to cheat this system?
Edit: Yep, people can hack the game of course…
The only way I can think of is to change your device date back to the last month to “extend” the amount of time you can claim that months rewards. This doesn’t really matter in my game, because I am just trying to stop people from skipping ahead months. (I don’t want someone who joined Duck Game in October to be able to claim September only rewards, etc) (This is just an example btw)

Edit: I would also enjoy feedback on this system, because if it works I will probably post a more detailed tutorial as a community post.

Very true. Guess you can’t stop all the hackers! Just wondering though, do people actively use that on games to cheat? In Duck Game there really isn’t a reason to do that so people probably won’t.

Hi all!

Have you though to encrypt the month? I did this like that in my game Paper Plane to encrypt the final word to find and showed in final scene.
And all that with events.

A+
Xierra

Even if I encrypt it, using that cheat system people can just change the variable. It’s alright, there isn’t too much people would get if they cheat, and it’s really up to the players anyway. If they really want to download an external app to hack my game to get some rewards, so be it.

I think you have not well understand what i said.
If you encrypt the month in your game, only you can decrypt this month later.

But of course, nothing is sure in this world, all is a question of means and interest. Id someone wants to pirate your game, he’ll get there.

A+
Xierra

1 Like

Yep. I don’t think it is that important to encrypt the month. Besides, people could still look in the code to figure out how to decrypt the month.

1 Like

How about if you make sort of a tally or record of the rewards history? Every time a player claims a reward, it is added to the record along with the time and date it was claimed. If there are any discrepancies with the record and the time and date on the device, the rewards might be forfeit or something.

Though I’m not sure about what sort of rewards you intend to give out and how feasible it would be to track down each item. Like if it’s some kind of in-game currency that might be a bit harder to check than some rare gear or something.

Also if you allow rewards to be claimed once a day, then a 30-day event should only have a record of 30 rewards.

But yeah, nothing is really completely foolproof. It’s just a matter of creativity.

Perhaps it might be fun if some devs anticipated cheating and incorporated it into their game. Like they don’t prevent it but detects it and acknowledges it or something.

Like if it were an rpg and a unique item was duped. Then later on the player encounters a lord of thieves of sort as part of the usual quests. But then the npc would say something like, “Oh you. I know what you did… It would seem we are very much alike…”

Or maybe not acknowledge it, but rather secretly make subtle changes to the game to try punish the player without the player noticing. Easier said than done. Also making the game harder isn’t exactly punishment for challenge-seekers. It would probably encourage them.

1 Like

Let’s play the game!
I put the encryption events and I ask you to guess the word (French but valid in other languages ​​as well)

Who is for it?

A+
Xierra

If you want a totally offline solution, you could make the event unlock based on in-game progress or playtime instead of real-world dates — it keeps the same pacing but avoids the clock manipulation issue.

1 Like