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

[GodotPhysics] Trimesh collision kill my FPS #59491

Closed
Tracked by #45333
Noiros opened this issue Mar 24, 2022 · 12 comments
Closed
Tracked by #45333

[GodotPhysics] Trimesh collision kill my FPS #59491

Noiros opened this issue Mar 24, 2022 · 12 comments

Comments

@Noiros
Copy link

Noiros commented Mar 24, 2022

Godot version

4.0 alpha 5

System information

Windows 11, GLES3, Rx 5700 XT, Ryzen 7 3600x

Issue description

if you enter a narrow place that is colliding trimesh, fps will start to die

demonstrative video, just watch the fps at the top left:
https://www.youtube.com/watch?v=rWlTYH-SchE

Steps to reproduce

make a hole in a mesh then, generate a trimesh collision and bring a character into it and look at your FPS

For minimal project just open the game and press up arrow.

Minimal reproduction project

minimal coll lag.zip

@Calinou
Copy link
Member

Calinou commented Mar 24, 2022

I think this is expected, especially if your entire level is a single TriMesh collision shape (which can be very complex).

One solution is to add invisible barriers to prevent players from getting stuck in that kind of corner. This will also make gameplay less frustrating 🙂

@Zireael07
Copy link
Contributor

Dupe/related to #48587 ?

@Noiros
Copy link
Author

Noiros commented Mar 25, 2022

I think this is expected, especially if your entire level is a single TriMesh collision shape (which can be very complex).

One solution is to add invisible barriers to prevent players from getting stuck in that kind of corner. This will also make gameplay less frustrating 🙂

yes, but even in the minimal project, with simple cube with a hollow the fps dies
moreover it worked well in v3.x

@Calinou
Copy link
Member

Calinou commented Mar 25, 2022

Dupe/related to #48587 ?

That issue is about a complex convex shape, while this one is about a concave (trimesh) shape.

@yosoyfreeman
Copy link
Contributor

I personally don't think this is expected. A drop while working with complex colliders is expected, but dropping to almost 0 fps in a common use case like that seems a bit exaggerated. It could be great to check if the results are similar with older versions of Godot.

@Noiros
Copy link
Author

Noiros commented Mar 25, 2022

my game was before in 3.x and no lag appeared at these places

@Calinou Calinou added this to the 4.0 milestone Mar 25, 2022
@Calinou
Copy link
Member

Calinou commented Mar 25, 2022

my game was before in 3.x and no lag appeared at these places

Did you use Bullet or GodotPhysics in 3.x? Godot 3.x uses Bullet by default, but Godot 4.0 uses GodotPhysics by default (with no option to switch back to Bullet).

@Noiros
Copy link
Author

Noiros commented Mar 26, 2022

In 3.x i use Bullet (DEFAULT) and in 4.0 i use DEFAULT (GodotPhysics)

@Calinou
Copy link
Member

Calinou commented Mar 26, 2022

In 3.x i use Bullet (DEFAULT) and in 4.0 i use DEFAULT (GodotPhysics)

If you still have access to the 3.x project, can you try switching to GodotPhysics there and see if you can reproduce this issue? This would rule out any 4.0-specific regression.

@Noiros
Copy link
Author

Noiros commented Mar 26, 2022

I tried in the original game in 3.x and no lag, I also redid exactly the minimal project and just a small decrease of the fps at the collision

here is the minimal project for 3.x, you can test with GodotPhysics and bullet
minimal coll lag 3.x.zip

@Calinou Calinou changed the title Trimesh collision kill my FPS [GodotPhysics] Trimesh collision kill my FPS Jun 22, 2022
@fabriceci
Copy link
Contributor

I retested the minimal project on both latest version, the situation seems to be a lot much better now, could you confirm @Noiros ?

Godot 4 alpha 10: 590 FPS -> 550 fps ( -~40 FPS during the collision in the hole)
Godot 3.5 rc4 (with same environment and light) : 462 FPS stable

@akien-mga
Copy link
Member

akien-mga commented Feb 26, 2023

I don't know if this was fixed, but the MRP isn't properly showing the issue being described.

Like @fabriceci, I have a very minimal FPS drop when triggering the collision in the hole, which is not unexpected.
I go from 570 FPS to 430 FPS. The same happens in 4.0 alpha 5 (as for the original report and 4.0 RC 5).

So I think the issue probably still exists, but it's better described and tracked in #57313.

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

6 participants