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

[Bullet] Sharp change in damp function when passing 1.0 mark with distro packaged Bullet (no BT_USE_OLD_DAMPING_METHOD) #55599

Closed
stylemistake opened this issue Dec 3, 2021 · 10 comments

Comments

@stylemistake
Copy link

stylemistake commented Dec 3, 2021

Godot version

3.4.stable

System information

Arch Linux, GLES3, Radeon RX550

Issue description

I opened my project in new version of Godot (3.4), and it made all RigidBodies much stiffer to control, and experimentally I have figured out that linear_damp and angular_damp settings were to blame.

This is how I would describe the current (3.4) damp response:

unknown-3

It should be a consistent response, a continuous curve without any sudden jumps, and it is a game breaking regression.

Jump happens at around total 1.0 mark, which is project dependent (if project settings has 0.1, then it's going to jump at 0.9 in rigidbody settings).

Steps to reproduce

  1. Create a RigidBody
  2. Write a script that applies a consistent torque to it
  3. Try at 0.89 angular_damp, measure terminal angular velocity
  4. Try at 0.91 angular_damp, measure terminal angular velocity

It is project settings dependent, since 0.1 is the default damp and all numbers combine (in our case 0.1 + 0.9) to create the final damp number.

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Dec 3, 2021

@stylemistake Is this in 2D or 3D? If 3D, can you reproduce this with the GodotPhysics engine by changing the 3D physics engine in the Project Settings? (The default in 3D is Bullet.)

@Calinou Calinou added this to the 3.5 milestone Dec 3, 2021
@stylemistake

This comment has been minimized.

@stylemistake
Copy link
Author

Disregard my previous comment, this is only reproducible with the Bullet engine.

@Calinou Calinou changed the title [Physics, Regression] Sharp change in damp function when passing 1.0 mark [Bullet] Sharp change in damp function when passing 1.0 mark Dec 3, 2021
@Calinou
Copy link
Member

Calinou commented Dec 3, 2021

cc @pouleyKetchoupp

I remember seeing changes related to Bullet drag damping, but I thought these weren't backported to 3.x.

@madmiraal
Copy link
Contributor

The original fix was backported in #39084.

@akien-mga
Copy link
Member

Also worth noting that Bullet was updated to 3.17 for Godot 3.4, which may have impacted this.

@madmiraal
Copy link
Contributor

@stylemistake Please provide an MRP, because I'm unable to reproduce this issue. It works fine for me using both Bullet and Godot physics.
Bullet physics:
55599-Bullet
Godot physics:
55599-Godot
Sample project: 55599.zip

@akien-mga
Copy link
Member

akien-mga commented Dec 4, 2021

Arch Linux

Are you using the official Godot binary, or one packaged by Arch? This can impact the Bullet configuration.

My guess is that you might be using a distro packaged Bullet which doesn't define BT_USE_OLD_DAMPING_METHOD like we do for our vendored version:

env_bullet.Append(CPPDEFINES=["BT_USE_OLD_DAMPING_METHOD", "BT_THREADSAFE"])

That would also be a problem in my Fedora and Mageia packages, so I guess we might need to prevent unbundling Bullet, or document this as a caveat for distro packages.

Maybe upstream Bullet would be amenable to making this a runtime Boolean option instead of a compile time define, so that we could still use distro packages by setting a runtime flag.

@stylemistake
Copy link
Author

stylemistake commented Dec 5, 2021

@madmiraal Thank you for making a test project, and this is how it behaves in my environment:

output_00002.mp4

distro packaged Bullet which doesn't define BT_USE_OLD_DAMPING_METHOD like we do for our vendored version

@akien-mga Can confirm, PKGBUILD for Godot unbundles Bullet and doesn't account for these defines.

Once I've changed it to use the bundled version of bullet, problem seems to be gone, and it's an easy change as well, slightly annoying that it has to be bundled.

@akien-mga akien-mga changed the title [Bullet] Sharp change in damp function when passing 1.0 mark [Bullet] Sharp change in damp function when passing 1.0 mark with distro packaged Bullet (no BT_USE_OLD_DAMPING_METHOD) Dec 5, 2021
@stylemistake
Copy link
Author

Nothing to fix here, so I'm closing this.

@stylemistake stylemistake closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2022
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