Skip to Content

Sabre bout

Two fencers draw sabres; one lands a counter-riposte, then void-steps away from a riposte.

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 { HumanBlade, HumanChain, HumanObject, HumanPerformance } from "@automovie/motions";
import * as archetypes from "@automovie/archetypes";

const sabreR = archetypes.createSword({ kind: "sabre" });
const sabreRAt = { at: { x: 0, y: 0, z: 0 }, yaw: 0 };
const sabreB = archetypes.createSword({ kind: "sabre" });
const sabreBAt = { at: { x: 0, y: 0, z: 0 }, yaw: 0 };

// red: body m1, at (0, 0) m, facing 0°, trained
const red = HumanChain.subject("red")
  .act("pickUp", {
      prop: "sabreR",
      handle: "grip",
      use: { tip: "point", line: "oblique" },
    })
  .registered("enGarde", { blade: "sabreR", seconds: 0.8 })
  .registered("advance", { length: 0.35 })
  .registered("cut", {
      blade: "sabreR",
      target: { kind: "person", subject: "blu", region: "crown" },
      outcome: "parried",
      advance: "step",
    }, "sb-head")
  .registered("slash", {
      blade: "sabreR",
      target: { kind: "person", subject: "blu", region: "ribsLeft" },
      outcome: "parried",
      advance: "step",
    }, "sb-flank")
  .registered("enGarde", { blade: "sabreR", seconds: 0.6 })
  .registered("parry", { blade: "sabreR", line: "highOutside" }, "sb-close")
  .registered("riposte", {
      blade: "sabreR",
      target: { kind: "person", subject: "blu", region: "chestRight" },
    }, "sb-touch")
  .registered("retreat", { length: 0.35 })
  .registered("ochs", { blade: "sabreR", seconds: 1 })
  .registered("advance", { length: 0.35 })
  .registered("feint", {
      blade: "sabreR",
      target: { kind: "person", subject: "blu", region: "shoulderLeft" },
    })
  .registered("lunge", {
      blade: "sabreR",
      target: { kind: "person", subject: "blu", region: "chestLeft" },
      outcome: "parried",
    }, "sb-lunge")
  .registered("enGarde", { blade: "sabreR", seconds: 2.4 })
  .registered("voidStep", { length: 0.3 }, "sb-hit")
  .registered("alber", { blade: "sabreR", seconds: 1.6 });

// blu: body m2, at (0, 1.55) m, facing 180°, trained
const blu = HumanChain.subject("blu")
  .act("pickUp", {
      prop: "sabreB",
      handle: "grip",
      use: { tip: "point", line: "oblique" },
    })
  .registered("enGarde", { blade: "sabreB", seconds: 0.8 })
  .registered("parry", { blade: "sabreB", against: "sb-head" })
  .sync({ of: "sb-head", align: "stroke" })
  .registered("parry", { blade: "sabreB", against: "sb-flank" })
  .sync({ of: "sb-flank", align: "stroke" })
  .registered("riposte", {
      blade: "sabreB",
      target: { kind: "person", subject: "red", region: "chestRight" },
      outcome: "parried",
    })
  .sync({ of: "sb-close", event: "stroke", align: "stroke" })
  .act("flinch", {
      from: { kind: "person", subject: "red", region: "palmRight" },
      intensity: 0.5,
    })
  .sync({ of: "sb-touch" })
  .registered("vomTag", { blade: "sabreB", seconds: 1 })
  .registered("pflug", { blade: "sabreB", seconds: 1.2 })
  .registered("beat", { blade: "sabreB", against: "sb-lunge" })
  .sync({ of: "sb-lunge", align: "stroke" })
  .registered("riposte", {
      blade: "sabreB",
      target: { kind: "person", subject: "red", region: "chestLeft" },
      advance: "step",
    })
  .sync({ of: "sb-hit", event: "start", align: "stroke" })
  .registered("retreat", { length: 0.35 })
  .registered("enGarde", { blade: "sabreB", seconds: 1.4 });

const scene = red.with(blu);

// The lexicon's laws this scene's rows perform, registered with the performance.
const laws = [HumanBlade.enGarde, HumanBlade.advance, HumanBlade.cut, HumanBlade.slash, HumanBlade.parry, HumanBlade.riposte, HumanBlade.retreat, HumanBlade.ochs, HumanBlade.feint, HumanBlade.lunge, HumanBlade.voidStep, HumanBlade.alber, HumanBlade.vomTag, HumanBlade.pflug, HumanBlade.beat];

const props = [
  { ...HumanObject.prop("sabreR", sabreR, sabreRAt), worn: {
    subject: "red",
    bone: "hips",
    offset: {
      position: { x: 0.17, y: 0.05, z: 0.08 },
      rotation: { x: 1, y: 0, z: 0, w: 0 },
    },
  } },
  { ...HumanObject.prop("sabreB", sabreB, sabreBAt), worn: {
    subject: "blu",
    bone: "hips",
    offset: {
      position: { x: 0.17, y: 0.05, z: 0.08 },
      rotation: { x: 1, y: 0, z: 0, w: 0 },
    },
  } },
];

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

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "sabre-bout",
  performers: [
    { subject: "red", body: bodies["m1"]!, at: { x: 0, y: 0, z: 0 }, yaw: 0, proficiency: { level: "trained" } },
    { subject: "blu", body: bodies["m2"]!, at: { x: 0, y: 0, z: 1.55 }, yaw: 180, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
  props,
  laws,
};
const performance = new HumanPerformance(input);