NPC mood, trust, routine execution, NPC-to-NPC conversations with D-078 occlusion, monologue display, content line pools, and visual specs. Teams: server (7), client (3), copy (6), visual (6). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
108 lines
9.1 KiB
Markdown
108 lines
9.1 KiB
Markdown
# Sprint 14: Live — Joint / Integration Notes
|
||
|
||
**Goal:** Bring NPCs to life — mood, trust, routine execution, and NPC-to-NPC conversation drive the first emergent social observables; the simulation produces a world that breathes independently of the player.
|
||
|
||
**Sprint 14 ID:** 14
|
||
**Status:** planning (activate with `db/connectors/sprint start`)
|
||
|
||
---
|
||
|
||
## Pre-Sprint Decisions
|
||
|
||
The following decisions are implemented or directly exercised this sprint and must be cross-referenced by the relevant team:
|
||
|
||
| Decision | Domain | Implementing ticket(s) |
|
||
|----------|--------|----------------------|
|
||
| D-024 (10-axis NPC model + combat component) | content | #323 (mood), #324 (trust), #325 (interaction tracking), #101 (routine) |
|
||
| D-026 (simulation tiers — ActiveSim scope for behavior) | architecture | #323, #101, #247 |
|
||
| D-028 (dialogue — four relational layers) | content | #325 (Layer 2 data), #324 (Layer 3 data), #168 (schema) |
|
||
| D-031 (game clock / day phases — routine transitions) | architecture | #101 |
|
||
| D-032 (separate monologue pools per character) | content | #120, #121, #122 |
|
||
| D-034 (THE FRIEND — Kael Davan / Sera Venn) | content | #318 (visual spec), #253 (monologue architecture) |
|
||
| D-035 (converged tag taxonomy) | content | #168 (schema implementation) |
|
||
| D-041 (knowledge graph — trust co-gate) | architecture | #324, #325 |
|
||
| D-075 (dialogue filtering — trust + confidence co-gate) | content | #324 (trust progression feeds `relationship_to_trust()`) |
|
||
|
||
---
|
||
|
||
## Cross-Team Dependencies
|
||
|
||
| Dependency | From | To | Risk |
|
||
|------------|------|----|------|
|
||
| #323 (Mood component) | server | copy #253 (monologue architecture must describe mood influence) | Low — copy doc can reference Mood enum; server implements |
|
||
| #325 (InteractionMemory) | server | copy #328 (access tier shifts doc references interaction count as trigger) | Low — spec can be written with intent; server implements |
|
||
| #324 (trust progression) | server | copy #121 (voice guide references mood/trust for line selection) | Low — parallel, doc references trust tier conceptually |
|
||
| #304 (entity color spec) | visual | client (future sprint — entity_renderer.gd implementation) | Low — spec must be complete before client implements |
|
||
| #316 (text display hierarchy) | visual | client #122 (monologue display references hierarchy for positioning) | Low-Medium — Stig should read #316 spec before completing #122 layout |
|
||
| #251 (tell visual/behavioral spec) | visual | server (future sprint — tell simulation behavior) | Low — server implements behavior from Araminta's spec next sprint |
|
||
|
||
**Coordination protocol:**
|
||
- Visual team (#304 first): Start entity color spec before #318 (THE FRIEND visual cross-references it). Signal to joint channel when #304 is drafted.
|
||
- Client team (#122): Read the Sprint 13 monologue display spec (`docs/design/monologue-display-spec.md`) before implementing. Also read #316 once Araminta drafts it — consult if positioning conflicts arise. Default to #315 spec if #316 is not ready.
|
||
- Server team (#323 first): Mood component is the most downstream dependency for copy and visual. Draft the `Mood` enum in `server/src/npc/mood.rs` early — copy team needs the enum values for #253 authoring contract and #121 voice guide.
|
||
- Copy team (#253 first within copy track): Monologue architecture doc gates #120 and partially gates #121. Start it day one.
|
||
|
||
---
|
||
|
||
## Sprint Completion Proof
|
||
|
||
When Sprint 14 is done, the following is concretely observable:
|
||
|
||
1. **NPCs have moods:** Query the ECS world during a gauntlet run — Active-tier NPCs have a `Mood` component with a non-Neutral value after sufficient simulation ticks. The `Mood` transitions when `ToleranceThreshold.current_stress` exceeds threshold, or when day phase changes.
|
||
|
||
2. **Trust accumulates:** Talk to the same NPC three times in sequence. After each interaction, `RelationshipGraph.get_relationship(player_id, npc_id).trust` increments. Walk away mid-conversation (D-064 mechanic) — trust decrements. Trust values are deterministic across replays with the same input sequence.
|
||
|
||
3. **Routine execution closes the loop:** NPCs in the Active tier move to their routine destination on day-phase transition. After `Morning → Afternoon`, NPCs with an Afternoon `location` in their `DailyRoutine` have an active `PathRequest` issued and eventually reach the target tile. The `ActivityState` component reflects the current routine activity string.
|
||
|
||
4. **NPC-to-NPC conversations generate sound:** Two NPCs in the same zone within 3 tiles emit a `SoundEvent` of kind `Voice` on the `ObserverSnapshot.sound_events` field. The client's `sound_indicator_renderer.gd` renders a voice-coloured (#e8c547) pulse at the fog edge in the direction of the conversation. The `AudioManager` plays the murmur asset on the WorldSFX bus (already wired Sprint 13).
|
||
|
||
5. **Monologue displays in client:** Launch the game. Walk into a new room. Within 2 ticks, a monologue line appears in the bottom-left HUD area in italic text. Wait idle for ~100 ticks — a `time_idle` line appears. Lines fade after their display duration. No line is lost — if a new line arrives while one is showing, it queues. Character-specific colour is applied.
|
||
|
||
6. **Monologue content pools exist:** `content/` directory contains `monologue-smuggler.yaml` and `monologue-detective.yaml` files with at least 8 lines each covering `enter_location` and `time_idle` triggers for at least two locations. All lines validate against the D-035 schema in `content/_schema/dialogue-line.schema.json`.
|
||
|
||
7. **Tagged line pool schema is authoritative:** Running `make pre-pr` (CI cross-reference validation, #464) validates all content YAML files against the schema. No validation errors.
|
||
|
||
8. **Visual specs are actionable:** `docs/design/entity-color-system.md`, `docs/design/text-display-hierarchy.md`, `docs/design/sound-indicator-visual.md`, `docs/design/the-friend-visual-treatment.md`, `docs/design/environmental-text-standards.md`, and `docs/design/tell-visual-expression.md` all exist with sufficient detail for Stig to implement from the spec alone — hex values, pixel dimensions, z-layer assignments, animation durations.
|
||
|
||
9. **Invariant test suite passes:** `cargo test` in `server/` includes `invariants::*` tests that execute against all existing gauntlet rooms without failure. 36 invariants across 4 categories all assert green.
|
||
|
||
10. **Access tier shift design exists:** `docs/design/access-tier-shifts.md` documents 2-3 tier transitions per character per social site with specific KG fact triggers and reversibility notes. Ready as design input for #169 (Layer 1, S15).
|
||
|
||
---
|
||
|
||
## Test Plan Alignment (D-030)
|
||
|
||
Sprint 14 is in the integration phase (D-030 Phase 2+). Test focus:
|
||
|
||
- **Server:** New systems (#323 mood, #324 trust, #325 interaction tracking, #101 routine, #103 relationship dynamics, #247 NPC conversations) each require unit tests in their respective modules. Hoshe's test harness pattern: ECS `World` setup, inject components, advance system, assert state change. Determinism required: all random values through `SimRng` (D-010 principle 4). #508 invariant tests run as integration-style tests over gauntlet rooms — these are the first map-agnostic quality gate.
|
||
- **Client:** Hoshe's gdUnit4 harness. #122 (monologue display) tests: queue management (queue depth at max, oldest-first eviction?), fade timing, character color correctness, no-overwrite behavior. Verify `current_monologue: None` produces no display (no ghost text from previous tick).
|
||
- **Copy:** Content validation is CI-driven (#464 cross-reference check in `make pre-pr`). Line pool YAML files (#120) must pass schema validation. No manual test required for docs (#253, #121, #328, #168).
|
||
- **CI:** `make ci` must pass on all branches. `make pre-pr` runs content cross-reference validation including schema check. No new HashMap in simulation crate (clippy ban active).
|
||
|
||
---
|
||
|
||
## Decision Coverage Gaps (remaining after Sprint 14)
|
||
|
||
The following confirmed decisions still have no implementing tickets. Flag to Team Leader if any block upcoming work:
|
||
|
||
- D-031 (time system) — exercised by #101 routine execution and gauntlet shift change room. No standalone ticket needed.
|
||
- D-033 (entity color = relationship to player) — #304 this sprint is the spec. Client implementation is a Sprint 15 ticket (not yet created).
|
||
- D-036 (Sova Transit District setting) — no world map authoring ticket yet. Relevant to #155 (hand-crafted location authoring, backlog).
|
||
- D-040 (wiki taxonomy) — documentation structure, not code.
|
||
- D-043–D-046 (art direction decisions) — referenced by #304, #316, #317, #334 this sprint. No standalone implementing tickets.
|
||
- D-062 (invisible locked dialogue) — design constraint, implemented by server-side filtering (already in `dialogue.rs`). No new ticket.
|
||
- D-070 (confrontation as cognitive vulnerability) — implemented Sprint 13 (audio dip). No further ticket.
|
||
- D-074 (audio aesthetic identity) — implemented Sprint 13 (murmur asset). No further ticket.
|
||
|
||
---
|
||
|
||
## Notes for Sprint Start
|
||
|
||
To activate the sprint once planning is approved:
|
||
|
||
```bash
|
||
db/connectors/sprint start
|
||
```
|
||
|
||
This sets Sprint 14 to `active`. Teams then run `db/connectors/sprint start-work --team <team>` for their full context dump.
|