godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
86.37k stars 19.23k forks source link

[TRACKER] GodotPhysics 3D issues #45333

Open pouleyKetchoupp opened 3 years ago

pouleyKetchoupp commented 3 years ago

This tracker is for all physics issues that affect Godot Physics 3D.

Note 1: Issues that are reported on both 2D and 3D are listed here and in #45334.

Note 2: Issues that can be reproduced on both Bullet and Godot Physics are listed here. Bullet-specific issues are listed in #45022.

Note 3: Issues related to features that are currently Bullet-only are listed here when the plan is to implement them in Godot Physics too (soft body, heightmap).

RigidBody

KinematicBody/CharacterBody

Smooth steps

Collision detection

Area

Joints

Raycasting

GridMap

CSG

Ragdoll

SoftBody

VehicleBody

Heightmap

Multi-threading

Other

Editor

Documentation

4.0 refactoring

Demindiro commented 3 years ago

I think #35877 should be added here too?

josefkaragoli commented 3 years ago

Will you completely rewrite godotphysics from scratch or just address the issues in the tracker?

Calinou commented 3 years ago

Will you completely rewrite godotphysics from scratch or just address the issues in the tracker?

I don't think it'll be rewritten completely, even if parts of GodotPhysics may receive a refactoring. Instead, issues will be fixed individually.

golddotasksquestions commented 3 years ago

Is it possible to add these two issues as well? https://github.com/godotengine/godot/issues/14578 https://github.com/godotengine/godot/issues/27441

pouleyKetchoupp commented 3 years ago

@golddotasksquestions They are already in the 2D physics tracker.

josefkaragoli commented 3 years ago

Is there a repo or somewhere we can see progress?

Calinou commented 3 years ago

Is there a repo or somewhere we can see progress?

Progress on the physics engine itself occurs on this very repository. Look at pull requests labelled with topic:physics: https://github.com/godotengine/godot/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc+label%3Atopic%3Aphysics

Saitodepaula commented 3 years ago

I know it is not an issue, it is a proposal, but could this one be included too? https://github.com/godotengine/godot-proposals/issues/945

My point is that I want to transition my game from Bullet to Godot Physics. There were only 2 things preventing me from doing that: cylinder shapes and center of mass of a rigid body. Now, it's only the position of the rigid body. If I can't change it, I can't move my game to Godot Physics, and I thing there are other games in the same situation.

As a side question/note: is it documented that Godot Physics handles center of mass in a different way than Bullet? I've read it somewhere, but can't find it now: that Godot Physics takes all the collision shapes of a body and calculates the center of mass from them. It is right there in the rigid body doc... Sorry for that...

Calinou commented 3 years ago

As a side question/note: is it documented that Godot Physics handles center of mass in a different way than Bullet? I've read it somewhere, but can't find it now: that Godot Physics takes all the collision shapes of a body and calculates the center of mass from them.

Yes :slightly_smiling_face:

Perhaps this could be added to the manual as well, but I'm not sure which page this information should be added on.

Einlander commented 3 years ago

Can #46610 be added to the csg section?

Calinou commented 3 years ago

Can #46610 be added to the csg section?

This isn't a physics-related issue. It seems we don't have a dedicated CSG tracker issue yet, but feel free to create one if you can accumulate links to current CSG issues.

snouk-z commented 3 years ago

Can this one be added to ? https://github.com/godotengine/godot-proposals/issues/483

Enabling calls to the physics API from multiple threads would be an awesome addition.

RabidTunes commented 3 years ago

@golddotasksquestions commented on 20 Feb Is it possible to add these two issues as well?

14578

27441

@pouleyKetchoupp commented on 20 Feb They are already in the 2D physics tracker.

As I pointed out in one of #14578 comments, this also happens in 3D with the correspondent 3D nodes. Maybe should I create another separated issue for 3D?

pouleyKetchoupp commented 3 years ago

@RabidTunes I've added them to the 3D tracker.

lewis-conroy commented 3 years ago

Sorry if this already exists, but KinematicBodies moved with move_and_slide() slide down slopes regardless of the value of stop_on_slope. Is there an issue open for this already?

Calinou commented 3 years ago

Sorry if this already exists, but KinematicBodies moved with move_and_slide() slide down slopes regardless of the value of stop_on_slope. Is there an issue open for this already?

Yes: https://github.com/godotengine/godot/issues/31097

nezvers commented 3 years ago

Didn't find mention of this issue #49323

Nekuromu commented 2 years ago

I have opened another issue on ConvexPolys related to RigidBodies floating #55503

elvisish commented 2 years ago

I had a bunch of bugs with Godot Physics that seem to have gone with switching to Bullet. I'm using a custom stair stepping implementation and it's not triggering incorrectly with bullet, nor is weird slope handling happening.

Calinou commented 2 years ago

I had a bunch of bugs with Godot Physics that seem to have gone with switching to Bullet. I'm using a custom stair stepping implementation and it's not triggering incorrectly with bullet, nor is weird slope handling happening.

Can you upload a minimal reproduction project somewhere?

Edit: Issue opened: https://github.com/godotengine/godot/issues/57048

elvisish commented 2 years ago

gp_vs_bullet.zip Here, try walking slowly on the ramp with GP, there will be some weird glitching and popping out and occasionally you can get the player to spawn underground. The bullet physics are smooth as silk, although GP is much better for step handling as there isn't that slight move_and_slide drift if you walk up them slowly.

akien-mga commented 2 years ago

@elvisish Could you open a dedicated bug report for this? This issue is a tracker issue to get an overview over existing bug reports. So the workflow would be that you open a bug report about your Godot Physics specific issue, and we'll add it to the list.

elvisish commented 2 years ago

@elvisish Could you open a dedicated bug report for this? This issue is a tracker issue to get an overview over existing bug reports. So the workflow would be that you open a bug report about your Godot Physics specific issue, and we'll add it to the list.

Sure, give me a few minutes I'll write one up and use this as my test project. It's a shame, Godot Physics is MUCH better for stairs precision and it snaps up so smoothly where bullet fails but there's a bunch of other issues that I'll mention.

elvisish commented 2 years ago

@elvisish Could you open a dedicated bug report for this? This issue is a tracker issue to get an overview over existing bug reports. So the workflow would be that you open a bug report about your Godot Physics specific issue, and we'll add it to the list.

As @Calinou edited, I've opened an issue: https://github.com/godotengine/godot/issues/57048

Of note is the last video, you can see the seam/edge issue where the body falls through and gets stuck irreparably, this happens without my up_stepping function and only happens with Godot Physics, not Bullet.

elvisish commented 2 years ago

I’ve since found box collider to be a lot more stable than capsule or cylinder, I still need to test this although I’m not the first to have noticed: https://www.reddit.com/r/godot/comments/pgt0wg/kinematic_body_using_godot_physics_gets_caught_on/

EDIT: box collider gets stuck under tight architecture, improves wall collisions in many ways but still very easy to break irreparably without restarting.

elvisish commented 2 years ago

Are Godot Physics still planned on being fixed now @pouleyKetchoupp is no longer working on them? I'm having to go ahead with GP instead of Bullet, but GP gets stuck in so many gaps it's hard to really work with it in any stable sense, but I imagine it will need to be improved for GD4?

Calinou commented 2 years ago

Are Godot Physics still planned on being fixed now @pouleyKetchoupp is no longer working on them?

Yes, but only if a motivated contributor steps up and opens pull requests :slightly_smiling_face:

I don't have time (or experience) to work on the physics engine myself.

elvisish commented 2 years ago

Are Godot Physics still planned on being fixed now @pouleyKetchoupp is no longer working on them?

Yes, but only if a motivated contributor steps up and opens pull requests slightly_smiling_face

I don't have time (or experience) to work on the physics engine myself.

What is the recommended physics engine to use as of now? Both GP and Bullet implementations have different yet equally problematic bugs right now and with no guarantee either will ever be fixed, I'm uncertain which way to proceed.

GP is frequently recommended since Bullet will be eventually depreciated, but currently it has game breaking bugs that are very easy to cause... in fact, it's harder to not have issues with GP right now. Conversely, Bullet is pretty rock solid but it's future is uncertain and there's many issues with margins that make physics queries completely unreliable.

Calinou commented 2 years ago

What is the recommended physics engine to use as of now?

There is no specific recommendation for 3.x – use the one that works the best for your use cases.

elvisish commented 2 years ago

What is the recommended physics engine to use as of now?

There is no specific recommendation for 3.x – use the one that works the best for your use cases.

That's just the problem, neither works best right now, they both have different flaws that makes it very difficult to pick one over the other.

I would say Bullet is at the very least production ready, but using it for any precise space state work is unreliable. Conversely, GP is very smooth for space state work but has game breaking bugs with general collision and overlaps during movement which makes it totally unusable for production work.

Here's a couple of good examples of the comparative problems:

https://github.com/godotengine/godot/issues/58260

https://github.com/godotengine/godot/issues/57048

Gastronok commented 1 year ago

It seems to me a strange allocation of resources to see all these updates on new 3D rendering techniques while it looks like the fundamental ability to move around in 3D environments is so unreliable.

Are there plans to re-aquire a dedicated physics contributor or is that not a priority?

elvisish commented 1 year ago

It seems to me a strange allocation of resources to see all these updates on new 3D rendering techniques while it looks like the fundamental ability to move around in 3D environments is so unreliable.

Are there plans to re-aquire a dedicated physics contributor or is that not a priority?

I agree, currently only basic 3D physics work is possible since Bullet can't be used for anything precise (and definitely no space state work) and GP is in alpha mode as bodies get stuck on anything and everything that isn't super basic geometry.

reduz commented 1 year ago

There will definitely be more focus on bug fixing after beta.

elvisish commented 1 year ago

Just tried Godot 4.0 beta 3 and still getting stuck in weird geometry, and without Bullet as a backup there's not much hope other than to ensure any terrain or meshes for walking on are absolutely bug tested to ensure there cannot be any strange surfaces to get stuck on. I'd have thought this would have been a far greater priority now there's no fallback physics engine and 4.0 is onto beta 3.

timshannon commented 1 year ago

FWIW, @elvisish I think there are a lot of bugs with the cylinder implementation and maybe capsule. All of my getting stuck with my character body issues went away with a cube collision shape. It's not ideal, but it works better than a cylinder.

elvisish commented 1 year ago

FWIW, @elvisish I think there are a lot of bugs with the cylinder implementation and maybe capsule. All of my getting stuck with my character body issues went away with a cube collision shape. It's not ideal, but it works better than a cylinder.

Thanks, I was using capsule as I want to go over some rocky terrain but... Godot 4.0 still doesn't have stair stepping, hmm.

Saitodepaula commented 1 year ago

It seems to me a strange allocation of resources to see all these updates on new 3D rendering techniques while it looks like the fundamental ability to move around in 3D environments is so unreliable.

Are there plans to re-aquire a dedicated physics contributor or is that not a priority?

I have been using Godot for 3 years now, developing a game, opening some issues, watching development in many areas, and even created open source demos for physics based games. I've never complained about some features in the physics area progressing slowly (or not progressing at all), because I understand that, this being FOSS, that's how it works: if there are capable people wanting to do something, it gets done. If there are no people, nothing happens.

But now that Godot 4 is in beta 3, rendering seems to be evolving well, subjects like double precisions for large worlds getting an exclusive blog post (a subject I would think only a few games would need), wouldn't it be nice to have a roadmap of where physics is intended to go?

I'm not even asking for development in this area, because this is FOSS. But some information about what the project leaders think is the most probable route from now on. Just a few examples: vehicle body, is it going to stay? Joints in general, are they going to be fixed?

qdeanc commented 1 year ago

Just some context:

The Godot team had initially hired a skilled contributor who was seemingly going to fix all of these bugs, but that person ended up accepting a job working on the Rockstar Games physics engine as far as I'm aware.

As far as I know, collision detection (especially continuous collision detection) and stable collision/constraint solvers are especially complicated to program. It's probably hard to find another specialist willing to take on such a challenge remotely and for an affordable rate.

elvisish commented 1 year ago

I think our only hope in the immediate future is for PhysX or Rapier or something to be ported as an extension to provide something extremely stable that, while perhaps not as well integrated or optimised for game work as GP, would at least be fail safe for production work until GP is 100% reliable in all conditions.

timshannon commented 1 year ago

I think our only hope in the immediate future is for PhysX or Rapier or something to be ported ...

I'm keeping my eye on https://github.com/jrouwe/JoltPhysics personally. I'm hoping GDExtension opens up a lot of possibilities.

golddotasksquestions commented 1 year ago

@timshannon @elvisish Regarding JoltPysics there is a discussion regarding Godot integration here: https://github.com/godotengine/godot-proposals/discussions/5161

elvisish commented 1 year ago

Quick reminder that this minimal test project I uploaded a year ago-ish is all you need to test if physics are working or not; if it goes up stairs while crouching or doesn't get stuck behind the stairs, we done: https://github.com/godotengine/godot/issues/58260

alfredbaudisch commented 1 year ago

Should I create bug report for this or is there already something related?

Colliding against ConcaveShapes or ConvexHulls with move_and_slide with a very simple CharacterBody3D controller makes everything sloppy or frozen from 10ms to 2 seconds.

Notice how the game just freezes when hitting the barrel:

https://user-images.githubusercontent.com/248383/208972088-0e9d9e46-06ff-47e8-89c2-bd9d9d061cec.mp4

imagen

Zireael07 commented 1 year ago

@alfredbaudisch How complex is that collider on the barrel? Because that looks like https://github.com/godotengine/godot/issues/48587

alfredbaudisch commented 1 year ago

@alfredbaudisch How complex is that collider on the barrel?

I attached the image of the wireframe, the collider is closer to the mesh structure, it's around 700 vertices, which should not cause this kind of slow-down.

alfredbaudisch commented 1 year ago

@Zireael07 it's indeed related to #48587 and https://github.com/godotengine/godot/issues/66354 and https://github.com/godotengine/godot/issues/57313

ghost commented 1 year ago

Can #67801 be added to the collision detection section

GrauBlitz commented 1 year ago

I am a bit shocked to see a v4 RC1 with all this open issues, meanwhile my Bean Character still get's stuck on the edge of an cube...

Lippanon commented 1 year ago

There will definitely be more focus on bug fixing after beta.

Since this comment, 3 more issues were added to the tracker, 0 were checked as fixed, and a bunch more physics-related were created that aren't in the tracker. There's an ever increasing issue list, with multiple regressions from betas that don't get fixed before new versions get pushed. I appreciate that Godot relies on willing contributors but why are Release Candidates already being put out? Is there a deadline? It feels like Godot 4 is being rushed for no good reason.

akien-mga commented 1 year ago

A lot of physics issues have been fixed in past weeks. This tracker isn't necessarily up to date.

And yes, a lot of issues remain, and they will be fixed after the 4.0 release. We can't block everything waiting for the current WIP physics fixes to be merged. We stabilize what we have now and which is already usable by many, and we'll fix more issues in 4.1.