Standardized YAML frontmatter on 4 workshop brief files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4.5 KiB
title, description, type, status, workshop, created
| title | description | type | status | workshop | created |
|---|---|---|---|---|---|
| Observer Snapshot Generation Pipeline Workshop Brief | Design the server-side pipeline that computes per-tick ObserverSnapshot from world state via spatial queries, LOS, and sound propagation. | workshop | archived | observer-snapshot-pipeline | 2026-02-11 |
Observer Snapshot Generation Pipeline Workshop Brief
Goal: Design the algorithm for "what does entity X perceive this tick?" — the server-side pipeline that computes ObserverSnapshot from world state. Ticket: #352 (epic, blocked by #351) Priority: CRITICAL — Sprint 2 blocker Participants: Tyre (architecture lead), Dudley (implementation), Troblum (algorithm review), Qatux (docs), Si (tickets) Source: Architecture Review Audit 2026-02-11, Consensus Recommendation #13 Dependency: Workshop 1 (Knowledge Graph) must complete first — this pipeline consumes the knowledge graph.
Context
Both audit reviewers independently flagged the observer snapshot pipeline as CRITICAL and unspecified. The ObserverSnapshot wire type exists (server/src/bridge/types.rs) but the algorithm that populates it does not.
This pipeline IS the game loop from the client's perspective. Every tick, the server must:
- Determine what the observer can see (spatial + LOS)
- Determine what the observer can hear (sound propagation)
- Filter visible state through the observer's knowledge graph
- Assemble the snapshot for transmission
The pipeline must run within the 100ms tick budget at 80 Active NPCs (D-026).
Key Questions to Resolve
Pipeline Stages
- What are the exact stages? (spatial query → LOS → sound → knowledge filter → assembly?)
- Which stages can be parallelized? (bevy_ecs system parallelism)
- What order do stages run in the bevy_ecs schedule?
Spatial Query
- How does the spatial index (ticket #340, SpatialIndex trait) feed into perception?
- What's the perception range? Fixed or variable by perception mode (D-017)?
- How do z-levels affect spatial queries? (D-014: 2-3 z-levels)
Line of Sight
- Which shadowcasting algorithm? (Q-018 — may resolve here or separately)
- How do vision cones (D-015: forward/peripheral/behind) modify base LOS?
- How do perception modes (D-017: thermal, camera, etc.) alter what's "visible"?
- What is the LOS cache strategy? (Per-tick full recompute vs incremental?)
Sound Propagation
- How does three-range sound (D-018) map to the spatial query?
- Does sound propagation through walls need a separate algorithm?
- How are sound events created and consumed within a tick?
Snapshot Assembly
- What fields does ObserverSnapshot need beyond the current
tick+Vec<VisibleEntity>? - How is fog grid data encoded? (Bitfield? Per-tile enum?)
- When should delta compression be introduced? (Design interface now, implement later?)
Performance
- What's the per-tick budget breakdown? (e.g., spatial 5ms, LOS 20ms, sound 5ms, assembly 10ms)
- Can perception updates be staggered across ticks for NPCs far from the player?
- How many LOS queries can run within budget at 150x150?
Input Documents
| Document | What to read | Why |
|---|---|---|
decisions/perception.md |
D-011, D-015, D-016, D-017, D-018, D-019 | Full perception spec |
decisions/architecture.md |
D-010, D-020, D-026, D-030, D-031 | Architecture + time constraints |
server/src/bridge/types.rs |
ObserverSnapshot, VisibleEntity types | Current wire format |
server/src/perception/mod.rs |
Perception plugin stub | Where this code will live |
server/src/simulation/movement.rs |
WalkabilityMap | Tile data available for LOS |
docs/audits/architecture-review-2026-02-11.md |
Tyre R-02, R-04; Troblum section 5 | Detailed proposals |
| Workshop 1 output | KnowledgeGraph design | Knowledge filtering input |
Expected Outputs
- Decision: D-0XX — Observer Snapshot Pipeline — Stage definitions, ordering, bevy_ecs system layout
- Decision: Resolution of Q-018 — Shadowcasting algorithm choice (or defer to separate spike)
- Algorithm specification: Pseudocode for each pipeline stage
- Performance budget: Per-stage timing targets at 80 Active NPCs
- Tickets: Implementation tasks per stage
- ObserverSnapshot v2 schema: Extended wire format with fog, sound, monologue fields
Workshop Format
Two rounds:
- Round 1: Each participant independently analyzes the pipeline from their perspective
- Round 2: Cross-review, reconcile performance budgets, finalize algorithm choices