Birdoggydog's Builds

Letting a seated NPC die where he sits with a motion clip

Carl's death is now a 1.5 second clip on his seated idle. His head drops 54 degrees, nothing else moves, and the blood stays.

When Carl dies now, he stays against the wall. His legs and arms stay as they were, and only his head drops, 54 degrees in about a second. His eyes shut, he goes pale over 5 game seconds, and the stain and the pool of blood stay. You can search him, and he’s saved and loaded like any body. Before, he lay down clean, like every dead NPC.

40 seconds, captioned. Carl dying in front of the party, then the dead Carl from the front and the side.
A man in a pale lab coat slumped on a dark floor with his back against a gray wall, his chin on his chest, a dark red stain on his coat and red on the floor under him, with a prompt over his head reading Chief Scientist Carl, dead.

From his side, rendered in game: back on the wall, legs as they were, chin on his chest, the stain on his coat and the pool under him.

I’d been asked whether the dead Carl should keep the blood, and I said yes. I also said he should die in the same position with his head just dropping down. The last post covers how he got to sit and bleed, and this is the death on top of it.

How do you make a clip that ends from a looping idle?

Carl’s seated idle is built from layers on the human base idle, so the death is another row in the same table, die_wounded_seated. It takes the idle’s first frame and holds it. It squeezes the frames to 36, which is 1.5 seconds at 24 frames per second, and turns the loop into a clip that ends. Then it adds two layers, each gone through once and held:

{"add": {"to": "head", "turn": "X54 Y-3 Z-5", "once": true,
         "keys": [[0.0,0.0],[0.08,0.0],[0.62,1.06],[0.8,0.97],[1.0,1.0]]}},
{"add": {"to": "upper_arm.R", "turn": "X4", "once": true,
         "keys": [[0.0,0.0],[0.2,0.0],[0.85,1.0]]}}

The keys are positions along the clip and how much of the turn is applied there. The head holds still for the first 8 percent, overshoots to 106 percent of the turn at 62 percent of the clip, and settles at 100. I had to add a function, eased(), to the motion kit for this. It eases between neighboring keys with a smoothstep and holds the first value before them and the last after them. A once flag stops the keys from wrapping round.

I tried a sag of the chest as well and took it out, because it slid the left hand 14 mm along the floor. The bench now has a check for a clip like this. It poses the first and last frames and fails if the head drops under 30 degrees, if the clip is still moving in its last 6 steps, or if any joint other than the head, neck and arms moves more than 20 mm. On this clip every other joint moves 0.0 mm, the right fist is 18 mm slack, and the back moves from 283.0 to 283.1 mm against the idle’s 283.4.

How does the game know he dies seated?

A figure’s name says how it rests, and a name whose third word ends in “seated” is a seated figure. NpcFigure.sits() answers that from the name alone, because the figure has to be made before there’s a body to ask. A dead figure like that is made still and not lying. It holds the last frame of the death clip, shuts its eyes by playing the face’s blink clip to 0.34 seconds, where the lids are shut, and pausing it, and puts the same two blood decals on that the living one wore.

The body is solid like the living one, so the party can’t walk into his lap, and his search prompt is placed over the dropped head. If the party sees him die, the body that replaces the living one picks up the idle where it was and blends into the dying clip over 0.35 seconds. His lids shut as the head goes, and the pallor comes on over 5 game seconds, all counted by the game clock. If the party finds him later, or loads a save, he’s in the dead pose at once.

I’m not sure the drop and the very dark head under the pallor look right, so that’s open. Also his corpse text still says he’s pointing at the door, which he doesn’t do anymore. The clip test went from 63 to 96 checks and passes, and the eight related tests run by word at the landing all passed.