0 votes

Have a look at the chronic stuttering in the Pong Template demo. Anyone know why it occurs?

https://streamable.com/6btrm

Sorry, can't see/find how to inline the video. It's very short, a few seconds.

in Engine by (20 points)

1 Answer

0 votes

My best bet is it's because of the lack of interpolation between physic thread and rendering thread. More here: https://github.com/godotengine/godot/issues/10388

by (1,277 points)

That causes more concerns. Is there no way to get silky smooth, reliable, simple motion in Godot?

If that's indeed root of your problem then at current moment I suppose you can achieve fluent motion by not using physics at all and move your body inside 'idle' (regular) thread... This issue however should be fixed quite soon (in 3.1) in which we are expecting to have physic step interpolation.

No. Definitely need motion to be done and handled by physics. Unfortunately.

Has anyone at Godot HQ considered using Chipmunk2D for Godot's 2D physics needs? It could solve all of this, and more, and has a (somewhat) similar API.

Well the interpolation code is quite simple to write (maybe not trivial but for sure it will be quite short piece of code). And it will be more simple task than integrating another physic engine and integrating it in a way that would be transparent for current engine users. Not mentioning the same issue need to be solved for 3D as well.

I'm not sure I fully understand why this problem occurs. Or how it got to be there. Never seen this sort of stuttering before with delta time adjusted physics motions.

The problem is a result of the fact that there are two distinct threads working simultaneously. And Physics is calculated in different thread than rendering. Many engines are calculating all the logic inside single thread so in a result engine is slower for physic extensive games.
For other more professional engines like Unity/Unreal i believe they are designed in the same way as Godot - but they have that interpolation step implemented
What this interpolation is responsible for you might ask?
It's basically responsible for smoothing the movement... imagine (just an example) you are calculating physics movement only once per second, so the bodies would move in a really chunky way with huge discrete transitions once per second. But even in such environment you could write a code that would take previous body position and current position and render this movement in a very fluent way (assuming you know that physics is calculated once per second and how much time has passed since last physic calculation, and that this 'smoothing code' is working in normal 60fps intervals). This is exactly what physic step interpolation is doing.
For more accurate description and informations please check this source:
http://lspiroengine.com/?p=378
(or alternatively that one: https://gafferongames.com/post/fix_your_timestep/)

That... plus I'm wondering how it wasn't found earlier, and fixed earlier. This is a showstopper for even the most basic of ball based physics games.

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 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 webmaster@godotengine.org with your username.