This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

(i am using gdscript)

Godot version 3.5.1
in Engine by (24 points)
retagged by

1 Answer

0 votes
Best answer

By offline progress do you mean you close the game at a specific state and if you come back 1 hour later you expect the game to have the same state + what would have happened in that one hour?
If that's the case:

  • In the save file you store at what time the game was saved
  • When you load a game you check current time and compare with when the game was saved
  • You simulate every object in the game that gives progresdsion as if they worked for the time difference
  • Once the state has been updated by the calculated difference, you complete loading the game
by (1,957 points)
selected by

So how i compare the saved time and the current time? I dont know

I dont know how simulate every object and also i dont know how to compare also too i dont know how calculate the difference

Use Time to get current time.
If you use unix time, it's as simple as subtracting the saved time from the current.

Lets say you can purchase a cursor object that clicks the clickable every two seconds.
In your save file I assume you would store how many cursor objects the player bought.
Once you have the time difference you check how many times two seconds fit into it, and multiply the result by the number of purchased cursors.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.