Has anyone cracked the ragdoll code?


8baller

 

Posted

While I was working on a demo recently, I tried changing the model used on a (stationary) ragdolled NPC, but I ended up with garbage.

Has anyone figured out the ragdoll parameters and how they work?


Arc 55669 - Tales of the PPD: One Hell of a Deal (video trailer)
Arc 64511 - The Wrecking Ball
Arc 1745 - The Trouble With Trimbles
Arc 302901 - HappyCorpse

 

Posted

Okay, a little piece of the puzzle here:

0 353 NEW "Vortex Cor Leonis Archon"
0 353 NPC Council_Vortex_Black_02
0 353 POS -6502.84375 80.671875 404.03125
0 353 PYR 0 0 0
0 353 MOV POSTDEATH2 0
0 353 EntRagdoll 11 273933178 273932168 0000017600000200000001FF000001D00000021D00000208
000001C100000200000001FF0000025C0000017600000200
000001FF000001D7000001FF000002400000012D0000011E
000001F6000002540000020100000294000002AC0000027E
000001E70000023A00000221000002170000023D000001E8
0000016D0000026F000002C0

EntRagdoll takes four parameters. Three numbers, and a long string.

The first number, I'm pretty sure is the number of bones in the skeleton. Why? Because if we assume each bone takes Pitch, Yaw, and Roll, and that this model has 11 bones, then the long string with hex values should have 33 values. And it does!

1. 00000176
2. 00000200
3. 000001FF
4. 000001D0
5. 0000021D
6. 00000208
7. 000001C1
8. 00000200
9. 000001FF
10. 0000025C
11. 00000176
12. 00000200
13. 000001FF
14. 000001D7
15. 000001FF
16. 00000240
17. 0000012D
18. 0000011E
19. 000001F6
20. 00000254
21. 00000201
22. 00000294
23. 000002AC
24. 0000027E
25. 000001E7
26. 0000023A
27. 00000221
28. 00000217
29. 0000023D
30. 000001E8
31. 0000016D
32. 0000026F
33. 000002C0

What about the second and third numbers? Not a clue. Probably a time index; the numbers increase with each line, and substracting the second number from the first returns a value around 1000, which would suggest ragdoll information being recorded every second. But that's really just a guess.


www.SaveCOH.com: Calls to Action and Events Calendar
This is what 3700 heroes in a single zone looks like.
Thanks to @EnsonsDeath for the GVE code that made me VIP again!

 

Posted

Yep, that's pretty much what I came up with, Leandro. Neck, 2 shoulders, 2 elbows, 2 knees, 2 leg/hip, torso/hip, and mid torso joints. (I'm looking at screenshots and I can't tell for sure if there are one or two joints for the back.) But wouldn't it have to be joints instead of bones? If it were bones, it would be possible to put numbers in for bone orientation that would make it so they didn't connect to the other bones, which would be quite a sight. (Oooo, I'll definitely be using the Dr. Leo model to test that possibility out! )

Units are unknown. I'm looking at a number now that is 2BF and I think I have seen them go over 300. That means that, in decimal, the numbers are ranging from 0 to somewhere around 780. Wha? What measurement of angles goes up that high?? It makes me wonder if these are Pitch/Yaw/Roll numbers or if they are something else.

Oh wait! Maybe they aren't angles, maybe they are angular velocity? Radians per millisecond or something like that. Then you can get a smooth motion instead of the ragdoll popping from one position to another.

The 2nd and 3rd numbers are pretty mysterious. The 2nd is always bigger than the 3rd and both numbers always increase. Also, if you look at some commands for the same object, the 3rd number of one command is lower than the 2nd number of the previous command.

13 EntRagdoll 11 1585088 1584214
13 EntRagdoll 11 1585849 1584970
13 EntRagdoll 11 1586540 1585676

But if these are timings, how are they used? I can see how they might want to send ragdoll commands that overlap so you still get ragdoll actions even if you get a bit of lag. Other commands happen when they show up in the demo, though, why do these need a start time? Shouldn't there be just one number for the duration?

Also, what units are these in? I'm looking at a demo right now that I started in the middle of a fight. There's an entragdoll command less than one second after it starts and the numbers are 417695 and 416609! The units would have to be nanoseconds to get numbers that big so soon!

You'll also see a few ragdolls with 0 instead of 11 for the first number. I think those are "cancel ragdoll" commands to put the model back in normal mode.


 

Posted

Here's another piece of the puzzle - I pulled out the ragdoll data from all the recorded demos I had and got the minimum and maximum values for each segment;

1 133-599
2 346-653
3 362-615
4 272-744
5 310-791
6 313-730
7 84-596
8 352-686
9 393-716
10 323-765
11 322-786
12 281-703
13 406-685
14 104-673
15 445-596
16 239-851
17 121-577
18 217-801
19 294-796
20 250-915
21 242-763
22 238-802
23 450-898
24 227-792
25 238-763
26 281-888
27 300-758
28 217-707
29 304-751
30 270-673
31 87-968
32 18-1012
33 79-988


 

Posted

Some more info - the hexes are definitely limb orientation. Didn't get around to looking into the decimals, but I think I've got the joints indexed.

1-3: Right lower leg
4-6: Right upper leg
7-9: Left lower leg
10-12: Left upper leg
13-15: Left forearm
16-18: Left upper arm
19-21: Right forearm
22-24: Right upper arm
25-27: Head
28-30: Torso
31-33: Ragdoll as a whole


 

Posted

[ QUOTE ]
I'm looking at a demo right now that I started in the middle of a fight. There's an entragdoll command less than one second after it starts and the numbers are 417695 and 416609! The units would have to be nanoseconds to get numbers that big so soon!

[/ QUOTE ]

The number could be milliseconds counting from midnight, either server time or local time, or the uptime of the server. They don't seem to match my own system's uptime nor my local time.


www.SaveCOH.com: Calls to Action and Events Calendar
This is what 3700 heroes in a single zone looks like.
Thanks to @EnsonsDeath for the GVE code that made me VIP again!

 

Posted

Well, the screenies wouldn't show much to look at, but here's a demofile demonstrating the movement of all limbs along each axis.


 

Posted

WOOT!

Oh, wait, drat - you still won't be able to create a videocamera emote for me...

Michelle
aka
Samuraiko/Dark_Respite


Dark_Respite's Farewell Video: "One Last Day"
THE COURSE OF SUPERHERO ROMANCE CONTINUES!
Book I: A Tale of Nerd Flirting! ~*~ Book II: Courtship and Crime Fighting - Chap Nine live!
MA Arcs - 3430: Hell Hath No Fury / 3515: Positron Gets Some / 6600: Dyne of the Times / 351572: For All the Wrong Reasons
378944: Too Clever by Half / 459581: Kill or Cure / 551680: Clerical Errors (NEW!)

 

Posted

Well, if there's a video camera model somewhere in the game, you could theoretically do the motions of the ragdoll and move the model around... though that's a very big "if" and "theoretically", not to mention it would take ridiculous amounts of positional fine-tuning.


 

Posted

By the way, from what I can tell, the "range" is infinite... you can input any number and the joint will bend. The bigger question is which values represent the angles which human joints can conceivably bend at, and more importantly, how do those values translate into angles, and relative to what? In any case, I'll do a bit more testing with Ms. Liberty, try to get some reference data... maybe I'll get lucky.


 

Posted

Quinch, the range is 0-1023, with 511 being the "neutral" location, and 255 = 90°. All joints at 511 is this default pose; set the leg to 255 (90°) and you get this; set the upper leg to 255 and you get this, set BOTH to 255 and you get this. I'm trying to find some software on the web that allows the animation of skeletons and exporting each joint data, hopefully I can find one that's not expensive and allows the range of values for the angles to be defined.


www.SaveCOH.com: Calls to Action and Events Calendar
This is what 3700 heroes in a single zone looks like.
Thanks to @EnsonsDeath for the GVE code that made me VIP again!

 

Posted

Hey, good catch. I was futzing around trying to figure out why the ragdoll looks *almost* straight at 500 and looking up trigonometry values. Shoulda occurred to me it was a binary value. Anyway, good catch... now all we need to figure out exactly is how the first two numbers tie in.


 

Posted

Okay, for easier reference, here's an annotated screenshot showing the location of the 10 joints (remember the 11th is the model itself).

Something to keep in mind: don't assume that something that works in one side of the model will work in the other. If you change joint 8 (right forearm) to 767, it rotates clockwise pointing down; but if you change joint 6 (left forearm) to 767 rotates it clockwise... pointing up. You need the value 255 so the left forearm points down.

I'll try to create a program to manipulate those joints easier, but no promises. I really, really hate trigonometry.


www.SaveCOH.com: Calls to Action and Events Calendar
This is what 3700 heroes in a single zone looks like.
Thanks to @EnsonsDeath for the GVE code that made me VIP again!

 

Posted

Well so much for my angular velocity idea! Nice job folks!


 

Posted

[ QUOTE ]
Quinch, the range is 0-1023, with 511 being the "neutral" location, and 255 = 90°. All joints at 511 is this default pose; set the leg to 255 (90°) and you get this; set the upper leg to 255 and you get this, set BOTH to 255 and you get this. I'm trying to find some software on the web that allows the animation of skeletons and exporting each joint data, hopefully I can find one that's not expensive and allows the range of values for the angles to be defined.

[/ QUOTE ]

I am trying to wrap my head around this so I have a few questions based on what I've read. So.. in the following example below, the first 3 set of 8 numbers are for the right knee and is PYR? then sets 4-6 are the right hip, etc... OR is the first 11 sets of numbers ALL Pitch then the next 12-23 are Yaw and then 24-33 Roll?

00000085 is right knee Pitch?
000001FF is right knee Yaw?
000001FF is right knee Roll?

if that is correct, then what are A, B, C,D, E & F values for and how did you arrive at putting in 511 for the default pose you posted? where do you insert the 511 values? Thanks!


EntRagdoll 11 7000 7020 00000085000001FF000001FF0000021B00000201000001DF000001BD
00000200000001FF000002250000020200000224000001FF00 0001A5
000001FF0000025B000001C500000192000002010000027200 0001FF
000001FD00000297000002300000020C000002110000021B00 0001EA
000001F8000001F2000002260000020500000203


-Listen to my Light!
-MA #1065 "Star Struck"

 

Posted

That's because the values are shown in the hexadecimal number system, rather than the decimal one. Hexadecimal uses sixteen digits {0 through 9 followed by A through F}, rather than just ten we use in everyday life, so the numbers Leandro showed are simply decimal values translated into hexadecimal.


 

Posted

OMG - Leo, you da man!


 

Posted

[ QUOTE ]
This is what I got so far: COH Poser v0.10

I'm going to need a lot of aspirin before this is done...

[/ QUOTE ]

*grin* I'll send you some!

Michelle
aka
Samuraiko/Dark_Respite


Dark_Respite's Farewell Video: "One Last Day"
THE COURSE OF SUPERHERO ROMANCE CONTINUES!
Book I: A Tale of Nerd Flirting! ~*~ Book II: Courtship and Crime Fighting - Chap Nine live!
MA Arcs - 3430: Hell Hath No Fury / 3515: Positron Gets Some / 6600: Dyne of the Times / 351572: For All the Wrong Reasons
378944: Too Clever by Half / 459581: Kill or Cure / 551680: Clerical Errors (NEW!)

 

Posted

Why arent you working for NCsoft?