Animating monsters from retargeted clips with manners
Library motion clips replace typed bone angles on six bodies, with manners laid over them as data. Every walking monster now stands on the new orc body.
The bodies move from motion-capture clips now, and the game’s monsters stand on them. Each monster has a manner (plain, tired, brute or nervous) and an idle, so eight walkers look like eight different things. The old orc model is deleted.
It isn’t finished. Monsters move faster than the bodies’ walk clips, so their feet slide. I’ll get to that at the end.
Why were the bodies so stiff?
I said the bodies were “very awkward and stiff, they’re certainly shaped correctly, but they’re not great.” The idle was the bind pose with a few degrees of breathing, and every clip was a handful of typed bone angles.
I tried two quick experiments with the pipeline’s checks set aside. One was a hand-made standing pose and a walk with placed feet. The other was five clips from a CC0 animation library, retargeted onto the game’s skeleton. I liked the library a lot and some of the hand-made one, so I asked for a blend: library clips as the base, with hand edits laid over them as data.
How do the clips and manners work?
A retarget table maps the library’s bones onto the game’s. On top of a base clip goes a manner, which is a row of about 20 numbers in a layers table. One library walk under three manners gives three walks: tired is slumped with short steps and dead arms, brute is wide, heavy and slow, nervous is crouched and quick. A manner has its own attack numbers too (level, carry, turn, reach, wind, recover, sag, kick, arms), and the blow stays on the game’s strike frames 15 to 18 whatever the manner. I asked whether the three still look like three characters when they fight. They do, and I’m happy with how they look.
There are five idles, handed out by kind of character. A slouch is for people at rest, a ready stance for hostiles that have seen the party, shifting foot to foot for guards and traders, looking about for sentries, and fresh from the vat for new subjects and husks. Twelve of the fifteen attacks are written by hand, because the library only has a sword attack, two punches, a pistol shot and a left-handed cast.
Why did the skeleton go from 19 bones to 24?
A head turn on one bone turns the whole 36 degrees at once. The new bodies have a neck bone that takes half of every turn (18 of 36 degrees at the far turn of looking about) and a forearm twist bone per side that takes half of the hand’s roll. Each hand also has a finger-curl bone, and there are two fists, built shut and opened by the curl. I added a second weapon socket on the left hand for two-handed weapons, and the bow moved there with a string that draws by a shape key. Heads are cut just under the jaw so the body owns the neck.
The shoulder lump turned out to be the masses, not the weights. The yoke stopped short and the deltoid was a ball on the joint, so I switched to a round shoulder cap.
Each clip is made from one set of rows with the human’s lengths, and every body takes its share by its leg, arm and fist lengths. The lizard’s tail moves as data, and the jaw opens in attack, hit and death.
How do clips get checked?
The pipeline got a 20th step, motion. It bakes a body’s clips from the tables and then measures the exported file. Soles must be within 10 mm under or 20 mm off the floor, and a collarbone under 20 degrees standing (35 in a clip that falls). The blow has to land on the right frames. It only applies to bodies with the 24-bone contract.
A clip file remade after a body is built fails that body’s step on purpose, so clips get settled before bodies are built. The step also caught a real bug. The glTF exporter drops any track that never moves, and a fist held shut then opened by 15 to 54 degrees. The bake now sets keep_still, and the validator’s “no unused tracks” rule only flags tracks that sit at the bone’s rest.
Six bodies and eight heads went through it and are installed as trials. Each body has 19 clips (the dwarf 17) and is 0.97 to 1.11 MB with textures, against 0.56 MB with typed keys. I also built four new weapon kinds, a handgun, great sword, great axe and maul, 60 models in all, installed as trials.
Putting the monsters on the new body
MonsterModel now puts the orc frame and the orc’s head on every walking monster, every thrall and every fallen body. Numbers like height, stride and socket places are read from the body’s manifest at run time instead of being typed. A monster profile has four fields: frame, manner, idle and attack. Every attack is the claw swipe for now, and a monster plays its own idle until it knows about the party, then switches to the ready stance. Playback of a walk is capped at 2.2 times its made speed.
The manners I picked: Gristle Spitter nervous and looking about, Rind Stalker plain and ready, Bile Seer tired and looking about, Marrow Mender tired and shifting, Slab Warden brute and ready, Suet Auditor plain and shifting, Spoiled Yield tired and fresh from the vat. A seeded fight’s 22-line log is identical before and after, so nothing about the fighting changed.
I removed 234 model files of the old orc, plus the tests and films that only existed for it. The five dead variants stay because the husks still load them. Deleting the weapon tests also failed the audit for 12 sword models, because their pipeline records name those tests, so I kept the tests and rewrote them on the kit-built orc.
The whole suite ran 144 tests and 4 failed. Those four (menus, outer_doors, editor_play and editor_safety) were already failing on the branch’s old base.
What is still wrong?
There is no run clip. Monsters move at 2.4 to 3.8 m/s and the plain walk is 0.94 m/s at the orc’s 1.96 m, so even with the cap the feet slide 89 to 694 mm per step. Bile Seer slides least and Marrow Mender most. A manner’s walk often gives way to the plain walk in a chase.
Also left. The husks still load the old orc’s dead models, a living monster ignores its theme, 26 attack clips fail the check (none of them played by the game today), the lizard’s tail sinks 38 mm into the floor in its death clip, and six manner attacks were cut for size. The slighter new orc body is also on the heavy monsters too, and I haven’t decided if that’s right.