Imagine a game character sprinting across broken terrain, cutting sideways the instant you flick the
stick, planting a foot on a ledge and pushing off — all reading as one continuous, weighty
performance. For a decade the state of the art behind that was
This page is about the shift that answered the obvious question: what if a neural network could
replace the database? Instead of storing every pose and looking one up, train a net to map
(current character state + where the player wants to go) straight to the
next pose — learning the whole motion library into a handful of megabytes of weights.
We'll trace the landmark models (PFNN, Mode-Adaptive Networks, Learned Motion Matching), see why the
naive version collapses into blurry mush, and set up the jump to
Motion matching is beautifully simple. You hold a big flat pile of mocap frames. Each frame is tagged with a feature vector — the character's current pose and velocity, plus the near-future trajectory that actually followed it in the capture. At runtime you build a desired feature vector from the player's input (where they're steering) and the current pose, and you find the stored frame whose feature vector is nearest:
Play forward from
There's a subtler cost too: the system can only ever reproduce poses it recorded. It never invents an in-between it wasn't given; it can only pick and blend among clips it already owns.
The core idea is to treat the controller as a function and approximate it with a
network. Feed in the character's current state and the desired trajectory/goal; read out the next
pose. Written abstractly, with network weights
where
The payoffs are exactly the mirror image of motion matching's costs — tiny memory (a few MB of weights instead of a giant pose bank), a fixed, predictable cost per frame (one forward pass, no search over a growing set), and generalisation: a network can interpolate smoothly between clips it never literally saw, filling in motions the capture never recorded. But it doesn't come for free — you pay up front in training data and training time, and a badly-posed network fails in a spectacular way we'll meet in the "Watch out!" box.
The breakthrough that made neural locomotion crisp was Holden, Komura and Saito's
Phase-Functioned Neural Network (2017). Its insight is that locomotion is
fundamentally cyclic: the left foot strikes, rolls, lifts; the right foot strikes, rolls,
lifts. Encode where you are in that cycle as a single phase variable
Rather than one fixed set of weights trying to cover both "foot planting" and "foot swinging" at once,
PFNN stores a small number of control weight sets spaced around the phase circle and
smoothly interpolates between them as
Why does the phase input matter so much? Because it tells the network which part of the stride it is in, it resolves the ambiguity that would otherwise make the net average incompatible poses together. That single scalar is the difference between crisp footfalls and the blurry damped mush of naive regression — the failure the "Watch out!" below dissects.
A single phase variable is perfect for a biped walking and running, but it strains on richer motion — a quadruped has multiple limbs on different, coupled rhythms (walk, trot, canter, gallop), and there's no one clean foot cycle to key everything off. Zhang, Starke, Komura and Yang's Mode-Adaptive Neural Networks (2018) generalised the idea: instead of a hand-defined phase driving the blend, a small gating network looks at the state and produces blending coefficients that mix a bank of expert weight sets:
The gating net learns when to lean on which expert — effectively discovering its own phases and gait modes rather than being told them. This mixture-of-experts idea is the backbone of much of the modern neural-character work (later systems layer local phases per limb on top of it), and it's the general answer to "one cyclic clock isn't enough."
There's a third path that's especially loved in games because it preserves the exact feel and controllability of motion matching while shedding its memory cost. Holden and colleagues' Learned Motion Matching (2020) replaces the giant pose database with a set of small networks trained to imitate what motion matching would have done:
Together these reproduce motion-matching-quality output at a fraction of the memory (databases shrink from hundreds of MB to a few MB of weights) and with a bounded per-frame cost — no search over a growing set. Crucially it keeps the motion-matching authoring workflow: you still think in terms of a feature database and trajectories, you just no longer ship the database.
Put numbers on the trade-off. Take a locomotion set captured at
…and that's before the feature index and blend metadata a real system also carries. A PFNN trained on
the same capture might have on the order of a few hundred thousand parameters per control
weight set; even generously counted, the shipped weights land in the low single-digit
megabytes — call it a
And the phase input is what keeps that interpolation honest. Without it, when several plausible next poses exist (foot could be landing or lifting), the network — trained to minimise average error — hedges by predicting the average of them, which is a limp, foot-sliding non-pose. The phase tells it which of those futures applies, so it commits to a crisp one.
A tempting reflex: if regression to the mean blurs the motion, throw a bigger network at it. It doesn't help — and understanding why is the whole point. The blur isn't a capacity problem; it's a problem specification problem. If the input state genuinely maps to several different valid next poses, then the mathematically optimal single-output predictor is their mean, no matter how many parameters it has. A bigger net just fits that mean more precisely. The fix is never "more capacity" — it's to remove the ambiguity (add a phase or gait input so the mapping becomes one-to-one), or to model the distribution instead of a point (mixture density, or a generative model that samples a future rather than averaging). That's exactly the thread that leads into the next lesson on generative motion models.
The single most common way a first neural-motion attempt fails: build a plain network that takes the current state and directly regresses the next pose, train it with a mean-squared-error loss, and watch the output turn into blurry, damped, foot-sliding mush — motion that looks like it's wading through treacle, with no crisp footfalls.
The cause is multimodality. From a given state, many futures are plausible (the character could plant the left foot, or the right, or keep gliding). MSE training pushes the network toward the value that minimises average squared error over all those futures — which is their average. The average of a foot-down pose and a foot-up pose is a foot hovering mid-air: physically wrong, visually dead. The cures are exactly the models on this page and the next:
If your learned character walks like it's underwater, suspect mean-collapse before you suspect a bug.