Commit Graph

78 Commits

Author SHA1 Message Date
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
root fa02a6e93e feat: add findNearestWalkable method to GameMap
Adds a method that searches outward from a center position in Manhattan
distance rings to find the nearest walkable tile within a given radius.
Returns null if no walkable tile is found. Includes 5 tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:35:00 +00:00
root 4ff6f14746 feat: add spawn-npc event type and MAX_NPC_COUNT constant
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:33:38 +00:00
root a074683e4c docs: add camera mode commands implementation plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:32:25 +00:00
root 7dfd9e55df docs: add camera mode commands design doc
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:30:28 +00:00
root 02a8fc7ce8 fix: prevent async race in sprite creation and emoji lifecycle leak
Two bugs fixed:

1. NPC sprites not fully rendering: createEntitySprite is async but was
   called without await from handleStateUpdate. Concurrent state updates
   triggered multiple simultaneous creation calls for the same entity.
   The second call composited before textures loaded, producing empty
   spritesheets. Fixed with a creatingEntities guard set.

2. Interaction emojis not appearing after first use: animationend
   listener was attached during removal (when animation had already
   completed), so it never fired. Ghost entries in activeEmojis map
   blocked future emoji creation. Fixed by self-cleaning via
   animationend listener attached at creation time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:18:20 +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 2a6c928c75 feat: show Socializing activity in NPC info panel during interactions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:08:47 +00:00
root cabb129fdf feat: add floating emoji overlay for NPC social interactions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:07:40 +00:00
root 8daecfaa3f feat: wire socialSystem into game loop, spawner, and state serializer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:06:08 +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
root ce55c86c5a feat: add SocialState types and social interaction constants
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 12:58:26 +00:00
root 3fc04a6a3a docs: add NPC social interactions implementation plan
9-task TDD plan covering shared types, socialSystem, brain/movement
guards, game loop wiring, state serialization, client emoji overlay,
and info panel integration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 12:55:08 +00:00
root cc8fc7def7 docs: add NPC social interactions design
Covers awareness zone, interaction state machine, cooldowns,
brain/movement guards, broadcast format, and client emoji overlay.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 12:52:31 +00:00
root 50ccfd9c69 docs: update README and CLAUDE.md for portrait panel feature and Traefik deployment
- Document follow mode panel feature and controls
- Add Traefik reverse proxy deployment instructions
- Add security note about vite dev vs production serving
- Update CLAUDE.md with new entry points, test count, and conventions

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