euca-nav) turns a region of the world into a grid navmesh, runs A* pathfinding
over it (8-connected, Euclidean heuristic, line-of-sight smoothing), and exposes a NavAgent + PathGoal
you can attach to a unit. The mental model: the navmesh and /path/compute are pure functions you call from
the handler — they need no scheduled systems — while /path/set only attaches components that a steering
system must consume to move anything. This page builds a navmesh and routes a unit end to end; every command
is real and runnable against a local server, and the outputs below are captured from one.
Build a navmesh and route a unit
1. Build the navmesh. Give it a region and acell_size; it rasterizes the scene’s colliders into a
walkable grid and stores the result as a world resource. Cells under a collider come back as blocked_cells.
cell_size 1.0 is 10000 cells; blocked_cells is 0 here because the bare world has
no colliders to rasterize.
2. Compute a path. /path/compute runs A* between two world positions and returns the waypoint list. It
reads the navmesh resource directly in the handler — no /step needed.
x.5) until the final one, which snaps to the exact target. A diagonal across the
whole grid returns proportionally more:
/path/set puts a NavAgent and a PathGoal on the entity (and a
Velocity if it lacks one). Spawn a unit first, then set its goal:
Behavior and gotchas
The things you only find out by running it:-
/path/setattaches the goal; whether the unit then moves depends on the project’s schedule and a usable navmesh. Following a path needs theeuca-navpathfinding_system(recompute the path when the goal is dirty) andsteering_system(driveVelocitytoward the next waypoint) in the project’s step schedule, plus a navmesh that actually contains a route. The example MOBA project served headless does schedule both systems — but with the default/navmesh/generateover its dense level geometry, the test cell is blocked, so/path/computereturns “No path found” and a unit set to a goal still doesn’t move:So/path/setreturns{"ok":true,...}but the entity stays put. To see steering actually relocate a unit, generate a navmesh over an open region (min_x/max_x/min_z/max_z) so a route exists. Navmesh generation and/path/computeare self-contained and run synchronously regardless of the schedule. -
/navmesh/generateand/path/computeneed no/step. Both run synchronously in the handler. Generation rasterizes colliders into the grid; compute reads the stored navmesh and runs A* immediately. -
The navmesh is static once built. It snapshots colliders at generation time and is not rebuilt when the
world changes. Regenerate to refresh it — and regenerate before you compute paths, or
/path/computereturns{"ok":false,"error":"No path found (no navmesh or blocked)"}. -
Waypoints are cell centers. With
cell_size 1.0, interior waypoints land onx.5coordinates; only the final waypoint is the exact requested target. A smallercell_sizeyields finer paths and more cells.
Endpoints
Status
- Shipped — Navmesh generation from colliders, grid A* with Euclidean heuristic and line-of-sight
smoothing, and the
NavAgent/PathGoalsteering components. All headless. - Project-dependent — Following a path needs the
euca-navsteering and pathfinding systems in the project’s step schedule and a navmesh that contains a route. The example MOBA project schedules both systems, but its dense level navmesh blocks the default test region, so/path/setattaches the goal yet the unit stays put; generate a navmesh over open ground (or run a project that does) to see steering relocate the agent. Navmesh generation and/path/computework on any server. - Partial — The navmesh is static once built (no automatic rebuild when colliders change; regenerate to refresh).
Navigation endpoints
Navmesh, path-compute, and path-set endpoints with request and response schemas.