Flow-field navigation forbevy_pathfinder
A grid-based flow-field pathfinding crate for Bevy tile worlds — a walkability grid, BFS-computed direction fields toward shared goals, and a narrow-passage detector, on a pure-Rust core.
Flow fields, not per-agent A*
When many agents share the same goal, a single BFS builds a direction field once and every agent looks up its next move in O(1), avoiding a separate A* search per agent.
What it gives you
Features
BlockGrid
2D walkability grid with per-cell height and terrain cost.
FlowField
BFS-computed direction vectors pointing every walkable cell at one or more goals. Agents share a goal and look up their next move in O(1) instead of running per-agent A*.
FlowGate
Narrow-passage detector, useful for ambush AI, territory control, and patrol route generation.
Pure-Rust core
No engine dependency by default; enable the bevy feature for Resource derives and ECS integration.
Questions
Frequently asked
What does the bevy_pathfinder crate do?
It provides grid-based flow-field pathfinding for tile worlds — a walkability grid, BFS-computed direction fields toward shared goals, and a narrow-passage (chokepoint) detector.
Why flow fields instead of per-agent A*?
When many agents share the same goal, a single BFS builds a direction field once and every agent looks up its next move in O(1), avoiding a separate A* search per agent.
Is Bevy required to use it?
No. The crate is pure Rust by default; enabling the optional bevy feature adds Resource derives for ECS integration.