Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time going backwards #25166

Open
hedin-hiervard opened this issue Jan 20, 2019 · 8 comments
Open

Time going backwards #25166

hedin-hiervard opened this issue Jan 20, 2019 · 8 comments

Comments

@hedin-hiervard
Copy link
Contributor

Godot version:

3.1 beta2

Issue description:

See the screenshot attached.

screen shot 2019-01-20 at 15 12 20

@hedin-hiervard
Copy link
Contributor Author

Just to clarify: I added if delta > 0 after I launched the game. So, ignore that line.

@akien-mga
Copy link
Member

akien-mga commented Jan 21, 2019

Can't do anything if you don't give any information, I'm sorry. The issue template asks you for your OS and steps to reproduce because we need such information.

@hedin-hiervard
Copy link
Contributor Author

Can't do anything if you don't give any information, I'm sorry. The issue template asks you for your OS and steps to reproduce because we need such information.

The OS is Mac OSX. Sorry, this happens inside a complex project and I really can't make a minimal repro.

@Faless
Copy link
Collaborator

Faless commented Feb 1, 2019

@hedin-hiervard do you get any error in the console? Something like:
OS CLOCK IS NOT WORKING
or
ret != 0
What version of OSX are you running?

@Faless
Copy link
Collaborator

Faless commented Feb 1, 2019

@hedin-hiervard also, does it happens immediately, or after some time it's running?

@bojidar-bg
Copy link
Contributor

Refs: #26887 -- seems to happen on Windows as well.

lawnjelly added a commit to lawnjelly/godot that referenced this issue Sep 2, 2019
…bugs.

On some hardware / OSes calls to timing APIs may occasionally falsely give the impression time is running backwards (e.g. QueryPerformanceCounter). This can cause bugs in any Godot code that assumes time always goes forwards. This PR simply records the previous time returned by the OS, and returns the previous time if the new time is earlier than the previous time.

May fix godotengine#31837, godotengine#25166, godotengine#27887.
lawnjelly added a commit to lawnjelly/godot that referenced this issue Sep 2, 2019
…bugs.

On some hardware / OSes calls to timing APIs may occasionally falsely give the impression time is running backwards (e.g. QueryPerformanceCounter). This can cause bugs in any Godot code that assumes time always goes forwards. This PR simply records the previous time returned by the OS, and returns the previous time if the new time is earlier than the previous time.

May fix godotengine#31837, godotengine#25166, godotengine#27887.
@Faless
Copy link
Collaborator

Faless commented Oct 3, 2019

To anyone that can reproduce the original issue
can you try this branch?
https://github.com/Faless/godot/tree/spike/clock_info
Is it still happening there?

The patch just tries to avoid some unnecessary math, limiting potential overflows and hopefully minimizing numerical errors:
master...Faless:spike/clock_info

(there is also a 3.1 version of this patch: https://github.com/Faless/godot/tree/spike/clock_info_3.1 )

@KoBeWi
Copy link
Member

KoBeWi commented Nov 3, 2020

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants