Commit Graph

94 Commits

Author SHA1 Message Date
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 db808bca86 feat: initialize bond registry singleton and update spawner
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:21:54 +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 7b70b9c8bf feat: add proposal system config values
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:18:40 +00:00
root 99e041d6cf feat: add proposal and bond types to shared protocol
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:18:38 +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 6b32e115b0 feat: add singleton support to World ECS
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:14:13 +00:00
root e5a6b443e9 docs: add mutual bonds implementation plan
12-task TDD plan covering bond registry, proposal interactions,
classification rework, config additions, and client display updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:11:48 +00:00
root d9b2a64430 docs: add mutual bond system design
Separates feelings (asymmetric sentiment values) from formal
relationship statuses (mutual bonds in a central registry).
Introduces proposal interaction protocol for partnership formation
with acceptance/rejection mechanics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 18:57:58 +00:00
root b42362e041 fix: prevent orphaned accessory sprites from race conditions
Two bugs caused accessories to render independently of their NPC:

1. spawnEntities ran concurrently with state updates, allowing duplicate
   sprites to be created for the same entity. The orphaned sprite would
   animate in place but never move. Fixed by deferring onStateUpdate
   registration until initial spawn completes.

2. CharacterCompositor tracked load intent (Set) rather than load
   completion (Promise), so concurrent preloads could composite before
   shared textures finished loading — producing sprites with missing
   skin layers. Fixed by using a Map<string, Promise> so concurrent
   callers await the same per-file load promise.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:03:47 +00:00
root 29c8c5fd8c fix: give each CommandPanel a unique DOM id
Both camera and follow panels had id='command-panel'.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:03:33 +00:00
root 76ea7afb3b feat: add toggleable red glow highlight on followed NPC
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:03:33 +00:00
root 764d4d7355 feat: add follow mode command legend panel
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:03:33 +00:00
root 9b55a563ed refactor: parameterize CommandPanel title and commands
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:03:33 +00:00
root 0c93915339 docs: add follow highlight implementation plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:03:18 +00:00
root 93df418554 docs: add follow mode highlight & command legend design
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:03:18 +00:00
root 19922efd80 fix: persist expanded state across relationship tab re-renders
The updateRelationships method rebuilds DOM every broadcast tick,
which reset expand/collapse state. Now tracks expanded tiers in a
Set that persists across re-renders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:12:37 +00:00
root a0ce9c92f8 feat: add click-to-expand for relationship tier groups and memories
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:10:03 +00:00
root 68c910f406 docs: update README.md with relationship system documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:01:26 +00:00
root 420a21e184 docs: update CLAUDE.md for relationship system; fix client styling
- Update CLAUDE.md with relationship system entry points, conventions, test count
- Restore NPC info panel to 280px width with original font sizes
- Add responsive scaling to Phaser game config
- Bump CommandPanel font sizes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:42:41 +00:00
root c356baa425 Merge branch 'worktree-relationship-system' 2026-03-07 15:41:22 +00:00
root 3af1e59232 feat: add relationships tab to NPC info panel with tier-grouped sliders
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:38:30 +00:00
root 97c2176b75 feat: wire relationship system into spawner, game loop, and serializer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:35:59 +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 87ab1b4c10 feat: add relationship config with tuning values
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:29:38 +00:00
root 2ae3326b09 feat: add relationship types to shared
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:28:47 +00:00
root 3025f90c58 docs: add relationship system implementation plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:27:12 +00:00
root 1d4100a081 docs: add relationship system design
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:22:33 +00:00
root 458fd99495 docs: update CLAUDE.md and README.md for NPC stats system
- Fix stale test count (29 -> 86) and system order in CLAUDE.md
- Add new key entry points for stat system files
- Add shared build command
- Document stat conventions (3d6, modifiers, drift, wire protocol)
- Add NPC Stats section to README with stat descriptions and effects
- Add Game Constants table pointing to shared/src/constants.ts
- Update follow mode description with stats display

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:49:02 +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 304dc78778 feat: display NPC stats in info panel with EarthBound styling
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:28:04 +00:00
root 0fc186b4f3 feat: serialize effective stats in entity state broadcast
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:27:24 +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 c5d75fa0b0 feat: wire stats into NPC spawner and game loop
Add stats and statModifiers components to spawnNPC, and run
statModifierSystem as the first system in the GameLoop update cycle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:20:43 +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 9c6834c05f feat: add 3d6 stat generation for NPCs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:15:29 +00:00
root 1351708c7b feat: add Stats and StatModifiers types to shared
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:14:26 +00:00
root 349f8ef286 docs: add NPC stats implementation plan (12 tasks, TDD)
Covers shared types, stat generation, modifier system, system
integrations (needs decay, social), serialization, and UI display.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:12:36 +00:00
root 56d8bd2eca docs: add NPC statistics system design
Two-tier stat system (Physical + Personality) using 3d6 generation,
transient modifiers, slow baseline drift, and integration points
for needs decay, brain, and social systems.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:09:30 +00:00
root c8a86eec3f feat: wire spawn hotkey and command panel visibility in GameScene
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:40:16 +00:00
root 526bb83d0b feat: create EarthBound-styled CommandPanel UI component
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:39:09 +00:00
root 953f9e8591 feat: add spawnNpc method to SocketClient
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:38:25 +00:00
root 7e5f430204 feat: handle spawn-npc socket event with cap and position logic
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:37:36 +00:00
root 1576e6b717 feat: add optional positionHint to spawnNPC
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:36:37 +00:00