-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
move_and_slide is not smooth w/ high refresh monitors #17516
Comments
actually, i'm going to compile this right now using |
yep, it fixes it! movement takes the same amount of time going from point a to point b, on my 120hz monitor as it does when switching to 60hz. not sure about repercussions of this change, but i think at least developers should implement an option to use in fact, if you are a game developer, you'd want your game to run the same on all monitor types really. |
@girng You are supposed to use Guess I might make a quick PR a bit later. 😃 |
@bojidar-bg problem is, if you use physics_process to move, it uses the 60 fps default delta (0.0167), which creates the jitter issue for higher refresh rate monitors. you must use e: btw, thx for response. glad this is seeing dev attention. very important i feel. |
Just to mention the counter-problem, if you use _process to move, then your simulation is frame-rate dependent unless you know and apply calculus. P.S.: Nice you are saying thanks here and there, it helps create a less-toxic atmosphere, even if it isn't widely practised |
@bojidar-bg np, if you are taking time to help my issue, i will give respect. it's very appreciated, same for poke's camera PR too! if it also can help game developers, it's a win win in my book. well, i tried physics_process to move on my 120hz monitor, and it's very jittery in the background. but if i use as of right now though, if you use the movement in |
Perhaps there just needs to be a way to update the physics framerate based on the monitor? That could get tricky because it seems to be a project setting. Maybe add a boolean saying to scale the physics update frequency based on the detected display rather than setting a global physics framerate. @girng Does setting the Physics Fps in Project->Project Settings->Physics->Common to 120 fix the jitter on your 120 Hz monitor when using |
The plan outlined by @reduz is to have adaptive FPS: you define in your project settings a range of refresh rates to support (e.g. from 60 Hz to 144 Hz), the OS API will query the monitor's actual refresh rate and adjust the physics framerate accordingly. It should solve 98% of use cases at no cost. Any more advanced work on physics interpolation will have to be assessed afterwards if/when there's a need. |
This is now possible in gdscript or I´m wrong?:
Is that? I do that (a bit complex that explained, with median values and roundings...) and don´t have any jitter (by physics, stutter "car demo kind" is other problem) |
@Dar13 yep, it does. |
…not recommended Previously, it would reuse the _physics_process delta, causing it to move faster on faster framerates Fixes godotengine#17516
documentation for this says
the documentation is telling you not to use a delta, but this is kind of bad because w/o a delta given, the movement is vastly different from 60hz to lets say 120hz.
while looking at #15060, i also see something in:
physics_body.cpp
:godot/scene/2d/physics_body_2d.cpp
Line 1018 in 53a2b0a
@poke1024 can you take a look here if you got time as well?
would changing this to how you changed the camera2d be a possible solution, or is this something else?
The text was updated successfully, but these errors were encountered: