Jump to content
The Dark Mod Forums

Ragdolls and their values


Xarg

Recommended Posts

I've got a couple of ragdolls down, have moved them ingame and have used the command to save ragdolls. What I've been left with is each body part having 6 values.

 

example

body rlowarm
1531.85131836 375.40328979 -427.10940552 76.62121582 -171.4691925 178.06263733

 

What I've been able to work out, is the first 3 numbers are the x, y and z coordinates of the body part on the grid. What I don't get, is what the second three are. Well, more precisely, I do and don't. I tried adjustments on all 3 (on rloleg) and managed to, with value 4, get the leg to move to side. So this tells me values 4 5 6 are a second set of x y z coordinates, but I don't understand what the numbers mean. They're too large to be grid units, and they don't seem to be angles.

 

I originally set out to make a ragdoll with a broken leg, but have failed to achieve anything useful other than finding out what the first 3 (definitely) and the second 3 (I think?) values of the 6 values given when saving ragdolls mean.

 

(On that note, does some wonderful gentleman and scholar feel like adding info about the 6 values to the wiki article on ragdolls/dead bodies?)

  • Like 1

Intel Sandy Bridge i7 2600K @ 3.4ghz stock clocks
8gb Kingston 1600mhz CL8 XMP RAM stock frequency
Sapphire Radeon HD7870 2GB FLeX GHz Edition @ stock @ 1920x1080

Link to comment
Share on other sites

I'd guess those 6 numbers are the same 6 used in md5anim files (and in the game's animation code) to hold the position and orientation of a joint. Yes the first 3 are x,y,z position, relative to the parent joint's position and orientation. The next three represent the angle/orientation but they're not simple angles they're quaternions, specifically the x,y,z components of the joint's orientation quaternion. Quaternions have a w component too but that's not stored as it can be calculated from the other 3. Good luck calculating the quaternion you need. I've tried reading the wikipedia article to get a grip on it but I need to try again. It's a bit indigestible.

Link to comment
Share on other sites

Couldn't be easy, huh. Thanks for that SteveL, I think I'll pass on the broken leg for now, because the second half of what you said was a whole bag of nope. I'm also guessing I won't be able to resave the ragdolls, as the limbs only seem to move in normal movement patterns, disallowing you from making a broken leg from a ragdoll because the knee doesn't bend that way. Is there any way to enter that w value you were talking about and just hack away at it until you get the result you want?

Intel Sandy Bridge i7 2600K @ 3.4ghz stock clocks
8gb Kingston 1600mhz CL8 XMP RAM stock frequency
Sapphire Radeon HD7870 2GB FLeX GHz Edition @ stock @ 1920x1080

Link to comment
Share on other sites

Yeah I'm sharing the same hopeless feeling after glancing at the wiki article. But it might not be necessary to work out the theory. Maybe there's a simple quaternion converter or something on the web. I haven't checked as I'm not at a computer, I'm out and browsing on my phone. You basically want to know what a 50 degree or whatever rotation on a single axis is when translated to a quaternion. I say single axis because the ai's starting pose will have the leg straight. I don't know which axis but try all three. If you can find a converter or formula it should give you 4 numbers: w,x,y,z. You'd ignore the w and use the other three.

Falling that, maybe we have a mathematician around who could explain what do!

Link to comment
Share on other sites

Googled for a quaternion converter, got a few. I'm assuming the 3 values given are Euler (whatever that is) values? Let's see what happens when I plug them in, and see what the results are.

 

Plugging in 76, -171, 178 gave me 0.61, 0.05, -0.78, 0.03.

 

I'll try plugging in x, y and z, ignoring w.

 

After a few attempts manipulating values for 4 and 5, all I seemed to manage to do was move the arm up and down a bit.. I'll try manipulating values 1 and 2, see if that does anything.

 

edit

 

After attempting to manipulate those values, I'm either doing it wrong, or it's "not allowed" or the physics are doing something to undo it, the arm didn't seem to have moved from previous, so I'm at a loss here.

 

edit2

 

On a hunch, I tried adding 180 degrees, and tried manipulating the other x and y again, it's almost like you just can't do it, even attempting to "break" the limb with ingame manipulation just drags the torso instead of the arm moving outside of what seems like a predetermined limit of flexibility.

Edited by Xarg

Intel Sandy Bridge i7 2600K @ 3.4ghz stock clocks
8gb Kingston 1600mhz CL8 XMP RAM stock frequency
Sapphire Radeon HD7870 2GB FLeX GHz Edition @ stock @ 1920x1080

Link to comment
Share on other sites

Back home now and I took a look at the code that loads ragdolls. Apologies, it turns out these numbers are *not* the same 6 numbers that are used in animation files and code. Sorry about that.

 

The 6 numbers are world coordinates. x,y,z grid position followed by pitch, yaw, and roll (= world rotation on y, z, x axes). These are world coordinates, i.e. independent of the joint heirarchy so it works completely differently from animations. In an animation, each set of numbers would be relative to the parent joint's numbers. But these numbers are absolute.

 

I just tried it myself, setting various joints to random rotations like 0,0,0 or 100,100,100, but I can't get any unnatural poses either. The only effect I can produce is a "thud" noise as the map starts, suggesting that the ragdoll is settling by normal physics before I get a chance to see it, like you thought.

Link to comment
Share on other sites

Aha! Add the spawnarg "nodrop" "1" to your ragdoll. That stops the physics kicking in. I finally have a ragdoll with twisted joints :)

 

If the player picks hiim up to move him though, the joints snap back to natural positions.

Link to comment
Share on other sites

Awesome! Once you added nodrop 1, which of the 6 values did you edit to get the unnatural limb position? Your research also indicates the ragdolls should be ungrab/frobable to prevent the limbs snapping back into position upon interaction, which I guess limits this to decorative purposes, but still a good find.

Edited by Xarg

Intel Sandy Bridge i7 2600K @ 3.4ghz stock clocks
8gb Kingston 1600mhz CL8 XMP RAM stock frequency
Sapphire Radeon HD7870 2GB FLeX GHz Edition @ stock @ 1920x1080

Link to comment
Share on other sites

I was messing with the angle ones only, so the second pair of 3 numbers. I had the various lower arm and lower leg angles set to random combos trying to see an effect.

It should be easy to home in on the right numbers for your scene now that the ragdoll's not moving back before you see it

Link to comment
Share on other sites

Awesome, I'll start altering some values and see what I come up with.

 

Ok, halfway there. Experimenting with other values has lead me to another discovery. Attempting a broken neck, do NOT use

 

body head

 

That rotates the neck, the shoulders and the upper quarter or so of the torso, resulting in a disembodied head sitting where it was pre-edit, and a horrific spinal break and twist showing a blank neck hole facing the ceiling. For a broken neck, it seems like I'll need to add a spawnarg to move the head specifically. Once again, not documented on the wiki. By the time we're done here, there should be quite an addition ready for the Dead Bodies page on the wiki.

Edited by Xarg
  • Like 2

Intel Sandy Bridge i7 2600K @ 3.4ghz stock clocks
8gb Kingston 1600mhz CL8 XMP RAM stock frequency
Sapphire Radeon HD7870 2GB FLeX GHz Edition @ stock @ 1920x1080

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
×
×
  • Create New...