feat(simulation): add A* pathfinding and NPC path following

Implements tickets #237 and #238 for Sprint 3:
- Add pathfinding crate dependency for A* algorithm
- PathRequest component triggers compute_paths system which uses
  cardinal-neighbor A* with manhattan distance heuristic
- ComputedPath component with step navigation (next_step, advance,
  is_complete) and PathBlocked marker for no-route cases
- MovementSpeed component throttles NPC movement (ticks_per_step)
- follow_paths system advances NPCs along computed paths, creating
  MoveIntent per step; cleanup_path_blocked removes markers after
  one tick
- System ordering: input → compute_paths → follow_paths →
  validate_movement → cleanup_path_blocked → advance_tick

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-12 17:51:27 +01:00
co-authored by Claude Opus 4.6
parent 3c04a0c568
commit f899624103
5 changed files with 555 additions and 2 deletions
+7 -2
View File
@@ -6,6 +6,8 @@ use bevy_ecs::schedule::IntoScheduleConfigs;
pub mod input;
pub mod movement;
pub mod path_follow;
pub mod pathfinding;
pub mod rng;
pub mod tier;
pub mod time;
@@ -24,8 +26,11 @@ impl Plugin for SimulationPlugin {
Update,
(
input::process_player_input,
movement::validate_movement.after(input::process_player_input),
time::advance_tick.after(movement::validate_movement),
pathfinding::compute_paths.after(input::process_player_input),
path_follow::follow_paths.after(pathfinding::compute_paths),
movement::validate_movement.after(path_follow::follow_paths),
path_follow::cleanup_path_blocked.after(movement::validate_movement),
time::advance_tick.after(path_follow::cleanup_path_blocked),
),
);