You're mid-firefight. A soldier clips a rooftop edge and crumples onto a concrete barrier below, one arm dangling, knees bent at exactly the angle a knocked-out person's knees would actually bend. It looks almost choreographed. It wasn't. A physics solver made roughly forty small decisions in under a frame to produce that result, and most of them involved locking joints you will never consciously notice.

That's ragdoll physics: a cascade of constraint decisions happening faster than a blink.

The skeleton is just a list of rules

A ragdoll isn't a floppy doll in any literal sense. It's a rigid-body chain: torso, pelvis, upper arms, forearms, thighs, shins, all connected by joints that each carry a strict definition of how far they're allowed to move. A human elbow gets modeled as a hinge joint with roughly 145 degrees of flexion and almost zero lateral rotation. The solver knows this. Every joint in the skeleton ships with a cone of valid orientations, and the engine enforces those cones every simulation tick, typically at 60Hz or higher in modern titles.

When a character hits flat ground, that constraint system has an easy job. The contact surface is uniform, the pelvis finds a stable position, limbs settle under gravity with minimal conflict between adjacent joints. Clean.

Uneven ground is where it gets interesting.

Picture a character falling onto a rocky hillside tilted at 30 degrees. The pelvis rigid body makes contact first and receives a collision normal pointing partly sideways. The solver now has to propagate forces up and down the skeleton simultaneously, checking whether each joint's current angle violates its allowed range. A knee being pushed laterally by a protruding rock will hit its angular limit almost instantly. The moment it does, the solver locks that joint's lateral axis, making it rigid in that direction while leaving the flexion axis free. Targeted freeze, not a full stop.

This is called constraint clamping, and it runs on every joint every frame until the body comes to rest.

Why some joints lock and others stay loose

The decision isn't random, and it isn't purely about angle limits. Most engines layer in a secondary check: velocity. A joint moving fast toward its limit gets locked sooner than one drifting toward it slowly, because the solver is trying to prevent the kind of violent snapping that reads as broken animation. Havok's constraint solver, used in everything from older Bethesda titles to Halo, handles this with a bias term that applies extra resistance as a joint approaches its boundary. Think of it like a car door that gets stiffer in the last few degrees before it meets the frame.

Contact normals matter too. When collision detection reports that a specific body part is touching a surface, the engine applies a contact constraint at that point. Your character's right shin touches a slope, the left shin hangs free: the right shin's joints get additional positional constraints pinning them to the surface, and the left side stays fully dynamic. Two joints, same skeleton, completely different treatment, decided per-frame based on what is touching what.

A worked scenario worth sitting with. A character drops four meters onto a staircase landing. The right foot catches a step edge. The solver detects contact and locks the ankle's inversion axis immediately, because the surface normal is pushing laterally, but leaves plantarflexion free so the foot can still rock forward naturally. The knee above it stays mostly dynamic, then hits its hyperextension limit within two frames and clamps. The hip rotates freely until the pelvis itself contacts the next step down, at which point a second chain of constraints fires upward through the spine. The whole sequence takes roughly 80 milliseconds of simulation time. The result looks like a person actually falling on stairs, because structurally, it is.

The assumption most people carry is that ragdolls are purely passive, just physics doing its thing with no intervention. That assumption is wrong, and it undersells how much craft goes into making a crumpling body look like a crumpling body rather than a dropped marionette. Most production implementations blend kinematic control back in during the settling phase, a technique called active ragdoll or physics blending. The animator's skeleton and the physics skeleton are literally averaged together frame by frame, with the physics weight ramping from zero to one over the first quarter-second of a fall. A joint might be 60% physics and 40% animation mid-tumble, which is why characters in polished games don't look like wet laundry even when the physics is fully active.

Ever played a game where corpses clip through geometry or fold into impossible origami? That's almost never a joint limit set too loose. That's a contact constraint failing to fire because the surface wasn't registered as a collision surface in the first place. The locking logic worked fine. It just had nothing to lock against.

The joints aren't the fragile part of this system. The geometry data feeding it is.