Skip to main content

Crate flatland_pathfinding

Crate flatland_pathfinding 

Source
Expand description

Grid A* pathfinding shared by the gfx client and region sim (hired workers).

Structs§

NavBlockingCircle
NavWorld
Static + dynamic obstacles for one path query.
PathSession
PathSteer
TerrainKindNavParams
Per-kind move speed + impassable flag from content (terrain-kinds.yaml).
TerrainNavTable
Lookup table for path costs — populated from the terrain kind catalog (no hardcoded speeds).

Enums§

PathMode
How A* weights walkable terrain.

Constants§

ARRIVE_RADIUS_M
DEFAULT_COST
Grass baseline A* cost (and Direct walkable cost). Fastest uses BASE / speed.
DEFAULT_PLACED_PROP_BLOCK_RADIUS_M
Default nav radius when a placed prop has blocking: true but radius 0 in data.
DEX_MOVE_COEFF
Dexterity contribution to move speed (display DEX 1–100 scale).
PATH_CLEARANCE_M
Extra clearance so paths don’t hug walls.
PLAYER_RADIUS_M
WAYPOINT_RADIUS_M
Z_LEVEL_TOLERANCE

Functions§

cell_walkable_for_path
circles_from_placed_containers
Blocking circles for placed props that have blocking on the item template (AOI view).
circles_from_views
Build blocking circles from protocol views (resource nodes + living NPCs).
collides_player_at
effective_move_speed_mps
Effective horizontal speed (m/s) for travel ETA and worker movement.
find_path
Plan a path from (from_x, from_y, from_z) to (to_x, to_y) using goal z inferred from from_z.
find_path_with_goal_z
goal_z_for
is_walkable_at_z
snap_nav_goal
Outdoor travel goal snapped clear of buildings, trees, NPCs, and placed props.
terrain_cost
A* cell cost for mode. Impassable → u16::MAX (blocked).
terrain_is_impassable
terrain_kind_view_from_id
Map catalog id (road, shallow_water, …) to protocol view.
terrain_move_speed_mult
transition_vertical
Vertical intent while auto-walking (stairs).