Ragdoll not coming to rest

Hey.



I’ve implemented the new ragdoll system, and in general, it’s working great! (+1 to the team)

It seems however that the ragdoll isn’t able to come to rest, but continues to twitch and hop.

In addition, just after having fallen down, it usually has a violent spasm and beings to twist, turn and stretch, like a rubber band.

Does this have to do with the weight of the bones in correlation to the body mass? Or is it something else i need to look at.



Cheers,

Rickard

Yes it can be a mass issue. The mass for the ragdoll is not yet very reliable, I have to find a better way.

I won’t go through the detail of the actual calculation but, you can tweak the root mass (setRootMass) the default is 15. then you can get the total mass of the ragdoll by calling getTotalMass.



Also this can be due to too large collision shapes. Shapes of the body are so close that they collide with each other giving those erratics movements tot he model.

To reduce the size of the shapes, you can tweak the weightThreshold. This is the weight of the vertices used to create the shape.

for example setting a weightThreshold of 0.5 will only use the vertices associated with each bone that have a weight above 0.5.

you can set this wheightThreshold in the constructor.



The last thing that can be due to improper joint limit. maybe you can try to tweak them. See setJointLimit() method.

Those limits are literally guessed, just by analyzing the names of the bones, so if you have a specific name convention for your bones, it might fail.

If a joint is not recognized, it’s set to be rigid (all limits set to 0).

1 Like

Thanks for the reply.



It’s looking better now, but i still have some problems with extremities (especially feet) gliding through the ground.

I guess ragdolls are just something that need alot of tweaking before looking good, depending on the game and rig.

Particularly annoying is that the rig has some odd bones called “ForearmTwist”, which i think is used to make the low poly model look good when the arm is rotated in a special way. Even though i don’t add these, they are still very apparent in the ragdoll, “splitting” the lower arm in two.



Here are a few new lexicon entries for the HumanoidRagdollPreset based on the rig of my soldier:



[java]



foot:

entry.addSynonym(“toe”, 20);



lowerarm:

entry.addSynonym(“fore”, 15);



hand:

entry.addSynonym(“finger”, 25);



[/java]

1 Like

ho good thanks for the updates!

I’m having a similar issue with the Ragdoll example. I have the ragdoll showing, but it shakes violently in place. It never falls to the ground, and I’m unable to pick it up. What sort of things should I look for?