New CognitiveDelay component buffers perception events before emitting KnowledgeEvents. Normal delay: 6 ticks (0.6s), urgent: 3 ticks (0.3s). Drain system runs after emit_observation_events, before process_knowledge_events. Adds pending_recognitions to ObserverSnapshot (protocol v7) for client fog entity visualization. Includes cancellation when entity leaves LOS. Monologue fires during delay (not after) per D-060 — cross-system wiring deferred to follow-up ticket #451. Ref: D-060 (cognitive delay), D-031 (10 tps), D-059 (fog layers) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
1.3 KiB
Rust
39 lines
1.3 KiB
Rust
// Perception module - Information boundary system
|
|
// Implements D-010 principle 2: every piece of state is tagged with who knows it
|
|
// Generates ObserverSnapshot for client rendering
|
|
|
|
use bevy_app::prelude::*;
|
|
use bevy_ecs::schedule::IntoScheduleConfigs;
|
|
|
|
pub mod cognitive_delay;
|
|
pub mod interpretation;
|
|
pub mod observation;
|
|
pub mod observer;
|
|
pub mod query;
|
|
pub mod shadowcast;
|
|
pub mod vision_cone;
|
|
|
|
/// Perception system plugin
|
|
/// Manages information boundaries and observer snapshots
|
|
pub struct PerceptionPlugin;
|
|
|
|
impl Plugin for PerceptionPlugin {
|
|
fn build(&self, app: &mut App) {
|
|
app.init_resource::<interpretation::ObservationEventQueue>()
|
|
.init_resource::<query::VisibilityGeometry>()
|
|
.init_resource::<query::ActivePerceptionMode>()
|
|
.add_systems(
|
|
Update,
|
|
(
|
|
cognitive_delay::process_cognitive_delay
|
|
.after(observation::emit_observation_events)
|
|
.before(crate::knowledge::events::process_knowledge_events),
|
|
interpretation::generate_observation_events
|
|
.after(observation::emit_observation_events)
|
|
.before(crate::knowledge::events::process_knowledge_events),
|
|
),
|
|
);
|
|
tracing::debug!("PerceptionPlugin initialized");
|
|
}
|
|
}
|