Parent: #22
Depends on: #23
Description
The orchestrator agent currently snaps to its target position when the run status changes (via the diff system detecting stationIndex/level changes). This ticket adds animated walk transitions so the orchestrator walks left-to-right along level 0 between stations as the run progresses and transitions between levels at the review area via ladders (vertical teleport).
This builds on the 2D layout MVP (#23), which is already merged.
Current behavior
run-to-scene.ts mapper computes the orchestrator's target position from CanonicalRunStatus (rightmost active phase, always level: 0)
agent-differ.ts detects when stationIndex, stackOffset, or level changes → categorizes as "moved"
FactoryScene.updateAgents() calls actor.walkTo(newPos) for moved agents — straight-line movement
AgentActor.walkTo() uses Excalibur's moveTo() at WALK_SPEED = 100; if called while already walking, silently returns (no queue, no cancel)
- Orchestrator animation state is always
'working' during in-progress runs
Design decisions
-
Orchestrator level during review: Goes to the highest reviewer level (reviewerCount - 1) to "oversee from top." Deterministic from reviewer count.
-
Concurrent walks: Cancel-and-restart — cancel current walk via Excalibur's clearActions(), start new walk from the actor's current position toward the new target. Avoids stale intermediate destinations from rapid status updates.
-
Architecture: Add walkPath(waypoints) to AgentActor with a generation counter for safe async cancellation. Path computation as a pure function in the layout module (computeWalkPath), using ladder geometry from LayoutResult.
-
Orchestrator animation: Change from 'working' to 'idle' — the orchestrator oversees, it doesn't do work. Walking animation is handled internally by walkPath. Will be replaced by 'resting' in Phase 4.
Acceptance criteria
Must have
Should have
Nice to have
Files
| File |
Action |
packages/factory/src/client/game/mappers/run-to-scene.ts |
Modify |
packages/factory/src/client/game/layout/walk-path.ts |
Create |
packages/factory/src/client/game/actors/AgentActor.ts |
Modify |
packages/factory/src/client/game/scenes/FactoryScene.ts |
Modify |
packages/factory/src/client/game/state/agent-state-resolver.ts |
Modify |
+ corresponding __tests__/ files for each |
Modify/Create |
Parent: #22
Depends on: #23
Description
The orchestrator agent currently snaps to its target position when the run status changes (via the diff system detecting
stationIndex/levelchanges). This ticket adds animated walk transitions so the orchestrator walks left-to-right along level 0 between stations as the run progresses and transitions between levels at the review area via ladders (vertical teleport).This builds on the 2D layout MVP (#23), which is already merged.
Current behavior
run-to-scene.tsmapper computes the orchestrator's target position fromCanonicalRunStatus(rightmost active phase, alwayslevel: 0)agent-differ.tsdetects whenstationIndex,stackOffset, orlevelchanges → categorizes as "moved"FactoryScene.updateAgents()callsactor.walkTo(newPos)for moved agents — straight-line movementAgentActor.walkTo()uses Excalibur'smoveTo()atWALK_SPEED = 100; if called while already walking, silently returns (no queue, no cancel)'working'during in-progress runsDesign decisions
Orchestrator level during review: Goes to the highest reviewer level (
reviewerCount - 1) to "oversee from top." Deterministic from reviewer count.Concurrent walks: Cancel-and-restart — cancel current walk via Excalibur's
clearActions(), start new walk from the actor's current position toward the new target. Avoids stale intermediate destinations from rapid status updates.Architecture: Add
walkPath(waypoints)toAgentActorwith a generation counter for safe async cancellation. Path computation as a pure function in the layout module (computeWalkPath), using ladder geometry fromLayoutResult.Orchestrator animation: Change from
'working'to'idle'— the orchestrator oversees, it doesn't do work. Walking animation is handled internally bywalkPath. Will be replaced by'resting'in Phase 4.Acceptance criteria
Must have
CanonicalRunStatuschanges, not scriptedShould have
Nice to have
Files
packages/factory/src/client/game/mappers/run-to-scene.tspackages/factory/src/client/game/layout/walk-path.tspackages/factory/src/client/game/actors/AgentActor.tspackages/factory/src/client/game/scenes/FactoryScene.tspackages/factory/src/client/game/state/agent-state-resolver.ts__tests__/files for each