feat(677): autonomous agent movement via spatial bundle nav graph - #10
Open
v1hns wants to merge 2 commits into
Open
feat(677): autonomous agent movement via spatial bundle nav graph#10v1hns wants to merge 2 commits into
v1hns wants to merge 2 commits into
Conversation
Replace fixed-loop animation with genuine graph-based pathfinding:
- GET /api/models/{unit_id}/spatial_bundle exposes rooms + nav_edges
- buildNavGraph() constructs adjacency list from bundle edges
- bfsPath() finds shortest-hop route between any two rooms
- tickAgent() advances each agent along their BFS path with smooth
lerp between room centers, dt-based speed in world-units/sec
- pickNextTarget() selects next destination by role:
nurse → patient_care + nursing_hub rooms
instructor → consultation + patient_care rooms
emergency_resp → CRITICAL finding rooms first, else patient_care
supply_staff → utility + patient_care rooms
- criticalRoomsRef updated from findings API so responder reactively
re-targets live CRITICAL findings without a page reload
- Agents recompute a new BFS path each time they arrive, so movement
continuously adapts to findings state
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AGENT_EYE_HEIGHT=1.65 — agents float at shoulder height, not floor - jittered() adds ±0.18 lateral noise to each waypoint so paths don't snap to the exact room-center grid lines - buildCurve() wraps BFS waypoints in a THREE.CatmullRomCurve3 so movement follows a smooth arc, not visible straight-line hops - tickAgent() advances a single t along the curve (arc-length normalised), samples getPoint(t), and adds a per-agent sinusoidal bob (±0.06m, 1.8 rad/s) so agents visibly drift in 3D rather than skating on the floor - Bob phases are spread evenly across agents so they don't pulse in sync Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/models/{unit_id}/spatial_bundleendpoint exposing rooms, nav_edges, zone_tags, and world-space centersTest plan
[start]if unreachable)/api/models/unit_1/spatial_bundlereturns 10 rooms + 9 nav_edges🤖 Generated with Claude Code