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

StaticBody3D detection instability in JoltPhysics #101721

Open
vaner-org opened this issue Jan 17, 2025 · 1 comment
Open

StaticBody3D detection instability in JoltPhysics #101721

vaner-org opened this issue Jan 17, 2025 · 1 comment

Comments

@vaner-org
Copy link
Contributor

Tested versions

Godot v4.4.beta1, regression from 4.3 stable with Jolt addon.

System information

Windows 10 (build 19044) - Single-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 32.0.15.6636) - AMD Ryzen 9 5950X 16-Core Processor (32 threads)

Issue description

I have two scenes that work as parametrized stair and ladder generators. They both use most of the same code, with the stairs generated as arranged StaticBody3Ds, and ladders generated as arranged CSGCylinders with collision enabled.

In 4.3 stable with the Jolt addon, using an Area3D with "Areas Detect Static Bodies" enabled in settings gave mostly reliable results, as the Area3D came into proximity with the ladders and stairs they triggered the enter and exit signals with reasonable stability. The ladders give phantom exit signals when they shouldn't, but these only occur when the Area3D is moved, so they do not impact performance very much.

However, in 4.4, while the ladder bodies (composed of CSGCylinders) detect the same way, but the steps made of StaticBodies all enter and exit repeatedly every frame, adding a massive performance drop in my project whenever they are encountered by my player.

Steps to reproduce

For the purposes of demonstration, I have arranged my ladder constructor, an ordinary StaticBody, and my stairs constructor side by side.

Image

In both projects, pressing "W" or "S" on the keyboard will move the Area3D, and the game will print entrances and exits to output.

Minimal reproduction project (MRP)

Expected behavior in 4.3 can be seen with jolt-staticbody-mrp-4.3.zip, addon is included.
Problem can be seen in 4.4 with jolt-staticbody-mrp-4.4.zip.

@mihe mihe added this to the 4.4 milestone Jan 17, 2025
@mihe mihe self-assigned this Jan 17, 2025
@mihe mihe moved this from Unassessed to Release Blocker in 4.x Release Blockers Jan 18, 2025
@mihe
Copy link
Contributor

mihe commented Jan 18, 2025

The stairs thing looks to be another regression caused by #100983, but I haven't looked into why just yet.

The ladders give phantom exit signals when they shouldn't, but these only occur when the Area3D is moved, so they do not impact performance very much.

This seems somewhat problematic, and was not something I was aware of. I'll see about figuring out why this is happening as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Release Blocker
Development

No branches or pull requests

2 participants