Skip to Content

Night out

Outside a bar one drunk staggers, a friend limps after, and another argues with a stranger.

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, HumanDrill, HumanEmblem, HumanGait, HumanPerformance, HumanPose, HumanPursuit, HumanStance } from "@automovie/motions";

// rae: body m1, at (-3, 0) m, facing 90°, trained
const rae = HumanChain.subject("rae")
  .registered("drunk", { to: { x: -0.5, y: 0, z: 0 } })
  .act("gesture", { kind: "cheer" })
  .registered("stumble", {})
  .registered("drunk", { to: { x: 1.5, y: 0, z: -0.3 } })
  .act("gesture", { kind: "wave" });

// sam: body f1, at (-3.5, 0.8) m, facing 90°, trained
const sam = HumanChain.subject("sam")
  .registered("stiffLimp", { to: { x: -1, y: 0, z: 0.8 } })
  .act("look", {
      target: { kind: "person", subject: "rae", region: "face" },
      cue: "seen",
      seconds: 1.2,
    })
  .act("gesture", { kind: "beckon" })
  .act("gesture", { kind: "shakeHead" })
  .registered("stiffLimp", { to: { x: 1.5, y: 0, z: 0.6 } })
  .act("look", {
      target: { kind: "person", subject: "rae", region: "face" },
      cue: "seen",
      seconds: 1.2,
    })
  .act("gesture", { kind: "shrug" });

// tom: body m2, at (1, 3) m, facing 180°, trained
const tom = HumanChain.subject("tom")
  .registered("confront", {
      target: { kind: "person", subject: "uma", region: "sternum" },
    }, "no-up")
  .registered("armsCrossed", { seconds: 1 })
  .act("gesture", {
      kind: "point",
      target: { kind: "person", subject: "uma", region: "face" },
    }, "no-point")
  .act("gesture", { kind: "shrug" })
  .registered("dontKnow", {})
  .act("walk", { to: { x: 1, y: 0, z: 3.7 } })
  .act("look", {
      target: { kind: "person", subject: "uma", region: "face" },
      cue: "seen",
      seconds: 1.2,
    })
  .registered("shakeFist", {});

// uma: body f2, at (1, 1.6) m, facing 0°, trained
const uma = HumanChain.subject("uma")
  .act("stand", { seconds: 3 })
  .registered("handsOnHips", { seconds: 1.6 })
  .sync({ of: "no-up", event: "arrive" })
  .act("stand", { seconds: 3 })
  .act("gesture", { kind: "shakeHead" })
  .sync({ of: "no-point", event: "strokeEnd" })
  .registered("halt", {})
  .registered("sway", {})
  .act("gesture", { kind: "wave" });

const scene = rae.with(sam, tom, uma);

// The lexicon's laws this scene's rows perform, registered with the performance.
const laws = [HumanGait.drunk, HumanPose.stumble, HumanGait.stiffLimp, HumanPursuit.confront, HumanStance.armsCrossed, HumanEmblem.dontKnow, HumanEmblem.shakeFist, HumanStance.handsOnHips, HumanEmblem.halt, HumanDrill.sway];

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

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "night-out",
  performers: [
    { subject: "rae", body: bodies["m1"]!, at: { x: -3, y: 0, z: 0 }, yaw: 90, proficiency: { level: "trained" } },
    { subject: "sam", body: bodies["f1"]!, at: { x: -3.5, y: 0, z: 0.8 }, yaw: 90, proficiency: { level: "trained" } },
    { subject: "tom", body: bodies["m2"]!, at: { x: 1, y: 0, z: 3 }, yaw: 180, proficiency: { level: "trained" } },
    { subject: "uma", body: bodies["f2"]!, at: { x: 1, y: 0, z: 1.6 }, yaw: 0, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
  laws,
};
const performance = new HumanPerformance(input);