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
+4 -2
View File
@@ -4,7 +4,7 @@ use settled_reach_server::bridge::framing::{read_framed, write_framed};
use settled_reach_server::bridge::local::LocalBridge;
use settled_reach_server::bridge::types::*;
use settled_reach_server::bridge::SimBridge;
use settled_reach_server::simulation::time::DayPhase;
use settled_reach_server::simulation::time::{DayPhase, TickRate};
use std::os::unix::net::UnixStream;
use std::path::PathBuf;
use std::thread;
@@ -33,13 +33,14 @@ fn snapshot_roundtrip_over_unix_socket() {
let bridge = LocalBridge::accept(&server_path).expect("failed to accept");
let snapshot = ObserverSnapshot {
version: 3,
version: 4,
tick: 42,
game_time: GameTime {
day: 0,
time_of_day: 0,
day_phase: DayPhase::Morning,
paused: false,
tick_rate: TickRate::Full,
},
player_facing: FacingDirection::North,
entities: vec![VisibleEntity {
@@ -53,6 +54,7 @@ fn snapshot_roundtrip_over_unix_socket() {
observation: EntityVisibility::Visible,
}],
visible_tiles: vec![],
nearby_interactions: vec![],
};
bridge