Commit Graph

41 Commits

Author SHA1 Message Date
root 25d842e367 feat(systems): pause movement during gathering, wire gathering into game loop
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:50:48 +00:00
root 5fba656c62 feat(systems): add gatheringSystem with timer, stat modifier, and inventory
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:49:47 +00:00
root 61c463c1c7 feat(brain): add gather goal when productivity is low
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:47:51 +00:00
root e1edbd47c6 feat(needs): add productivity decay to needsDecaySystem
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:46:57 +00:00
root 4670bfc08b feat(spawner): add productivity need and inventory to spawned NPCs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:45:34 +00:00
root ce2caa4ae1 fix(memory): use auto-incrementing id as tick proxy for recency scoring
Events recorded with tick: 0 now get a meaningful tick value from the
service's internal counter, ensuring selectForPrompt recency scoring
works correctly. Also fixed preferTypes to accept readonly arrays.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:09:01 +00:00
root cb59636cd9 feat(memory): add shared history context to social narration prompts
When narrating social interactions, the LLM now receives up to 3 shared
history events between the two NPCs, enabling more contextual narrations
that reference past encounters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:04:52 +00:00
root 1db8935de3 feat(memory): integrate event memory into thought generation context
Replace the simple last-2-narration-events approach with smart selection
of up to 5 memory events, preferring types relevant to the thought trigger
(social events for post-interaction, need events for need-critical).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:04:46 +00:00
root 1a83814a0f feat(memory): record need crisis, recovery, and goal change events
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:59:42 +00:00
root 1b114a1897 feat(memory): record tier changes and bond dissolution events
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:58:09 +00:00
root ef7a792750 feat(memory): record spawned, social, proposal, and bond events
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:56:42 +00:00
root 35d1bb0bee fix: update socialSystem tests to match new tuning values
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:19:16 +00:00
root d58e623c14 tweak: reduce stat drift rates and increase social cooldowns
- Halve sociability/empathy drift on positive outcome (0.05 -> 0.025)
- Halve temperament drift on negative outcome (0.02 -> 0.01)
- Increase social global cooldown (50 -> 75 ticks)
- Increase social pair cooldown (300 -> 450 ticks)
- Increase base proposal cooldown (500 -> 750)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:18:03 +00:00
root eb79c5e481 fix(thought): add missing trigger types and prevent emoji overlap
- determineTrigger now detects post_interaction (recent social outcome),
  need_critical, idle (wandering), and periodic triggers
- Track active emoji per NPC, destroy previous before showing new one

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:16:24 +00:00
root fb19f6cf8d feat(thought): add ThoughtSystem with batching, cooldowns, and trigger detection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:08:30 +00:00
root 87946bcb5c feat: add social interaction narration system (task 1.3)
Implements LLM-powered narration for NPC social interactions:
- Rate limits updated to 20 RPM / 1000 per day (OpenRouter free tier)
- NarrationEvent type with template fallback text generator
- NarrationService with rolling event buffer and LLM priority queuing
- Narration emitter wired between social and relationship systems
- Socket.io events for real-time narration delivery
- Tabbed left panel (Stats + Events) replacing old Superlatives panel
- Recent events section in NPC info panel
- Follow tracking via socket for LLM narration priority

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:29:43 +00:00
root 78c8dbfb7f fix: use shared formatStatsForPrompt from backstoryGenerator
Removes duplicated local version that had different format.
Also brings backstoryGenerator.ts into the worktree from main.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:13:23 +00:00
root 541b70b781 feat: wire narration emitter into social system and GameLoop
Add narrationEmitter system that reads completed interactions from
socialState.lastOutcome and feeds them to the NarrationService. It runs
between socialSystem and relationshipSystem to capture outcomes before
they are cleared. Includes pair deduplication, proposal detection,
priority marking for followed NPCs and high-value relationships, and
personality formatting for LLM prompts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:02:59 +00:00
root 8b8f76bbb8 fix: remove unused classify import from superlativesComputer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 04:43:09 +00:00
root e709082694 feat: add superlatives computation with tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 04:41:05 +00:00
root 0bfeef7fa1 feat: add proposal interaction handling to social system
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:33:22 +00:00
root 66596fb96d feat: add proposal queuing and bond-aware despawn to relationship system
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:24:32 +00:00
root bf2a9817ab fix: update tests for new SocialState shape and Devoted tier
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:21:58 +00:00
root f8ad3a6f0c feat: rename Partner tier to Devoted, add bond-aware classification
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:20:26 +00:00
root 925f8a7494 feat: add bond registry with helpers for mutual relationships
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:16:33 +00:00
root 4f5e4f34ba feat: add relationshipSystem with delta calculation and despawn handling
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:34:46 +00:00
root df0f036cf2 feat: emit lastOutcome from socialSystem for relationship processing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:31:47 +00:00
root cdfc35d5da feat: add relationship classification helpers with tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:30:22 +00:00
root 7d196524d6 fix: clamp baseline drift both directions, make updateStats private
- Add Math.max(3, ...) to baseline drift in socialSystem to prevent
  stats drifting below minimum (was only clamping upward with Math.min)
- Make NpcInfoPanel.updateStats private (only called from updateInfo)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:31:29 +00:00
root c7b998dbd0 feat: add event-based transient stat modifiers on social outcomes
Positive outcomes add +1 sociability modifier (100 ticks).
Negative outcomes add -1 sociability and -1 empathy modifiers (100 ticks).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:26:20 +00:00
root 78cede4b32 feat: add baseline stat drift on social interaction outcomes
Positive social outcomes drift sociability and empathy up (+0.05),
negative outcomes drift temperament up (+0.02), capped at 18.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:25:49 +00:00
root fbe06e9d79 feat: integrate perception, sociability, and empathy into social system
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:23:21 +00:00
root 42b574259f feat: integrate constitution into needs decay rates
High constitution slows hunger/energy decay, low constitution speeds it.
Uses getEffectiveStat helper which defaults to 10 for entities without
stats, preserving backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:22:09 +00:00
root e90e69ce35 feat: add statModifierSystem with needs-based modifiers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:19:26 +00:00
root aebfad07ce feat: add getEffectiveStat helper for computed stat values
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:17:49 +00:00
root d011dcf183 fix: address code review - pair-based phase transitions and emoji animation lifecycle
- Process phase transitions per-pair instead of per-entity to avoid
  double-processing (latent bug for future side effects)
- Restore independent outcome rolls per NPC (as designed)
- Let emoji CSS animation finish before removing DOM element, preventing
  visual pop when server broadcast timing doesn't align with animation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:12:01 +00:00
root 7cfc8c0537 feat: add social interaction guards to brain and movement systems
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:05:05 +00:00
root ac3f26a470 feat: implement socialSystem with proximity detection and phase state machine
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:02:31 +00:00
root d0a7bfc4bc test: add failing tests for social interaction system
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:00:34 +00:00
andy b94ad32806 feat: viewport modes, configurable server URL, deployment docs
- Add follow mode (F key) to cycle camera between NPCs
- Make server URL configurable via VITE_SERVER_URL env var
- Add comprehensive README with Debian LXC deployment guide
- Add character sprite assets to repo
- Add design docs and implementation plans

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:25:53 -05:00
andy 83660609fc feat: implement NPC systems (needs decay, brain, movement)
Add three ECS systems for NPC simulation:
- needsDecaySystem: decrements hunger/energy each tick, clamped at 0
- npcBrainSystem: goal selection based on need thresholds with pathfinding
- movementSystem: advances entities along computed paths

Includes 8 passing tests covering decay, goal prioritization, and movement.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:19:07 -05:00