Any Good Tutorials For Making A Ragdoll In 3ds Max?

I have been porting many morrowind models for a while, and can create models n’ textures and Collision Boxes and all that fun stuff in 3ds max I am wishing to do some ports of the creatures and characters. Does anyone know any good tutorials for 3ds Max on creating a Ragdoll for Gmod (Source games in general). If you do know of one please post it here, or if it is simple maybe make a step by step for facepunch.

I did a search for a 3ds Max Tutorial on Facepunch for Ragdoll creation, and couldn’t find anything, maybe I am blind If there is a tutorial on here or the question has been asked I must have missed it and hope to be redirected to it here.

Do you know how to create skeletons and rig models to them?

If you know how to do that, pretty much everything else is established in your .QC file.

That really is what I am asking how to do, QC stuff is probably rather easy, I am going to experiment around and try to find my own way and maybe make a tutorial if it works… I’m sure that is how the first person to do it in 3DS Max found out anyway.

I took a shot in the dark, made a model with bones compiled and did some terrible nasty things…

I went with the hunger model instead of the ash ghoul pictured in my original post.

But in the end the Model Viewer failed to view it saying “Error loading model.” and fails to elaborate.

Bringing the model into gmod ,to see if it may elaborate me some problems with it through the command prompt, I read the console after spawning it and it had 2 errors about 8 times each.

First one: prop_effect: backwards mins/maxsp

Second one: prop_dynamic: backwards mins/maxsp

Here is the .qc


$modelname "morrowind\creatures\hunger\m_hunger.mdl"
$cdmaterials "morrowind\creatures\hunger"

$surfaceprop "rock"
$scale .7
$model studio "hunger_ref.smd"
$sequence ragdoll "hunger_idle" act_dieragdoll 1 fps 30.00
$collisionjoints "hunger_ref.smd"
{
$Mass 50.00
$rootbone "bone01"
} 

Anyone got any advice?

I see some MAJOR issues with my GUIStudiostuff… I have no Idea what I could have done to cause it to do this though…???


GUIStudioMDL 2.2/Source - © 2007 Neil 'Jed' Jedrzejewski - http://www.wunderboy.org/

Loaded QC file - "C:\Program Files\Steam\steamapps\greenpool\sourcesdk_content\hl2\modelsrc\m_hunger\m_hunger.qc"

Created command line: "C:\Program Files\Steam\steamapps\greenpool\sourcesdk\bin\ep1\bin\studiomdl.exe" -game "c:\program files\steam\steamapps\greenpool\half-life 2 deathmatch\hl2mp" -notxbox "C:\Program Files\Steam\steamapps\greenpool\sourcesdk_content\hl2\modelsrc\m_hunger\m_hunger.qc"

qdir:    "c:\program files\steam\steamapps\greenpool\sourcesdk_content\hl2\modelsrc\m_hunger\"
gamedir: "c:\program files\steam\steamapps\greenpool\half-life 2 deathmatch\hl2mp\"
g_path:  "m_hunger"
Working on "m_hunger.qc"
SMD MODEL hunger_ref.smd
SMD MODEL hunger_idle.smd
Processing jointed collision model
Collision model completed.
---------------------
writing c:\program files\steam\steamapps\greenpool\half-life 2 deathmatch\hl2mp\models/morrowind\creatures\hunger\m_hunger.mdl:
bones          420 bytes (0)
animations     104 bytes (1 anims) (101 frames) [0:03]
sequences      216 bytes (1 seq) 
ik/pose        164 bytes
eyeballs         0 bytes (0 eyeballs)
flexes           0 bytes (0 flexes)
textures         4 bytes
keyvalues        0 bytes
collision        0 bytes
total          992
---------------------
writing c:\program files\steam\steamapps\greenpool\half-life 2 deathmatch\hl2mp\models/morrowind\creatures\hunger\m_hunger.vvd:
vertices         0 bytes (0 vertices)
tangents         0 bytes (0 vertices)
total           64 bytes
---------------------
Generating optimized mesh "c:\program files\steam\steamapps\greenpool\half-life 2 deathmatch\hl2mp\models/morrowind\creatures\hunger\m_hunger.sw.vtx":
body parts:         8 bytes
models:            20 bytes
model LODs:        12 bytes
meshes:             0 bytes
strip groups:       0 bytes
strips:             0 bytes
verts:              0 bytes
indices:            0 bytes
bone changes:       8 bytes
everything:        72 bytes
---------------------
Generating optimized mesh "c:\program files\steam\steamapps\greenpool\half-life 2 deathmatch\hl2mp\models/morrowind\creatures\hunger\m_hunger.dx80.vtx":
body parts:         8 bytes
models:            20 bytes
model LODs:        12 bytes
meshes:             0 bytes
strip groups:       0 bytes
strips:             0 bytes
verts:              0 bytes
indices:            0 bytes
bone changes:       8 bytes
everything:      0F˜Î}Y@  72 bytes
---------------------
Generating optimized mesh "c:\program files\steam\steamapps\greenpool\half-life 2 deathmatch\hl2mp\models/morrowind\creatures\hunger\m_hunger.dx90.vtx":
body parts:         8 bytes
models:            20 bytes
model LODs:        12 bytes
meshes:             0 bytes
strip groups:       0 bytes
strips:             0 bytes
verts:              0 bytes
indices:            0 bytes
bone changes:       8 bytes
everything:        72 bytes
---------------------
Generating optimized mesh "c:\program files\steam\steamapps\greenpool\half-life 2 deathmatch\hl2mp\models/morrowind\creatures\hunger\m_hunger.xbox.vtx":
body parts:         8 bytes
models:            20 bytes
model LODs:        12 bytes
meshes:             0 bytes
strip groups:       0 bytes
strips:             0 bytes
verts:              0 bytes
indices:            0 bytes
bone changes:       8 bytes
everything:        72 bytes

Completed "m_hunger.qc"


Here’s a sample. It’s from one of the corpse ragdolls in HL2:


$collisionjoints "phymodel.smd" {

	$mass 30.0
	$inertia 10.00
	$damping 0.50
	$rotdamping 1.50
	$rootbone "charple1.pelvis"

	$jointconstrain "charple1.femur_l" x limit -50.00 -15.00 0.20
	$jointconstrain "charple1.femur_l" y limit -35.00 35.00 0.20
	$jointconstrain "charple1.femur_l" z limit -61.00 61.00 0.20

	$jointconstrain "charple1.tibia_l" x limit -1.00 -1.00 0.20
	$jointconstrain "charple1.tibia_l" y limit 0.00 0.00 0.20
	$jointconstrain "charple1.tibia_l" z limit 3.00 106.00 0.20

	$jointconstrain "charple1.femur_r" x limit -15.00 15.00 0.20
	$jointconstrain "charple1.femur_r" y limit -20.00 27.00 0.20
	$jointconstrain "charple1.femur_r" z limit -82.00 30.00 0.20

	$jointconstrain "charple1.tibia_r" x limit 0.00 0.00 0.00
	$jointconstrain "charple1.tibia_r" y limit 0.00 0.00 0.00
	$jointconstrain "charple1.tibia_r" z limit 3.00 93.00 0.20

	$jointconstrain "charple1.tarsus_r" x limit -3.00 3.00 0.20
	$jointconstrain "charple1.tarsus_r" y limit -10.00 10.00 0.20
	$jointconstrain "charple1.tarsus_r" z limit -39.00 30.00 0.20

	$jointconstrain "charple1.lumbar" x limit -15.00 15.00 0.20
	$jointconstrain "charple1.lumbar" y limit -3.00 3.00 0.20
	$jointconstrain "charple1.lumbar" z limit -8.00 8.00 0.20

	$jointconstrain "charple1.spine" x limit -15.00 15.00 0.20
	$jointconstrain "charple1.spine" y limit -10.00 10.00 0.20
	$jointconstrain "charple1.spine" z limit -22.00 22.00 0.20

	$jointconstrain "charple1.humerus_l" x limit -32.00 32.00 0.20
	$jointconstrain "charple1.humerus_l" y limit -43.00 43.00 0.20
	$jointconstrain "charple1.humerus_l" z limit -50.00 50.00 0.20

	$jointconstrain "charple1.radius_l" x limit -91.00 95.00 0.20
	$jointconstrain "charple1.radius_l" y limit 0.00 0.00 0.00
	$jointconstrain "charple1.radius_l" z limit -155.00 -21.00 0.20

	$jointconstrain "charple1.humerus_r" x limit -48.00 48.00 0.20
	$jointconstrain "charple1.humerus_r" y limit -64.00 64.00 0.20
	$jointconstrain "charple1.humerus_r" z limit -53.00 53.00 0.20

	$jointconstrain "charple1.radius_r" x limit -91.00 84.00 0.20
	$jointconstrain "charple1.radius_r" y limit 0.00 0.00 0.00
	$jointconstrain "charple1.radius_r" z limit -153.00 6.00 0.20

	$jointconstrain "charple1.carpus_r" x limit -61.00 48.00 0.20
	$jointconstrain "charple1.carpus_r" y limit -84.00 84.00 0.20
	$jointconstrain "charple1.carpus_r" z limit -66.00 66.00 0.20

	$jointconstrain "charple1.carpus_l" x limit -59.00 59.00 0.20
	$jointconstrain "charple1.carpus_l" y limit -68.00 68.00 0.20
	$jointconstrain "charple1.carpus_l" z limit -48.00 48.00 0.20

	$jointconstrain "charple1.head" x limit -30.00 30.00 0.20
	$jointconstrain "charple1.head" y limit -35.00 35.00 0.20
	$jointconstrain "charple1.head" z limit -19.00 19.00 0.20

	$jointconstrain "charple1.tarsus_l" x limit -3.00 3.00 0.20
	$jointconstrain "charple1.tarsus_l" y limit -10.00 10.00 0.20
	$jointconstrain "charple1.tarsus_l" z limit -39.00 30.00 0.20
}

It might look intimidating, but it’s not so hard. Each moveable bone is listed by $jointconstrain, then its limits are defined by the ‘limit’ parameter. The first two numbers represent the bone’s range of motion from 0 on their respective axis and the third represents friction. Just think of it like this:

limit [Maximum] [Minimum] [Friction]

You can read all about these parameters here.

If you need any more of it explained to you, I will be happy to help.

So since mine is a little less professional and generic. One of then would be…

$jointconstrain “bone01” x limit -50.00 -15.00 0.20
$jointconstrain “bone01” y limit -35.00 35.00 0.20
$jointconstrain “bone01” z limit -61.00 61.00 0.20

This all seems right… Hmm… Thanks for the response by the way.

I seen a method online that talked about using Model Viewer to do this stuff for you… But this seems more exact.

So my qc in the end would look something like this…


$modelname "morrowind\creatures\hunger\m_hunger.mdl"
$cdmaterials "morrowind\creatures\hunger"

$surfaceprop "rock"
$scale .7
$model studio "hunger_ref.smd"
$sequence ragdoll "hunger_idle" act_dieragdoll 1 fps 30.00
$collisionjoints "hunger_ref.smd"
{
$Mass 50.00
$inertia 10.00
$damping 0.50
$rotdamping 1.50
$rootbone "bone01"

$jointconstrain "bone02" x limit -50.00 -15.00 0.20
$jointconstrain "bone02" y limit -35.00 35.00 0.20
$jointconstrain "bone02" z limit -61.00 61.00 0.20

(Followed by all my other bones + limits)

}

That look right?

P.S- Many many thanks for the help.

You’re getting there!

You can use Model Viewer to test and tweak flex limits once you’ve compiled the model, but the numbers are the same as the ones you’ll get in 3DSmax, so don’t worry about it.

It’s also fairly important to make a separate collision model to keep things nice and clean. You’re probably familiar with the concept, but here’s an example of a nicely optimised collision model:

http://img717.imageshack.us/img717/7220/collh.jpg

The collision model must be textured for export, but the texture doesn’t need to be included with the model afterwards.

Am I making collision model also have the bones matched to its vertices like with the original model? If not, what is the next step for this? I am sorry I have so many questions, and am glad you are helping out so much.

It’s no problem.

The collision model will be a separate reference SMD. It will be specified by the first line of your physics block. This part:


$collisionjoints "phymodel.smd"

To build it, import your reference model and start building a simple structure around the moving parts with low-poly segments like the ones in the picture. When you’ve finished building the collision model, flip the faces on the segments, rig them to the skeleton, add them to a smoothing group and delete the original reference model, leaving only the physics model and skeleton.

When all that’s done, you can export it as a reference model with a name like ‘phymodel.smd’.

Very many thanks. I am assuming that this is the last step and the final .qc will be something like this.


$modelname "morrowind\creatures\hunger\m_hunger.mdl"
$cdmaterials "morrowind\creatures\hunger"

$surfaceprop "rock"
$scale .7
$model studio "hunger_ref.smd"
$sequence ragdoll "hunger_idle" act_dieragdoll 1 fps 30.00
$collisionjoints "hunger_phys.smd"
{
$Mass 50.00
$inertia 10.00
$damping 0.50
$rotdamping 1.50
$rootbone "bone01"

$jointconstrain "bone02" x limit -50.00 -15.00 0.20
$jointconstrain "bone02" y limit -35.00 35.00 0.20
$jointconstrain "bone02" z limit -61.00 61.00 0.20

(Followed by all my other bones + limits)

}

I will be very happy if this is the last step.

Yep. If the collision model’s assembled correctly and all of the bones are defined, everything that follows will just involve tweaking and testing.

Thanks for all your help, I will now go and have fun trying to get this to work. If I ever have any more questions on the subject in the near future I will message you.

Good luck!

http://www.suggestafix.com/html/emoticons/wavey.gif

Alright, One last question I guess. I’ve seen this online a few times on google, but it seems that they did not explain how they fixed it very well… When I try to compile I get these errors…

ERROR: Rotation constraint on bone “Bone24” which has no parent!!!
ERROR: Aborted Processing on ‘morrowind\creatures\hunger\m_hunger.mdl’

I know for a fact Bone 24 has a parent… I’m confused on this one… Anyone?

Which bone is Bone24?

I’ve never had this problem but it looks like a hierarchy-related issue. If Bone24 is a thigh bone connecting to the pelvis, then you have to ensure that the pelvis had been designated as the root bone in the *.qc.

You’ll also want to make sure that your pelvis bone is NOT in the list of weighted bones. The pelvis does not have any rotation limits and can not be included in the list.

Bone 24 is a bone inside the head of my rig.

Pelvis bone was in the list of weighted bones though… woops, I fixed this.

When I re-compiled the same error happened though.

I just did a test to try and recreate your error to diagnose it.

It looks like you’ve accidentally given one bone two parents. So, if bone23 is parented to bone24, it’s ALSO parented to bone22. You’ll have to fix it for all of your SMDs. One bone can have as many children as it wants, but it can only have one parent.

It’s an easy mistake to make. That’s why it’s important to always work inwards toward the pelvis when linking bones. Here’s a comparison of good bone hierarchy and problematic bone hierarchy:

http://img88.imageshack.us/img88/2735/hierb.png

Keep me posted! We’ll get you sorted out.

I’ll get back to you on that tomorrow, time for sleep, but I think this is a perfectly reasonable explanation now that I look back at it. And the pics really help visualize the idea.

I’m having problems with my rig, in the end when I thought I was done I went and grabbed my root bone and rotated it and it made only the leg move. Alot of things did weird stuff like this, I am starting to think that my method of rigging is entirely wrong, any simple guidelines on this I should follow in basic???

If only one leg is being moved when the pelvis is rotated then you’ve accidentally parented the pelvis to the thigh instead of the thigh to the pelvis. Unlink the bones and give it another try, moving inward toward the pelvic bone. Here’s a more complete example of proper bone hierarchy:

http://img62.imageshack.us/img62/1396/hieru.png

Just think of the bone song. Foot bone connects to the shin bone, shin bone connects to the thigh bone, thigh bone connects to the pelvic bone. Everything is connected to the pelvic bone in the end!