fix(simulation): address PR #12 review — z-level filter, visible tile dedup, version bump
- Filter remembered entities by z-level (Hoshe + Tyre warning) - Skip remembered ghosts on currently visible tiles (Hoshe warning) - Bump ObserverSnapshot version to 3 (Tyre suggestion) - Add edge case tests: visible tile collision, different z-level, knowledge without position (Hoshe suggestion) - Regenerate msgpack fixtures for v3 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -107,7 +107,7 @@ pub fn generate_snapshot(
|
||||
visible.len()
|
||||
);
|
||||
buffer.snapshot = Some(ObserverSnapshot {
|
||||
version: 2,
|
||||
version: 3,
|
||||
tick: time.tick,
|
||||
game_time,
|
||||
player_facing: FacingDirection::default(),
|
||||
|
||||
@@ -12,11 +12,12 @@ pub use crate::simulation::time::DayPhase;
|
||||
/// Contains all information visible to the observer at a given tick.
|
||||
///
|
||||
/// v2 adds: game_time, player_facing, visible_tiles, visibility sectors.
|
||||
/// v3 adds: relationship (D-033 entity color), observation (Visible/Remembered).
|
||||
/// Future fields: ambient sound events, internal monologue triggers,
|
||||
/// HUD state (D-020 expansion).
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ObserverSnapshot {
|
||||
/// Protocol version for forward compatibility. Current: 2.
|
||||
/// Protocol version for forward compatibility. Current: 3.
|
||||
pub version: u8,
|
||||
/// Simulation tick when this snapshot was produced
|
||||
pub tick: u64,
|
||||
|
||||
Reference in New Issue
Block a user