feat(simulation): add proximity detection and interaction verbs

Implement compute_nearby_interactions system that detects entities
within close (≤2) and mid (≤5) Manhattan distance, computes
available verbs per D-060 spec. NPCs get Talk+Observe at close
range, Observe-only at mid range; PersonOfInterest flips priority.
Objects get Examine. Results populate nearby_interactions[] on
ObserverSnapshot v4. Bump protocol version 3→4. Implements #404.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-12 19:48:55 +01:00
co-authored by Claude Opus 4.6
parent 5afea99622
commit 2de413dd87
12 changed files with 438 additions and 29 deletions
+8 -1
View File
@@ -5,6 +5,7 @@ use bevy_app::prelude::*;
use bevy_ecs::schedule::IntoScheduleConfigs;
pub mod input;
pub mod interaction;
pub mod movement;
pub mod path_follow;
pub mod pathfinding;
@@ -22,6 +23,8 @@ impl Plugin for SimulationPlugin {
app.init_resource::<time::SimulationTime>()
.insert_resource(rng::SimRng::new(0))
.init_resource::<input::InputQueue>()
.init_resource::<interaction::NearbyInteractionBuffer>()
.init_resource::<crate::knowledge::EntityRegistry>()
.add_systems(
Update,
(
@@ -29,8 +32,12 @@ impl Plugin for SimulationPlugin {
pathfinding::compute_paths.after(input::process_player_input),
path_follow::follow_paths.after(pathfinding::compute_paths),
movement::validate_movement.after(path_follow::follow_paths),
interaction::compute_nearby_interactions
.after(movement::validate_movement),
path_follow::cleanup_path_blocked.after(movement::validate_movement),
time::advance_tick.after(path_follow::cleanup_path_blocked),
time::advance_tick
.after(path_follow::cleanup_path_blocked)
.after(interaction::compute_nearby_interactions),
),
);