Model's lower torso bugging out in ragdoll mode

Hi @sgold

I’m still working on implementing DAC into my game for all of my old NPC models (slowly but surely), and the most recent model I am working on appears to be having some buggy behavior.

When I try to put the model into ragdoll mode in my game, the lower stomach appears to be stretching out and behaving incorrectly.
Here’s a short clip demonstrating the issue:

I did not experience this buggy behavior when I tested this model in the DACWizard immediately after generating the ROMs, it only happens at run-time in my game. (I should also note that the version of DACWizard I’m using is much older from Minie v 4.4.1, and my game is running the latest version of Minie 7.2.0)

Here is the DAC creation code I’m using for this DarkElf model:

public WControl() {
            super();
            LinkConfig config1 = new LinkConfig(1f, MassHeuristic.Density,
                    ShapeHeuristic.VertexHull, new Vector3f(1f, 1f, 1f),
                    CenterHeuristic.Mean);
            super.setConfig("", config1);
            super.link("upperarm_r_013", config1,
                    new RangeOfMotion(0.86f, -1.58f, 1.08f, -0.98f, 1.74f, -0.93f));
            super.link("calf_r_069", config1,
                    new RangeOfMotion(0f, 0f, 0f, 0f, 1.87f, -0.09f));
            super.link("thigh_r_068", config1,
                    new RangeOfMotion(0.28f, -1.02f, 0.71f, -0.14f, 3.08f, 0f));
            super.link("lowerarm_l_038", config1,
                    new RangeOfMotion(0f, 0f, 0f, 0f, 1.5f, -0.53f));
            super.link("lowerarm_r_014", config1,
                    new RangeOfMotion(0f, 0f, 0f, 0f, 2.18f, -0.56f));
            super.link("upperarm_l_037", config1,
                    new RangeOfMotion(1.27f, -0.55f, 0.63f, -0.83f, 1.7f, -0.45f));
            super.link("thigh_l_076", config1,
                    new RangeOfMotion(0.9f, -0.8f, 0.3f, -0.85f, 3.04f, -0.04f));
            super.link("neck_01_07", config1,
                    new RangeOfMotion(0.29f, -0.01f, 0f, 0f, 0.22f, -0.15f));
            super.link("foot_l_078", config1,
                    new RangeOfMotion(0.57f, -0.67f, 0.56f, -0.39f, 0.73f, -0.83f));
            super.link("hand_r_015", config1,
                    new RangeOfMotion(1.41f, -1.46f, 0.76f, -1.29f, 1.35f, -0.96f));
            super.link("spine_02_05", config1,
                    new RangeOfMotion(1.64f, -1.24f, 0.24f, -0.61f, 3.13f, -3.09f));
            super.link("foot_r_070", config1,
                    new RangeOfMotion(0.54f, -0.9f, 0.27f, -0.4f, 1.06f, -0.96f));
            super.link("hand_l_039", config1,
                    new RangeOfMotion(1.5f, -0.39f, 1f, -0.7f, 0.76f, -0.84f));
            super.link("calf_l_077", config1,
                    new RangeOfMotion(0f, 0f, 0f, 0f, 1.92f, -0.21f));
            
            super.setMainBoneName("pelvis_02");
        }

I can also send you a copy of the model without materials for further testing if needed.

Thanks! :slightly_smiling_face:

1 Like

I’d like to investigate this in depth. Please send me a copy of the model without materials, and I’ll try to reproduce the behavior seen in the video clip.

2 Likes

Here’s a link to download the model, let me know if you have any trouble getting it to work. And thanks for the quick reply! :slightly_smiling_face:

1 Like

When I try to put the model into ragdoll mode in my game, the lower stomach appears to be stretching out and behaving incorrectly.

So far I’ve looked at the DarkElf model only in Maud and DacWizard; I haven’t tested it in a custom app. But I’ve come up a few ideas for you to try.

I suspect the stretching is caused to the model’s root bone (“_rootJoint”) being closer to the model’s feet than its pelvis. (Such models are common.) By default, the root bone automatically becomes DAC’s main bone, putting the torso’s center of gravity in the wrong location and causing the torso to tumble in unexpected ways.

In such situations, I find it helpful to override the default main bone in the DAC configuration.

Try adding the following line to WControl():

    super.setMainBone("pelvis_02");

If “pelvis_02” doesn’t produce satisfactory results, other possibilities you should try would include “root_01” and “spine_01_04”.

Unfortunately, DacWizard doesn’t know about setMainBoneName() yet. It’s a tuning you need to add by hand and test outside of DacWizard.

I did not experience this buggy behavior when I tested this model in the DACWizard immediately after generating the ROMs, it only happens at run-time in my game.

I suspect that’s because the DarkElf model doesn’t follow JME’s Y-up convention, so when you tested it in DacWizard, it was lying on its back, making the issue less obvious.

1 Like

I just gave these all a try, but the issue still seems to persist.

I also tried reconfiguring the spinal bone links a few different ways in DACWizard but that didn’t change anything either.

Unfortunately it is also a store bought model, otherwise I would try adjusting this. I’ve used a few other models from the same artist/animator and they’ve all worked perfectly fine with DAC so far, but this dark elf model is the most finicky and has already given me trouble in other ways too, so I’m not surprised its causing yet another issue with DAC here.

1 Like

I’ll experiment some more.

Update: I’m convinced there’s an issue in how Minie calculates the torso position in kinematic mode. No solution yet.

Update #2: I haven’t identified the root cause of the positioning issue, but I did stumble upon a configuration that seems to work for the DarkElf model:

    public WControl() {
        super();
        LinkConfig config1 = new LinkConfig(1f, MassHeuristic.Density,
                ShapeHeuristic.VertexHull, new Vector3f(1f, 1f, 1f),
                CenterHeuristic.Mean);

        super.setConfig("", config1);
        super.setMainBoneName("hips_twist_01_03");

        super.link("spine_01_04", config1,
                new RangeOfMotion(1f, -1f, 1f, -1f, 1f, -1f));
        super.link("spine_02_05", config1,
                new RangeOfMotion(1.64f, -1.24f, 0.24f, -0.61f, 3.13f, -3.09f));
        super.link("neck_01_07", config1,
                new RangeOfMotion(0.29f, -0.01f, 0f, 0f, 0.22f, -0.15f));

        super.link("upperarm_r_013", config1,
                new RangeOfMotion(0.86f, -1.58f, 1.08f, -0.98f, 1.74f, -0.93f));
        super.link("lowerarm_r_014", config1,
                new RangeOfMotion(0f, 0f, 0f, 0f, 2.18f, -0.56f));
        super.link("hand_r_015", config1,
                new RangeOfMotion(1.41f, -1.46f, 0.76f, -1.29f, 1.35f, -0.96f));

        super.link("upperarm_l_037", config1,
                new RangeOfMotion(1.27f, -0.55f, 0.63f, -0.83f, 1.7f, -0.45f));
        super.link("lowerarm_l_038", config1,
                new RangeOfMotion(0f, 0f, 0f, 0f, 1.5f, -0.53f));
        super.link("hand_l_039", config1,
                new RangeOfMotion(1.5f, -0.39f, 1f, -0.7f, 0.76f, -0.84f));

        super.link("thigh_r_068", config1,
                new RangeOfMotion(0.28f, -1.02f, 0.71f, -0.14f, 3.08f, 0f));
        super.link("calf_r_069", config1,
                new RangeOfMotion(0f, 0f, 0f, 0f, 1.87f, -0.09f));
        super.link("foot_r_070", config1,
                new RangeOfMotion(0.54f, -0.9f, 0.27f, -0.4f, 1.06f, -0.96f));

        super.link("thigh_l_076", config1,
                new RangeOfMotion(0.9f, -0.8f, 0.3f, -0.85f, 3.04f, -0.04f));
        super.link("calf_l_077", config1,
                new RangeOfMotion(0f, 0f, 0f, 0f, 1.92f, -0.21f));
        super.link("foot_l_078", config1,
                new RangeOfMotion(0.57f, -0.67f, 0.56f, -0.39f, 0.73f, -0.83f));
    }

The ragdoll could certainly benefit from further tuning, but these changes should jump-start the process for you.

Essentially, I setMainBoneName("hips_twist_01_03") and linked “spine_01_04”. The remaining changes were mostly re-ordering the link() invocations to help me understand the code better.

Please let me know whether or not this workaround works for you.

1 Like

I used the code you just provided and the model appears to be working correctly now! Thanks for your help troubleshooting tis issue, it is always greatly appreciated! :grinning:

I will be sure to report back if I notice any further issues with the dark elf model or if I have any similar issues with the rest of the NPC modes I’ll be implementing DACs for soon.

1 Like