Ragdolls and Articulated Bodies

Shoot the guard at the top of the staircase and he doesn't play a canned "death" clip — he crumples. His head snaps back, his knees fold, one arm catches a banister, and he tumbles step over step to the bottom, coming to rest in a heap no animator ever posed. Every fall is different because none of it is animation: for those two seconds the character's skeleton has been handed over to a physics simulation. This is the ragdoll, and it is one of the most-seen pieces of real-time physics in all of games.

Underneath it sits a structure that shows up far beyond death animations — in robotics, in cloth, in rope, in every jointed creature: the articulated body. This page pins down what an articulated body is, how a ragdoll turns a rig into one, the two rival ways to solve its motion, and the modern trick — active ragdolls with powered joints — that stops the poor guard from looking quite so dead.

An articulated body is bones plus joints

Two free rigid bodies floating in space have 6 + 6 = 12 degrees of freedom. Pin them with a hinge and only 7 remain: the six of the first bone plus a single relative rotation angle. That removed-DOF count is exactly what a joint constraint is — an equation the solver must keep satisfied every frame. The whole skeleton is a tree of such constraints rooted, conventionally, at the pelvis.

From rig to ragdoll

A character is normally driven by skeletal animation: an artist's keyframes rotate each bone, and the mesh follows. A ragdoll throws a switch. At the moment of death (or a big hit) the game stops reading the animation and instead lets a physics engine own the bones — each becomes a free rigid body under gravity, the joint constraints and angle limits hold the skeleton together, and collisions with the floor, walls and stairs do the rest. The result falls, drapes over ledges and tumbles with a specificity no pre-made clip can match, because it is computed fresh from the exact pose, velocity and geometry at the instant of the switch.

Below is the same articulated skeleton in its two lives: on the left, standing in a keyframed pose; on the right, the moment the animation is handed to physics and the joints give way. Same bones, same joints, same limits — one is being posed, the other simulated.

Two ways to solve the motion

There are two established coordinate systems for simulating an articulated body, and the choice shapes the whole solver.

The trade is familiar: maximal coordinates are easy to bolt onto a general rigid-body engine and mix naturally with collisions, at the cost of possible separation; reduced coordinates guarantee the skeleton stays assembled and scale linearly with chain length, at the cost of a more involved O(n) recursion (the ABA sweeps the tree twice — outward for velocities, inward for a special "articulated" inertia, then outward again for accelerations). Robotics almost always uses Featherstone; game ragdolls have historically leaned maximal, though modern engines offer both.

The naïve way to find the accelerations of an n-link chain is to build and invert its n \times n joint-space inertia matrix — an O(n^3) job. Roy Featherstone's insight (1983) was that a chain has a special structure: the effect of the whole sub-tree hanging off a joint can be summarised by one articulated-body inertia, computed by a single inward recursion. Propagate those inward, then accelerations outward, and you never form the big matrix at all — the cost collapses to O(n), linear in the number of bones. For a long chain (a tail, a snake, a rope of many links) that is the difference between real-time and a slideshow.

Active ragdolls: blending physics with animation

A pure ragdoll is completely limp — no muscle, no intent — so it can only ever collapse. Real bodies resist: a shoved person staggers, throws out an arm, and pushes back upright. To get that, we make the ragdoll active by putting a small motor at each joint that pushes it toward a target pose taken from the ordinary animation. The motor is a PD controller — proportional–derivative — the same idea as a spring with damping:

\tau \;=\; k_p\,\bigl(\theta_{\text{target}} - \theta\bigr) \;-\; k_d\,\dot{\theta}.

The joint applies a torque \tau proportional (gain k_p) to how far its current angle \theta is from the animator's target angle \theta_{\text{target}}, minus a damping term (gain k_d) proportional to the joint's angular velocity \dot{\theta} so it doesn't overshoot and oscillate. Turn the gains up and the character is stiff and strongly driven (barely reacts); turn them down and it goes floppy. Set them in between and you get the sweet spot: a hit character that is knocked off its target, staggers as physics wins locally, then the PD motors pull it back toward the keyframed pose — a get-up transition — and control blends smoothly from physics back to pure animation.

A related trick is the partial ragdoll: physics owns only some bones while the rest keep playing animation. Shoot someone in the arm and just the arm goes ragdoll and flails, recoiling from the impact, while the legs keep running the walk cycle — cheap, controllable, and far less likely to look like a total collapse.

Worked example: a knocked-over character

A guard standing upright takes a shove to the chest. Follow what the articulated body does.

1. The switch. On the hit, the character's twelve bones become physics-driven rigid bodies. Their initial velocities are seeded from the current animation plus the impulse of the shove, so momentum carries over — no sudden pop.

2. Limits protect the anatomy. As he topples and an arm slams the ground, the elbow hinge tries to bend the wrong way. Its angle limit stops it dead at full extension: the elbow can flex toward roughly 150^\circ but is clamped at 0^\circ so it cannot hyperextend. Without that limit the forearm would fold backwards through the upper arm — the instantly-recognisable "broken ragdoll" look.

3. Motors add muscle tone. Because this is an active ragdoll, every joint's PD motor is pulling toward the animator's "stagger" target pose. Take the neck: it has drooped to \theta = 20^\circ but its target is \theta_{\text{target}} = 45^\circ, and it is momentarily still, \dot{\theta} = 0. With stiffness k_p = 8 the motor torque is

\tau \;=\; k_p(\theta_{\text{target}} - \theta) - k_d\dot{\theta} \;=\; 8\,(45^\circ - 20^\circ) - k_d\cdot 0 \;=\; 200\ \text{(in }^\circ\text{-scaled units)},

a torque that lifts the head back toward the pose instead of letting it hang like a corpse. Every joint doing this at once is what reads as a living body fighting the fall.

4. Blend back. Once he settles and the velocities die down, the game ramps the PD gains up and cross-fades from the physics pose to a matched get-up animation, and the guard clambers to his feet — control handed cleanly from physics back to keyframes.

The classic mistake is to ship a pure passive ragdoll — bones, joints, gravity, and nothing else — and expect it to look alive. It won't: with no muscle tone it goes completely limp, reading as unconscious or dead even when the character is meant to be merely staggering. Worse, a limp ragdoll frequently gets stuck in unnatural poses (an arm bent behind the head, a leg through the torso) because nothing pulls it back toward anything sensible.

And if the joints or their limits are ill-tuned — limits missing, constraints too stiff for the timestep, or gains cranked too high — the solver can inject energy instead of removing it and the ragdoll explodes: bones fling apart, spin wildly, and rocket off-screen (a beloved source of game-physics bloopers, but not what you want in the finished game). The fixes are exactly the ingredients above: give every joint anatomically-correct angle limits, add powered joints (PD motors) so the body has muscle tone and lifelike reactions, keep the gains and constraints stable for your timestep, and blend back to animation for recovery rather than leaving the character limp forever.

The same bones-and-joints machinery drives far more than dying enemies. A robot arm is an articulated body whose joints you command rather than let fall. A swinging rope or chain is a long chain of tiny links. A dinosaur's tail, a tentacle, a hanging sign, a set of nunchucks, even secondary motion on a character's ponytail and coat-tails are all articulated-body simulations. Learn to model one jointed skeleton and you can shake, swing and topple almost anything.