godotengine / godot

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

Ragdoll / Physical Bones issue #19002

Open twilson90 opened 6 years ago

twilson90 commented 6 years ago

As described in #11973 I've attached an example project below: Ragdoll Test.zip

Example contains 1 scene with 2 skeletons. First example - a simple worm skeleton that contorts wildly. Second Example - Robot from 3D platformer, by default I've set the physics simulation to just his arms. They don't stop moving, as if he's very excited about something. If you hit Enter (ui_accept) the rest of his bones are activated, and he crumples to the floor in quite an unnatural way, not like in the example posted by Andrea (https://godotengine.org/article/godot-ragdoll-system)

AndreaCatania commented 6 years ago

For some reason the project that you gave me has some broken dependency and can't be played.

This is your project with a new scene check the AndreaTest Directory: RagdollTest.zip

phybon

As you can see it has some vibration, and the joints constraints doesn't display correctly in the editor anymore. I'll let you know when I fix it

Grumoth commented 6 years ago

I also noticed the joint constraint not showing in the editor. The workaround is to close and open again that scene (This thing is a common problem around Godot)

oisincar commented 6 years ago

I've been messing around with ragdolls a bit recently, it seems like if there's too many bones in a chain the mesh will move erratically even though the bones are motionless & in the correct locations. Did you find any solution to this or was it fixed by #19193, possibly?

jotson commented 5 years ago

Seems related to https://github.com/godotengine/godot/issues/18443. Is anyone else seeing this issue where bones at the end of a chain are missing?

twilson90 commented 5 years ago

This is still an issue for me. I can't create a physical skeleton that doesn't vibrate wildly like the above examples.

AndreaCatania commented 5 years ago

Recently I've updated the 6DOF joint to the last bullet 6DOF joint implementation. It works really well and I really advice to use it

twilson90 commented 5 years ago

Thanks for letting me know! I'll check it out.

and3rson commented 5 years ago

Awesome! Is it by any chance possible to control velocity of individual physical bones now?

AndreaCatania commented 5 years ago

The physical bone extend the physical body so you can do everything you can do with a rigid body

oisincar commented 5 years ago

@AndreaCatania I was wondering about this actually, because PhysicalBone extends PhysicsBody which doesn't do much on it's own. Could it instead extend RigidBody? I ended up adding (read: copy-pasting) a lot of the RigidBody functions to PhysicalBone to control velocity/ add impulses etc on my own branch. I couldn't manage to get it working by changing what it inherits though, I can't remember why.

mysticfall commented 5 years ago

I suspect what he meant could be PhysicalBone will support every operations that RigidBody does once #25564 gets fixed.

For now, it does not expose most of the useful methods that RigidBody has.

oisincar commented 5 years ago

Ah, I'd missed that thread. That's great news if it goes through.

AndreaCatania commented 5 years ago

@oisincar This is possible to do and the most problematic function to handle is "_direct_state_changed" that has some differences between Rigids and Bones.

I can do it, but for the 3.2 version since this will involve in some changes that can't be committed in the current 3.1 milestone stage

AndreaCatania commented 5 years ago

This PR fix the problem: #28909

In this gif you can see your work with some springs and react on a rigid body

ezgif com-video-to-gif(1)

KoBeWi commented 3 years ago

Can anyone still reproduce this bug in Godot 3.2.3 or any later release? If yes, please provide a GDScript reproduction project (the attached one seems to use C#)

pouleyKetchoupp commented 3 years ago

I've checked in 3.2.3 stable, ragdoll behavior looks ok now, so closing.

For the worm skeleton, contortions can be fixed by tweaking collision masks to disable collision between the different physical bones, since they overlap with each other.

rcorre commented 2 years ago

I converted the OP's project to gdscript and cleaned some things up: example.zip

The behavior still seems pretty erratic:

https://user-images.githubusercontent.com/2496231/150525955-1bb77134-2ba0-493c-8a9f-356b1ab15477.mp4

Calinou commented 2 years ago

I can confirm this on 3.x 3e7e70138:

https://user-images.githubusercontent.com/180032/150527970-dda0e207-20f6-4805-a158-a9c67d4bcd2a.mp4

This occurs every time the project is run, (mostly) in a similar manner.

dedm0zaj commented 1 year ago

I looked Godot 4.0. Physical bones contain as little functionality as in Godot 3. Why can't RigidBody and physical bones be combined into one node (like Unity)? Or inherit physical bones from RigidBody. Different nodes cause problems. For example, support for the same functionality.