Skip to content

CoolZombie: motion-matched AI locomotion demo (no state machine) - #1

Open
miogds wants to merge 5 commits into
mainfrom
feature/zombie_demo
Open

CoolZombie: motion-matched AI locomotion demo (no state machine)#1
miogds wants to merge 5 commits into
mainfrom
feature/zombie_demo

Conversation

@miogds

@miogds miogds commented Jul 26, 2026

Copy link
Copy Markdown
Member

Summary

M4 scaffold of the AI animation roadmap: a character that chases a wandering target with no animation state machine. The AI states a goal (desired velocity + facing) once per frame via setMotionMatchingGoal; the engine stack — motion matching, inertialized transitions, root motion, foot IK — does everything else. changeAnimation is never called.

Placeholder assets

The engine ships no traveling locomotion clip, so run_forward/walk_forward were generated from the in-place running test clip by injecting linear root travel (2.35 / 0.94 m/s) and re-encoding as animation-only .untold files — real food for the motion database until mocap lands. The scene swaps assets without code changes: drop in new .untold clips and the database rebuilds from whatever is loaded (ChingMu MotionDecode retargets planned; attribution note already in the README).

MPL-2.0, non-commercial demo.

Known scaffold limits (by design, until real clips land)

  • Generated clips travel straight with no turning, so heading is steered via alignOrientation; turn clips will replace this.
  • Not yet visually verified (built headless); run speed/direction of the generated clips may need a sign/speed tweak if the character moonwalks.
  • Flat ground query for foot IK; swap for the terrain heightfield when the arena gains real ground.

Javier Segura added 5 commits July 26, 2026 23:37
…hine

A wandering target orbits the arena and the character chases it: the AI
states a goal (desired velocity + facing) each frame and the engine's
animation stack — motion matching, inertialized transitions, root
motion, foot IK — does everything else. changeAnimation is never
called.

Placeholder assets: redplayer rig + idle from the engine test
resources; run_forward/walk_forward generated from the in-place
running clip by injecting linear root travel (2.35 / 0.94 m/s), so the
motion database has real traveling locomotion until mocap lands. The
scene is written so new .untold clips swap in without code changes.

Engine pinned to feature/animation_motion_matching until the animation
stack merges into develop. macOS via swift run; MPL-2.0,
non-commercial demo.
alignOrientation lerps orientation-matrix columns, which degenerates
for large heading changes (the target passing behind the character
mixes opposing columns toward zero) and expects physics components
this entity doesn't carry — the zombie never turned to follow the
target. Replaced with a yaw-only controller: shortest signed arc
toward the goal, capped at 3 rad/s, applied with rotateTo.
The demo starts paused behind a title card with a play button; while
running only a small translucent pause button sits in the corner, so
screen recordings can be armed on a still frame and captured without
overlay text. Space toggles too.
Picks up the engine fix for hierarchical assets — the zombie now
actually follows its goal instead of marching off along world +Z with
the animation churning (the skinned child drifted while the steered
root stayed put).
The full animation stack (pose layer through motion matching, with the
hierarchical anchor fix) is merged into the fork's develop; the
temporary feature-branch pin is no longer needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant