Raasta
Raasta (راستہ — Urdu/Hindi for "path/way/route") — navigation and pathfinding engine for the AGNOS ecosystem.
Built on hisab for math. Used by kiran (game engine), joshua (simulation), and impetus (physics).
Features
Grid Pathfinding
- A* — standard optimal pathfinding with per-cell costs
- Jump Point Search — 35x faster on uniform-cost grids
- Theta* — any-angle paths via LOS shortcuts
- Lazy Theta* — deferred LOS checks, fewer line-of-sight tests
- Bidirectional A* — dual-frontier search, fewer node expansions
- Fringe search — IDA*-like cache-friendly algorithm
- Weighted A* — bounded-suboptimal for faster results
- D* Lite — incremental replanning for dynamic environments
- Flow fields — precomputed direction grids for crowd movement
- Connected components — instant unreachable-query rejection
NavMesh
- Baking — ear-clipping triangulation + convex merge from polygon boundaries
- Heightfield baking — Recast-style pipeline from 3D triangle geometry
- Collider generation — NavMesh from physics collider shapes
- A* pathfinding — with area costs, query filters, off-mesh links, obstacle carving
- Tiled navmesh — streaming, localized re-baking for open worlds
- Multi-layer — overlapping surfaces for bridges and multi-story buildings
- Serialization — compact binary save/load (RNAV format)
- Navigation queries — closest point, raycast, random point, height snap
Steering & Agents
- Core behaviors — seek, flee, arrive, pursuit, evade, wander
- Flocking — separation, alignment, cohesion
- Obstacle avoidance — ray-cone detection with urgency scaling
- Behavior blending — weighted combination + priority-based selection
- Formation movement — line, wedge, circle, grid, custom slot patterns
- Path following — waypoint progression with arrive steering
- Path corridor — sliding window with local replanning
Simulation
- RVO/ORCA — reciprocal collision avoidance with spatial hashing
- Crowd simulation — density-aware velocity damping
- Influence maps — 2D overlay grids for danger zones and strategic value
3D Navigation
- NavMesh3D — 3D polygon mesh with projected pathfinding
- 3D steering — seek, flee, arrive in 3D space
- Voxel navigation — 26-connected A* for flying/swimming agents
- Height queries — ground-snap (x,z) → y
Performance
- Incremental pathfinding — time-sliced A* across frames
- Request batching — priority queue with per-frame budget
- Query objects — pre-allocated scratch buffers, zero per-path allocation
- SOA RVO — struct-of-arrays layout with pre-allocated work buffers
- Parallel pathfinding — rayon-powered batch operations (feature-gated)
- 51 criterion benchmarks with CSV history tracking
Quick Start
use ;
let mut grid = new;
grid.set_walkable; // wall
let path = grid.find_path;
assert!;
NavMesh Pathfinding
use ;
let mesh = bake;
let path = mesh.find_path;
RVO Collision Avoidance
use ;
let mut sim = new;
let a = sim.add_agent;
sim.set_preferred_velocity;
sim.step;
Feature Flags
| Flag | Description | Default |
|---|---|---|
logging |
Structured tracing on all operations | off |
soorat-compat |
Visualization data for soorat renderer | off |
parallel |
Rayon-powered parallel pathfinding | off |
Dependency Stack
raasta (navigation/pathfinding)
└── hisab (math — Vec2, Vec3, geometry)
└── glam (SIMD linear algebra)
Documentation
License
GPL-3.0-only