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

Inaccurate physics with simple bodies (RigidBodies can temporarily penetrate other PhysicsBodies) #16505

Open
Tracked by #45333
Dobbias opened this issue Feb 8, 2018 · 10 comments

Comments

@Dobbias
Copy link
Contributor

Dobbias commented Feb 8, 2018

Godot version:
v3.0.stable.official

OS/device including version:
Windows 10 Pro 10.0.16299 Build 16299

Issue description:
Simple 3d physics are not resolved correctly. Slow moving rigidbodies can enter/penetrate staticbodies at slow speeds. This collision is slowly corrected over several frames by pushing out the rigidbody. Setting the physics fps to a high value like 240 fps minimizes the problem, but it's still noticeable.

Sample Video

Steps to reproduce:
Add a staticbody as a ground. Add an rigidbody with a sphere collider and drop it from medium heights (10-20 Units).

Minimal reproduction project:
Left-Mouseclick accelerate rigidbody.
Physics_Issue.zip

@Dobbias
Copy link
Contributor Author

Dobbias commented Feb 9, 2018

This incorrect behaviour has been confirmed from multiple users in the comments of this post on reddit.

@Calinou
Copy link
Member

Calinou commented Feb 9, 2018

Related issue: #9071

@Dobbias
Copy link
Contributor Author

Dobbias commented Feb 9, 2018

I'm not sure if it is directly related to #9071. Since this is not about CCD and the objects are moving slow. From my testing it's even unrelated to the physics backend bullet/godot.

@ghost
Copy link

ghost commented Feb 10, 2018

btw, if anyone is reading this don't listen to those reddit comments by turning up the fixed fps value. this will make your game become distorted for other players. (not everyone who plays your game will have the same fixed refresh rate as you).

@enthus1ast
Copy link

enthus1ast commented Jul 14, 2018

#20105 looks like the same but for 2d

@andyfreer
Copy link

looks like a CCD issue caused by too few solver iterations for the speed of the objects / timescale being used, however, seems like this is hardcoded whenever it's needed

maybe this can be added as a UI setting that users can tweak

@notverymoe
Copy link

notverymoe commented May 5, 2020

Not sure if additional test-cases/experiences are wanted since it's been confirmed, but, I ran into this recently in 3.2.1-stable-mono on Ubuntu 20.04 and put together one before I found this.

From my testing, CCD doesn't appear to make a difference and the issue only noticeably affects certain shapes with the default sizes/settings. In particular, boxes and convex colliders, cylinders appear to be covered by #27212 and #38426. Scaled shapes in general appear to be affected as well, as per the report's minimal example.

Rotating on two axes appears like it may prevent/reduce the brief penetration for certain shapes, not sure if that's a clue as to the issue (Edit: Maybe because it gives a single vertex instead of a line or face?). I missed testing concave colliders unfortunately, but I can come back and add that when I have the chance. Both the Bullet and GodotPhysics backends appear to exhibit the behavior.

File: Physics.tar.gz
Video: https://youtu.be/WI5zC6CuA8k
Controls:
1 - Restart at 1.00x speed
2 - Restart at 0.50x speed
3 - Restart at 0.25x speed
4 - Restart at 0.10x speed
R - Restart without CCD
C - Restart with CCD

I tried to keep all of the collider settings at their defaults and to scale the fixed process rate in slowmo to maintain the physics step size - so you can see what's going on.

@Zireael07
Copy link
Contributor

IIRC CCD is MIA for quite some time? @Calinou

@Calinou
Copy link
Member

Calinou commented May 5, 2020

@Zireael07 Indeed, see #9071.

@Calinou Calinou changed the title Inaccurate physics with simple bodies Inaccurate physics with simple bodies (RigidBodies can temporarily penetrate other shapes) May 5, 2020
@Calinou Calinou changed the title Inaccurate physics with simple bodies (RigidBodies can temporarily penetrate other shapes) Inaccurate physics with simple bodies (RigidBodies can temporarily penetrate other PhysicsBodies) May 5, 2020
@akien-mga
Copy link
Member

Confirmed reproducible in 3.3 with both Bullet and GodotPhysics (both with the MRP from #16505 (comment) and the more advanced test suite from #16505 (comment)).

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

8 participants