Closed evsey9 closed 2 years ago
I can confirm this on commit https://github.com/godotengine/godot/commit/6fcb58f40dae8228074591e3262d5db97db3e2d7. This also occurs when switching to Godot Physics. In fact, it's even more noticeable with Godot Physics (it'll start happening before you even move the cube, unlike Bullet).
Can you reproduce this on any of the earlier 3.2 alphas, betas and RCs? You can download them here.
It's the same on alpha0. The issue is there also on 3.1.2 with Godot Physics backend. (Bullet works fine there)
I ran a Git bisect but only got a commit that's probably not the right one: a9d4cde0f5abc399332dde0c7415b99a5796eb34
Instead of jittering, the KinematicBody will freeze entirely upon touching the ground and won't move anymore at all (even if you press movement keys).
I had to skip many iterations due to several commits not building due to:
scene/gui/texture_rect.cpp: In member function 'void TextureRect::_notification(int)':
scene/gui/texture_rect.cpp:99:14: error: 'struct Rect2' has no member named 'no_area'
99 | if (region.no_area()) {
| ^~~~~~~
(I tried cleaning my build files after every build, it still didn't work.)
Edit: Reverting that particular commit doesn't solve the issue; the KinematicBody still jitters around heavily.
Confirmed to still be a problem on bullet engine for me. Seems fine if the floor is exactly level, but I think my gridmap floors might be on a very slight incline. The y component is not removed when I call move_and_slide(velocity, Vector3(0, 1 ,0), true)
even if the kinematic body is on the floor. is_on_floor()
toggles every frame between true
/false
as well.
sample with collision debug enabled, looks like the edges of collisionshapes are doing weird things?
A workaround seems to be
velocity = move_and_slide_with_snap(velocity, Vector3(0, velocity.y , 0), Vector3(0, 1, 0), true)
(now i get this weirdness: https://streamable.com/mdr3r )
In the Kinematic Character 3D Demo I only have the jittering when the player cube is between two or more floor cubes. On a flat mesh there is no jitter for me.
What GPU is everyone running on? Win7 with an Nvidia 1080ti here.
@Two-Tone I'm using a GeForce GTX 1080 on Fedora 31.
So that rules out it being an AMD issue then.
On Sat, Feb 1, 2020 at 2:51 AM Hugo Locurcio notifications@github.com wrote:
@Two-Tone https://github.com/Two-Tone I'm using a GeForce GTX 1080 on Fedora 31.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/35780?email_source=notifications&email_token=ABBEISYR64OBMMYXO552TTLRAUZYBA5CNFSM4KOGRYHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKQX6XQ#issuecomment-581009246, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBEIS4DNW73DBRJ6SC33VLRAUZYBANCNFSM4KOGRYHA .
Maybe related? #34436
This looks a great deal like issue 34596 where user @madmiraal listed a number of duplicate issues which hopefully can lend even further insight. move_and_slide_with_snap()
does indeed stop jittering on the floor, but any continuous movement in any direction up against a gap between two walls causes the same kind of jitter.
As stated previously, this happens in GodotPhysics (but not Bullet) since 3.1. The jittering occurs in both physics backends as of 3.2 after 6dd65c0.
I am currently on Win10 with a GTX 1060.
Another suggested workaround: change the vector in move_and_slide() or whatever you have from (X, 0, Z) to (X, -0.1, Z).
Another suggested workaround: change the vector in move_and_slide() or whatever you have from (X, 0, Z) to (X, -0.1, Z).
This worked on me. Godot 2.32 - capsule/sphere vs cube collision edges. Im not sure WHY and how. But it solved it. Thanks
I can confirm the issue in Godot 3.3.3, but also 3.4, and it happens not only with Bullet physics but also when setting the physics engine to GodotPhysics. Ping @akien-mga as you said it was fixed for the latter. This may be a regression?
Happens in our latest project. Here's a minimal test demo (you can move forward by pressing A, the bumps should be noticeable):
I can confirm the issue in Godot 3.3.3, but also 3.4, and it happens not only with Bullet physics but also when setting the physics engine to GodotPhysics. Ping @akien-mga as you said it was fixed for the latter. This may be a regression?
I tested your project, I can reproduce the issue with Bullet, but not with GodotPhysics. I see no bumps with GodotPhysics in Godot 3.3.3-stable, 3.4-beta1 through 3.4-beta4 and latest 3.x
(25bd0c3f7).
The bumps in Bullet are subtle but noticeable, but in GodotPhysics I really don't see any. To be sure, I only go forward/backward in the initial position and make sure that the intersection between the left or right edge of the floor and the bottom of the window does not move.
It seems like you changed the 2D engine from "DEFAULT" to "GodotPhysics", not the 3D one. Maybe that's the issue?
Ah! I didn't know there were separate settings for 2D and 3D. Indeed it's only bullet physics then!
I have also encountered this issue. I can confirm that it only happens on Bullet physics and GodotPhysics solves it. I made a test project which shows the issue with using Bullet and GridMap collision, and the effect is quite extreme jitter, very noticeable. Maybe that will help debug the problem. GridMap.zip .
Will there be a fix for Bullet in 3.x?
Will there be a fix for Bullet in 3.x?
It depends on whether a contributor finds a fix for it. I think @pouleyKetchoupp investigated this a while ago, but he didn't find a solution to this bug.
In case anybody would like to contribute on this topic:
The best way to fix most of these Bullet specific issues with KinematicBody would be to rework the code for body_test_motion
in the Bullet physics server to match the logic in Godot Physics closer.
Bullet has a few specific things to handle (for instance all shapes include a collision margin) but it should be possible to get something more similar to Godot Physics than the current code.
If someone is interested, let me know so I can help by giving pointers and answering questions.
As mentioned in Shifty's Godot Character Movement Manifesto, the is_on_floor()
part can be worked around by using a filter on the is_on_floor()
check:
- Unstable floor results make my 'is grounded' flag jitter
- This seems to be down to the collision margin system
- Use a rolling window (2-3 frames should be sufficient) that folds down to a single bool using OR to de-noise the floor check
In other words, create a function that wraps is_on_floor()
and returns true
if is_on_floor()
returned true
at least once in the last 3 physics frames (or 2, but it may not always suffice).
I tested the Kinematic Character 3D demo and confirmed that it's fixed by #56801. Note that the current version of the demo uses 120 FPS for physics to work around the issue - it can now be reverted back to 60 FPS after #56801 and the demo would run fine. (I tested both the current version with 60 FPS and the old version from when this issue was opened, both are fixed).
@NathanLovato's MRP is fixed: https://github.com/godotengine/godot/issues/35780#issuecomment-921331570
@cybereality's MRP is not fixed in my test: https://github.com/godotengine/godot/issues/35780#issuecomment-932821167 So I would suggest opening a dedicated issue for it. FYI #56801 should be in 3.5 RC 2.
That's great news, thanks much for the fix!
Fixed by #56801.
Bullet still bumps on gaps in gridmaps in 3.5 RC1, doesn't do it with Godot Physics.
That's normal, #56801 was merged after 3.5 RC 1. It will be in 3.5 RC 2.
Still having issues in RC2 with this, if the KB is moving slow enough, it'll jitter on the gridmap seams. It does not do this with Godot Physics. It only seems to happen if gravity is being applied to ground, or if the KB is walking into a wall while sliding along it.
I would suggest opening a new issue for cases which are not solved yet.
I would suggest opening a new issue for cases which are not solved yet.
Note: This issue has been confirmed several times already. No need to confirm it further.
Godot version: 3.2 stable OS/device including version: Windows 10 Issue description: KinematicBody jitters up and down a lot on edges of tiles of a gridmap. Steps to reproduce:
Minimal reproduction project: Kinematic Character 3D Demo from the templates has this bug easily noticeable. https://github.com/godotengine/godot/issues/35713 is possibly related.