Skip to Content

Stage brawl

Two brawlers trade a grab, slaps, a shove and a push kick until a hook drops one.

Loading the take.

Each person is a chain of typed actions from @automovie/motions. This is what an agent writes for the scene; Composing motion explains the parts.

import type { IAutoMovieMotionHumanBody, IAutoMovieMotionHumanPerformance } from "@automovie/interface";
import { HumanChain, HumanPerformance, HumanStageFight, HumanStrike } from "@automovie/motions";

// rex: body m2, at (0, 0) m, facing 0°, trained
const rex = HumanChain.subject("rex")
  .registered("grab", {
      target: { kind: "person", subject: "ned", region: "upperArmRight" },
    }, "br-grab")
  .registered("stageSlap", {
      target: { kind: "person", subject: "ned", region: "cheekLeft" },
    }, "br-slap")
  .act("stand", { seconds: 0.7 })
  .registered("slapped", {
      from: { kind: "person", subject: "ned", region: "handBackRight" },
    }, "br-sold")
  .registered("shove", {
      target: { kind: "person", subject: "ned", region: "chestLeft" },
    }, "br-shove")
  .act("stand", { seconds: 0.1 })
  .registered("rearHook", {
      at: { kind: "person", subject: "ned", region: "jawLeft" },
      accuracy: "miss",
    }, "br-swing")
  .act("step", { direction: "back", steps: 1, length: 0.3 })
  .act("guard", {
      seconds: 1,
      facing: { kind: "person", subject: "ned", region: "face" },
    })
  .registered("pushed", {
      from: { kind: "person", subject: "ned", region: "soleRight" },
    }, "br-pushed")
  .act("step", { direction: "back", steps: 1, length: 0.3 })
  .act("step", { direction: "forward", steps: 1, length: 0.3 })
  .act("knockdown", {
      from: { kind: "person", subject: "ned", region: "handBackRight" },
    }, "br-drop");

// ned: body m1, at (0, 0.6) m, facing 180°, trained
const ned = HumanChain.subject("ned")
  .registered("grabbed", {
      from: { kind: "person", subject: "rex", region: "palmRight" },
    })
  .sync({ of: "br-grab", event: "stroke" })
  .registered("leanBack", {
      from: { kind: "person", subject: "rex", region: "palmRight" },
    })
  .registered("slapped", {
      from: { kind: "person", subject: "rex", region: "palmRight" },
    })
  .sync({ of: "br-slap", event: "stroke" })
  .registered("backhand", {
      target: { kind: "person", subject: "rex", region: "cheekRight" },
    })
  .sync({ of: "br-sold", event: "start", align: "stroke" })
  .registered("pushed", {
      from: { kind: "person", subject: "rex", region: "palmRight" },
    })
  .sync({ of: "br-shove", event: "stroke" })
  .registered("duck", {})
  .sync({ of: "br-swing", align: "lowest", offset: -0.1 })
  .registered("teep", {
      at: { kind: "person", subject: "rex", region: "abdomen" },
    })
  .sync({ of: "br-pushed", event: "start", align: "impact" })
  .registered("rearHook", {
      at: { kind: "person", subject: "rex", region: "jawLeft" },
    })
  .sync({ of: "br-drop", event: "start", align: "impact" })
  .act("step", { direction: "back", steps: 1, length: 0.3 })
  .act("guard", {
      seconds: 1,
      facing: { kind: "person", subject: "rex", region: "face" },
    });

const scene = rex.with(ned);

// The lexicon's laws this scene's rows perform, registered with the performance.
const laws = [HumanStageFight.grab, HumanStageFight.stageSlap, HumanStageFight.slapped, HumanStageFight.shove, HumanStrike.rearHook, HumanStageFight.pushed, HumanStageFight.grabbed, HumanStageFight.leanBack, HumanStageFight.backhand, HumanStageFight.duck, HumanStrike.teep];

// Each body id's motion body, prepared from the site's measures.
declare const bodies: Record<string, IAutoMovieMotionHumanBody>;

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "stage-brawl",
  performers: [
    { subject: "rex", body: bodies["m2"]!, at: { x: 0, y: 0, z: 0 }, yaw: 0, proficiency: { level: "trained" } },
    { subject: "ned", body: bodies["m1"]!, at: { x: 0, y: 0, z: 0.6 }, yaw: 180, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
  laws,
};
const performance = new HumanPerformance(input);