Skip to Content

Longsword duel

Two fencers draw their longswords from the hip and fight in the German school: guards from the roof and in plough, an advance and a lunge met by a parry at its instant, a wind met in a bind, a feint and a riposte, the guard in ox and a retreat, a void step back and the fool.

The packages refuse this scene today, in their own words on the view below. #3528 fixes it.

Computing 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 swordR = archetypes.createSword({ kind: "longsword" });
const swordRAt = { at: { x: 0, y: 0, z: 0 }, yaw: 0 };
const swordB = archetypes.createSword({ kind: "longsword" });
const swordBAt = { 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: "swordR",
      handle: "grip",
      use: { tip: "point", line: "oblique" },
    })
  .registered("enGarde", { blade: "swordR" })
  .registered("vomTag", { blade: "swordR" })
  .registered("advance", { length: 0.35 })
  .registered("lunge", {
      blade: "swordR",
      target: { kind: "person", subject: "blu", region: "chestLeft" },
      outcome: "parried",
    }, "lunge")
  .registered("wind", {
      blade: "swordR",
      target: { kind: "person", subject: "blu", region: "chestRight" },
      outcome: "parried",
    }, "wind")
  .registered("ochs", { blade: "swordR", seconds: 1 })
  .registered("retreat", { length: 0.35 });

// blu: body m2, at (0, 2.2) m, facing 180°, trained
const blu = HumanChain.subject("blu")
  .act("pickUp", {
      prop: "swordB",
      handle: "grip",
      use: { tip: "point", line: "oblique" },
    })
  .registered("enGarde", { blade: "swordB" })
  .registered("pflug", { blade: "swordB" })
  .registered("parry", { blade: "swordB", against: "lunge" })
  .sync({ of: "lunge", align: "stroke" })
  .registered("bind", { blade: "swordB", against: "wind" })
  .sync({ of: "wind", align: "stroke" })
  .registered("feint", {
      blade: "swordB",
      target: { kind: "person", subject: "red", region: "shoulderLeft" },
      advance: "lunge",
    })
  .registered("riposte", {
      blade: "swordB",
      target: { kind: "person", subject: "red", region: "chestRight" },
      advance: "lunge",
    })
  .registered("voidStep", { length: 0.3 })
  .registered("alber", { blade: "swordB" });

const scene = red.with(blu);

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

const props = [
  { ...HumanObject.prop("swordR", swordR, swordRAt), 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("swordB", swordB, swordBAt), 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: "duel",
  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: 2.2 }, yaw: 180, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
  props,
  laws,
};
const performance = new HumanPerformance(input);