How can I make a system for daily tasks

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MaaaxiKing

I want that after every 24 hours, the user will get a new task, for example kill 10 Aliens or shoot 700 bullets. How to do?

:bust_in_silhouette: Reply From: JimArtificer

Store the current time in a variable. Then check that variable by subtracting it from the current time.

But the user could easily change the date and time in the settings and the game would think 24 hours are over, right? I want the player to wait real 24 hours.

MaaaxiKing | 2020-06-21 08:44

That is true, but there are many (high profile) games that people have enjoyed that can be tinkered with in that way.

If you don’t want it to be possible for the player to tinker with the value you will need to be operating a separate server which is used to calculate the time and store the variable.

As with most things in game development, it may make sense to go with a simple solution for now and then evaluate if you need to replace it later with a network call to a server.

JimArtificer | 2020-06-21 12:38

Alright, thanks.

MaaaxiKing | 2020-06-21 12:42