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

Areas' Replace-Combine space overrides don't work right in 3.2.3-rc6 #42051

Closed
tcoxon opened this issue Sep 14, 2020 · 5 comments
Closed

Areas' Replace-Combine space overrides don't work right in 3.2.3-rc6 #42051

tcoxon opened this issue Sep 14, 2020 · 5 comments

Comments

@tcoxon
Copy link
Contributor

tcoxon commented Sep 14, 2020

Godot version:
Official 3.2.3-rc6 build

OS/device including version:
Ubuntu Linux 16.04, 64-bit
GeForce GTX 970 with NVIDIA 384.130 driver
GLES3 backend
Bullet Physics

Issue description:
The behavior of Area Replace-Combine space overrides has changed in 3.2.3. I noted this originally in #41743 but I think it has a separate underlying cause since it appears to be new to 3.2.3.

Steps to reproduce:

  1. Run the attached project in 3.2.3-rc6
  2. Observe the RigidBody cube falls straight through the blue Areas (the script teleports it back to the top once it passes a certain threshold):

cb-495

The expected behavior, observed in 3.2.2 and earlier is for the blue Areas to slow the RigidBody's descent and gradually float it to the top by replacing gravity:

cb-496

Minimal reproduction project:
AreaReplaceCombine.zip

@akien-mga
Copy link
Member

The regression happened between 3.2.2-stable and 3.2.3-beta1.
Changelog: 3.2.2-stable...89f57ae

@akien-mga
Copy link
Member

The behavior in 3.2.3 RC 6 seems to be consistent between Bullet and GodotPhysics (though to test the MRP with GodotPhysics the _process method should be changed to _physics_process, otherwise the RID is invalid), so it might actually be a compat breaking bugfix and not a regression per se.

The change was caused by #39084 (reverting it restores the original behavior from 3.2.2-stable).

Most likely what's needed here is more damping now that Bullet damping is no longer way too strong.

@madmiraal
Copy link
Contributor

#39084 fixed two issues in 3.2 with damping in Bullet physics: #19182 and #30991, but it also fixed how SpaceOverrides work.

This has had two effects on the MRP:

  1. The two areas use Replace-Combine which replaces the gravity and damping settings with this Area's settings, but allows further processing to continue. With [3.2] Better damping implementation for Bullet rigid bodies #39084, this now correctly includes combining the world gravity (the lowest priority) and hence the large gravity seen.
  2. The two areas use a damping of 0.99. With [3.2] Better damping implementation for Bullet rigid bodies #39084, damping is now equivalent to deceleration. This makes damping more intuitive at the cost of being less physically accurate. It also makes damping between 0.9 and 1.0 less severe; so if damping was high it will be noticeably lower than before.

I've created the following table to help make converting the damping values easier:

Damping Old Bullet Deceleration Godot and Fixed Bullet Deceleration
0.1 -0.11 -0.1
0.2 -0.22 -0.2
0.3 -0.36 -0.3
0.4 -0.51 -0.4
0.5 -0.69 -0.5
0.6 -0.91 -0.6
0.7 -1.19 -0.7
0.8 -1.59 -0.8
0.9 -2.26 -0.9
0.99 -4.43 -0.99
0.999 -6.52 -0.999
0.9999 -8.54 -0.9999
0.99999 -10.48 -0.99999
1.0 -60 -1.0
2 -60 -2
5 -60 -5
10 -60 -10
15 -60 -15
20 -60 -20
25 -60 -25
30 -60 -30
35 -60 -35
45 -60 -45
50 -60 -50
60 -60 -60

To modify the MRP to behave like it did before requires three things:

  1. Set the Areas' SpaceOverride settings to Replace. This ensures that within an Area only that Area's settings apply and the world's settings are not added.
  2. Modify the priorities of the Areas so that the second Area which is required to override the first is higher.
  3. Modify the linear damping to around 5; so it's equivalent to what it was before.
    I've attached a modified MRP for convenience:
    AreaReplaceCombine-Updated.zip

@tcoxon
Copy link
Contributor Author

tcoxon commented Sep 17, 2020

Thanks, that makes sense. After making the suggested changes to my project, everything appears to behave correctly. Since this is not a bug I think the issue could be closed?

@akien-mga
Copy link
Member

Yes, thanks for confirming that it works for you. I linked this discussion in the release blog post for other users who might need to do similar adjustments.

hhyyrylainen added a commit to Revolutionary-Games/Thrive that referenced this issue Sep 24, 2020
hhyyrylainen added a commit to Revolutionary-Games/Thrive that referenced this issue Sep 25, 2020
* csproj changes required for Godot 3.2.3

* Updated specified version in docs and scripts

* Updated CI to use updated image and bumped all the caches just to be

safe with them

* Updated damping values to hopefully match the previous ones

with the table from: godotengine/godot#42051 (comment)

* Fix microbe stage fade in starting before editor was set to an

instance, causing an error with a null pointer from godot
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

5 participants