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

Physics sometimes broken? (Don't know what to name this) #64179

Closed
SeanRamey opened this issue Aug 9, 2022 · 1 comment
Closed

Physics sometimes broken? (Don't know what to name this) #64179

SeanRamey opened this issue Aug 9, 2022 · 1 comment

Comments

@SeanRamey
Copy link

SeanRamey commented Aug 9, 2022

Godot version

3.5.stable.arch_linux

System information

Operating System: EndeavourOS KDE Plasma Version: 5.25.4 KDE Frameworks Version: 5.96.0 Qt Version: 5.15.5 Kernel Version: 5.18.16-arch1-1 (64-bit) Graphics Platform: X11 Processors: 6 × Intel® Core™ i5-8400 CPU @ 2.80GHz Memory: 15.6 GiB of RAM Graphics Processor: NVIDIA GeForce GTX 1070/PCIe/SSE2 Manufacturer: Gigabyte Technology Co., Ltd. Product Name: Z370 AORUS Gaming WIFI

Issue description

I have created 2 projects.

In the first (and original) project, when the character falls to the floor and collides, it slows the game down to around 1 frame every 4 seconds. In the second project, in which I've tried to recreate the first one, it simply works as expected and doesn't slow the game down to a crawl. I cannot find any significant differences between these two projects, so I'm reporting this as a bug.

Steps to reproduce

I don't really know. Just open my test projects and hit play.

Video of the broken physics in project1:
https://user-images.githubusercontent.com/3057229/183747908-3b5cab6c-b564-4e85-bf05-801770161e83.mp4

Video of the working physics in project2:
https://user-images.githubusercontent.com/3057229/183748006-38213079-0029-40e4-8c17-1d35f95c8f00.mp4

Minimal reproduction project

First project with original issue: pikmin.zip
Second project that doesn't have the issue: pikmin2.zip

@Calinou
Copy link
Member

Calinou commented Aug 9, 2022

I can confirm this on 3.5 (Linux, NVIDIA 515.57).

Both projects seem to have the same amount of polygons in their convex collision shapes (4 for the floor, 1154 (!) for the character). However, as you can see, 1154 vertices is way too much for a player. You probably don't need a convex shape for the player – I suggest using a primitive BoxShape or a CapsuleShape instead, which is much faster to collide against.

Also, consider using a concave (trimesh) collision shape for the floor instead of a convex shape. These are specifically intended to be used with StaticBodies.

The issue occurs in the first project because it uses GodotPhysics, whereas the second project uses Bullet physics. GodotPhysics has much worse performance issues with complex convex shapes compared to Bullet, to the point of freezing entirely in soem cases. This seems to be a duplicate of #48587, closing. The situation should improve a lot once #63702 is merged.

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

2 participants