Commit Graph

47 Commits

Author SHA1 Message Date
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 94e4f4b9c2 fix: restore superlatives methods, fix event update rebuild, remove dead method
- Restore subscribeSuperlatives/unsubscribeSuperlatives/onSuperlativesUpdate
  on SocketClient (lost during Task 5 refactor)
- Fix EventsFeed.updateEvent to rebuild entire element when LLM narration
  arrives (names may be in different positions)
- Remove dead setFollowedEntity method from GameLoop (replaced by
  SocketServer.rebuildFollowedEntityIds)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:38:06 +00:00
root 6514dde42e feat: track followed NPCs via socket for LLM narration priority
Adds follow-npc client event so the server knows which NPCs are being
watched, enabling priority LLM narration for followed entity interactions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:25:16 +00:00
root e8723f0a06 feat: add recent narration events to NPC info panel
Show the last 3 narration events involving the followed NPC in the
Status tab, between the activity label and the diamond separator.
Events update live when new narrations arrive or LLM text replaces
template text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:22:48 +00:00
root 554b5a6f30 feat: refactor left panel into tabbed container with Stats + Events tabs
Extract SuperlativesPanel into content-only component, create LeftPanel
as the outer shell with two tabs (S for Stats, E for Events), and add
EventsFeed component for displaying narration events with clickable
NPC names and auto-scroll behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:19:20 +00:00
root 57695043f2 feat: add socket.io events for narration broadcast
Wire narration events through the socket layer so clients receive
real-time narration updates. Server emits narration-event on creation,
narration-update when LLM text arrives, and narration-history on connect.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:14:50 +00:00
root 37b9390c64 style: shrink NPC info panel fonts and center command panel
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:21:57 +00:00
root 6f459fa88a feat: add trunk decorations, resize superlatives panel, add LLM plan docs
- Add trunk decoration layer to GameMap and mapGenerator
- Load trunk.png asset in BootScene
- Increase superlatives panel size and font sizes for readability
- Simplify mapGenerator (remove procedural terrain features)
- Add LLM integration planning documents
- Remove stale day-night cycle worktree plans
- Update local Claude settings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:09:19 +00:00
root baeaafd372 feat: display backstory in NPC info panel with fade-in transition
Add backstory element to the Status tab between the activity label and
diamond separator. When a backstory arrives from the LLM, it fades in
with italic styling. Empty backstories remain hidden.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 16:54:56 +00:00
root 80ce9d1367 feat: integrate superlatives panel into GameScene with follow mode
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 04:48:42 +00:00
root 4fe41b7cf0 feat: add SuperlativesPanel UI component
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 04:47:22 +00:00
root b3a74e40e1 feat: add superlatives socket methods to client
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 04:45:23 +00:00
root 4d6ca21bda fix: include camera dimensions in overlay cache key for resize handling
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 04:15:12 +00:00
root 736941d190 fix: remove unused NIGHT_HOURS import and sunriseEnd variable
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 03:12:38 +00:00
root 88e560f4b4 feat: add day/night visual overlay with sunset/sunrise transitions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 03:10:05 +00:00
root 167cb514e6 fix: remove watergrass inner corner tiles from grass layer
The watergrass inner corner tiles (rows 0-1) show mostly water with a
tiny grass patch — they're designed for water tiles at concave corners,
not for grass tiles. Removing them eliminates the reddish-brown artifacts
at diagonal water-grass boundaries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:56:40 +00:00
root f1f79ed765 fix: correct dirt autotile direction and simplify edge logic
Dirt tiles (dirt-on-transparent) must be applied to DIRT tiles checking
for non-dirt neighbors, not to GRASS tiles. The previous approach had
dirt edges facing the wrong direction because the dirt island's edges
point inward from the center, not outward from the grass.

Water edges (watergrass = grass-on-water) remain applied to GRASS tiles
since the grass portion aligns correctly with the base grass layer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:50:07 +00:00
root 17621fbd59 feat: switch to LPC tileset with layered autotiling
Replace the 16x16 tileset with LPC Base Assets (32x32 tiles, 1.5x scale).
Uses a 4-layer rendering approach:
- Layer 0: solid grass base (grass.png)
- Layer 1: water transitions (watergrass.png) with LPC autotile edges
- Layer 2: dirt transitions (dirt.png) with LPC autotile edges
- Layer 3: tree canopy decorations (treetop.png)

LPC autotile format: 3x6 grid with inner/outer corners, edges, and fill
tiles. Edge tiles are selected based on 8-neighbor terrain analysis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:40:15 +00:00
root 4a2819695b feat: procedural tilemap with river, ponds, dirt, and trees
Replace colored-rectangle world rendering with a proper tilemap system
using a 16x16 RPG tileset scaled 3x. Server generates terrain via seeded
procedural generation (river, ponds, dirt patches, tree decorations) and
sends it to clients. Client renders 3-layer Phaser tilemap with
8-neighbor autotiling for water/dirt edges.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:45:09 +00:00
root 61e37bd2db feat: add ring emoji for proposals and partner bond display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:36:37 +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 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 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 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 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 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 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 4374914b29 fix: filter player entities from follow mode, remove redundant updateNeeds, show NPC name in mode text
- getNpcIds() now excludes player-controlled entities
- Remove double updateNeeds call in handleStateUpdate (updateInfo already calls it)
- Mode text shows NPC name instead of just ID

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 04:43:40 +00:00
root 03849c9505 style: EarthBound-inspired NPC info panel with doubled borders and pixel aesthetic
Authentic SNES RPG window styling: doubled rounded borders with gap,
deep indigo palette, portrait frame, diamond separators, gradient
need bars with numeric readout, diagonal shine overlay.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 04:40:11 +00:00
root dfed8401e4 feat: integrate NPC portrait panel with follow mode in GameScene
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 04:37:42 +00:00
root ffdfd1474e feat: add NpcInfoPanel HTML/CSS overlay with EarthBound-style UI
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 04:35:46 +00:00
root 1bbbba477b feat: add PortraitCompositor for layered NPC portrait images
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 04:35:20 +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 6ffa52ffba feat: implement game scene with entity rendering, camera, and input
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 20:01:59 -05:00
andy 2305b48df2 feat: add character compositor that layers skin + accessories into cached textures
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 19:13:07 -05:00
andy 8b2e895da2 feat: add client entry point, boot scene, and socket client
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:53:09 -05:00