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

Jitter in 2D Window with KinematicBody2D #16

Open
Playfulminds opened this issue Nov 6, 2021 · 7 comments
Open

Jitter in 2D Window with KinematicBody2D #16

Playfulminds opened this issue Nov 6, 2021 · 7 comments

Comments

@Playfulminds
Copy link

Playfulminds commented Nov 6, 2021

Thank you for putting this together. It may be that I have not set up correctly as I don't see the addon doing anything.

physics set to 60 fps
Physics Jitter 0 to 0.5 --> no difference
Use VSync On --> no difference
Use VSync Composite -> huge difference for about 15 seconds then jitters, but less than without

I don't see that mesh connection like in 3D. So I just connected the player. Am I supposed to connect something else?
global in --> no difference
global out --> no difference

Did I set up something incorrectly? I don't see any differences with the addon on or off.

image

image

@Calinou
Copy link
Contributor

Calinou commented Nov 6, 2021

Did I set up something incorrectly? I don't see any differences with the addon on or off.

To see the difference, try setting Physics Fps to a very low value such as 10 in the Project Settings. It should make the difference between having physics interpolation and not having it obvious.

Also, I recommend upgrading to Godot 3.4 as it offers delta smoothing when V-Sync is enabled. Since Godot 3.4, you can also enable an experimental option to sync frame delta after draw in the Project Settings.

@Playfulminds
Copy link
Author

Delta Smoothing was checked. I tried enable sync as well no difference.

What is weird is there are spots on the screen that it goes smooth. Always the same area.

@lawnjelly
Copy link
Owner

If that is your node layout in your screenshot, then no it won't do anything. You need to place the visible nodes (sprites, whatever you use) as children of the Smoothing node, rather than children of the Player.

Alternatively if you are patient we should have this available in core soon in Godot 3.5 and it should be much easier to use.

@Playfulminds
Copy link
Author

Ty for the response. Sorry for the noob questions. If I put the player as a child of Smoothing, all the in game speeds of the player are changed (accelerated) and it becomes a huge jitter. Is there a vid or noob instructions on how to use with 2D?

I am patient but I was wondering if this would fix the windowed jitters.

@lawnjelly
Copy link
Owner

The procedure in 2d is pretty much the same as in 3d:
https://www.youtube.com/watch?v=lWhHBAcH4sM

The difficult thing you have to get your head around, is that you have to physically separate the physics representation of the player (kinematic body, rigid body etc), from the VISUAL representation (sprite etc).

ONLY the visual representation should go under the smoothing node, and this will follow the target (the Player kinematic body). Understanding this does depend on understanding some fundamentals of how godot does transforms and how the scene tree works.

Whether this will fix your jitters very much depends, in 2d especially there are a lot of sources of jitter, especially with pixel snapped games (which this will not fix entirely). If you are making a 2d pixel snapped game instead I would recommend checking out this explanation:
https://github.com/lawnjelly/godot-snapping-demo

@AbdoSarmini
Copy link

Alternatively if you are patient we should have this available in core soon in Godot 3.5 and it should be much easier to use.

Hi. I see the option for physics interpolation in the physics settings in Godot 3.5, but it doesn't affect anything. Is this only for 3D or what?

@Calinou
Copy link
Contributor

Calinou commented Aug 9, 2022

Is this only for 3D or what?

Yes, it's currently only for 3D. 2D physics interpolation is planned for Godot 3.6.

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

4 participants