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:
@@ -89,6 +89,8 @@ pub fn generate_snapshot(
|
||||
z,
|
||||
kind,
|
||||
visibility: VisibilitySector::Forward,
|
||||
relationship: RelationshipState::Unknown,
|
||||
observation: EntityVisibility::Visible,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user