-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[Bullet] Jittering against two discrete, connected walls #34596
Comments
Newest update (Jan 8): Recompiled after #34921 was merged (after cleaning) just to see if it had any effect. Unfortunately none :( Previous Update: The jittering in-place doesn't seem to happen anymore, but it still happens when walking over "cracks" and sliding against "cracks" as well. I've created a minimal reproduction project that uses a GridMap. The walls and floors are all made of 1x1x1 cubes. As the entire world geometry is made of way more discrete shapes, it is much more easy to demonstrate this bug here, as well as highlighting that it occurs on floors as well. Here is what it looks like using plain move_and_slide(): The jittering is very extreme when standing on four tiles simultaneously, and less extreme when standing on two tiles. move_and_slide_with_snap(): It's hard to see in the gif, but while there is no extreme jittering while standing in place, the player seems to treat each "line" between tiles as a small crack in the floor, making traversing along it very bumpy. Additionally, while not shown in the gif, the jittering still occurs when sliding against walls, specifically at the intersection between two like so: I've tried removing the floor check when applying downward velocity (gravity) and the bug still occurs. Download this reproduction project: |
CC @madmiraal |
This problem occurs when a KinematicBody using This problem does not occur in 3.0.6. My minimal projects: This looks like a duplicate of #28438, #29392, #32182 and/or #34663. However, the problem is more general than described there or here. Note: This problem also occurs with |
@aqnuep Since you submitted #27415, do you have any idea what could be causing this? See @madmiraal's comment above. |
Additional workaround for 34596 (godotengine/godot#34596). If acceleration via gravity makes our vertical momentum something small and we collide with two objects, there's a risk we won't collide with the surface we're sitting on which causes an unpleasant jitter effect.
Additional workaround for Godot issue #34596 (godotengine/godot#34596). If acceleration via gravity makes our vertical momentum something small and we collide with two objects, there's a risk we won't collide with the surface we're sitting on which causes an unpleasant jitter effect.
I tested both samples using both Bullet and GodotPhysics. They work perfect with GodotPhysics. |
There was a bug in GodotPhysics that made it break in some scenes which was introduced recently, should be fixed by I suggest using the same logic in the Bullet physics server to ensure it works there too. |
FWIW, I did not encounter such jittering with either convex shapes or trimeshes though I did not test such a scene entirely built from convex shapes. The type of jittering does seem to be the result of one of the many margin values used throughout Godot and the individual physics servers. I recall making changes on that front too, but that was specific to ray shapes. Please note though that the pre-3.2 Bullet kinematic body implementation was quite broken and it may just have worked by chance due to often doing literally 1000x more collision checks than necessary (dropping frame-rate to the single-digits) but, of course, it's possible that the fix for that did not address some margin related issues that exist there. In fact, IIRC there were quite some inconsistencies across the Bullet physics server code on how margins are set up for the various shapes, but didn't want to touch those any more than necessary, so the issue is probably around there. |
Additional workaround for Godot issue #34596 (godotengine/godot#34596). If acceleration via gravity makes our vertical momentum something small and we collide with two objects, there's a risk we won't collide with the surface we're sitting on which causes an unpleasant jitter effect.
If Godot 4 has moved bullet externally, this issue should also be closed. |
Someone's been working on re-adding Bullet to Godot 4.0, but I don't know if it'll be merged: #47508 |
Fixed by #56801. |
Godot version:
3.2 dev
OS/device including version:
Windows 10 64-bit
Issue description:
In Godot 3.2, the physics seems to have changed in some way (at least for KinematicBody) that makes sliding along surfaces a lot more bumpy. This is similar to #32182, but this time it's different between versions and it doesn't just occur in corners or exclusively against trimesh shapes (all of the walls are convex in this example).
Behavior in v3.1.2 (desired):
Behavior in v3.2:
Steps to reproduce:
Open the minimal reproduction project and run it. You will find that you start the scene staring at the wall. Turn to the right, jump over the step and slide against the wall.
Minimal reproduction project:
Note: apologies, but this reproduction project currently contains a prepackaged Qodot. This is because I don't believe I'll be able to set up this type of environment with hand-rolled geometry. I could position three skinny StaticBody's against one another but I don't think that would be a proper environment, I would rather have it tested in something more complex like this.
movement.zip
Additional notes:
I tried playing with the safe margins on both KinematicBody and its CollisionShape but it seemed to have little to no effect at all. Furthermore, the effects are much more exaggerated when using BoxShape instead of a cylinder or capsule. However, all of them seem to exhibit some kind of sudden "snapping" behavior from moving between adjacent floors, not walls. I assume this is related to this exact bug.
The text was updated successfully, but these errors were encountered: