feat(simulation): integrate knowledge graph into observer snapshot (#366)

VisibleEntity now carries relationship state (D-033 entity color) and
observation type (Visible vs Remembered). compute_observer_snapshot
queries the player's KnowledgeGraph to overlay relationship data on
visible entities and include remembered (not-in-LOS) entities as fog
ghosts at their last known position. Regenerated msgpack fixtures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-12 01:28:53 +01:00
co-authored by Claude Opus 4.6
parent 12dc0bc0bf
commit 9c0190c7c2
12 changed files with 270 additions and 10 deletions
+2
View File
@@ -89,6 +89,8 @@ pub fn generate_snapshot(
z,
kind,
visibility: VisibilitySector::Forward,
relationship: RelationshipState::Unknown,
observation: EntityVisibility::Visible,
});
}
+9
View File
@@ -5,6 +5,7 @@
use bevy_ecs::prelude::*;
use serde::{Deserialize, Serialize};
pub use crate::knowledge::types::{EntityVisibility, KnowledgeConfidence, RelationshipState};
pub use crate::simulation::time::DayPhase;
/// The ONLY data structure crossing the client-server boundary (D-020)
@@ -95,6 +96,14 @@ pub struct VisibleEntity {
pub kind: EntityKind,
/// Which vision cone sector this entity falls in (D-015)
pub visibility: VisibilitySector,
/// Relationship state for D-033 entity color rendering.
/// Unknown for entities not yet in the knowledge graph.
#[serde(default)]
pub relationship: RelationshipState,
/// Whether this entity is currently visible or remembered from knowledge.
/// Visible = in LOS right now. Remembered = known but not in LOS.
#[serde(default)]
pub observation: EntityVisibility,
}
/// Category of visible entity