Commit Graph

74 Commits

Author SHA1 Message Date
root 45ecad89bb fix: store tooltip cleanup functions and call on destroy
Prevents orphaned tooltip divs when panels are torn down while
a tooltip is visible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:31:58 +00:00
root 3ae0d55f72 fix: prevent orphaned tooltip divs on rapid mouse re-entry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:29:15 +00:00
root ad80d63763 feat: add hover tooltips to NPC info panel tabs and stat abbreviations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:28:30 +00:00
root 57be76443c feat: add hover tooltips to left panel tabs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:27:28 +00:00
root 9165758e67 feat: add tooltip utility for hover labels
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 19:26:38 +00:00
root 34aca29082 fix: sleep emoji, invention history race condition, and gathering stuck state
- Add persistent 💤 emoji over sleeping NPCs (tracks sprite position)
- Buffer history events (inventions, narration, stockpile) in SocketClient
  to fix race condition where data arrived before GameScene handlers registered
- Fix NPCs getting stuck on 'gather' goal: tree trunks are both obstacles
  and resource tiles, so pathfinding always failed. Now findNearestResource
  returns adjacent walkable tiles for non-walkable resources, and
  gatheringSystem checks adjacent tiles. Added wander fallback when
  pathfinding to any gather target fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:57:50 +00:00
root 3294879bab fix: address code review findings for sleep system
- Fix NpcInfoPanel activity label: rest→sleep (functional bug)
- Remove unnecessary array spread in mapGenerator reserved set
- Remove unused SLEEP_NIGHT_END constant

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:02:04 +00:00
root 65ee23c5be refactor: remove rest POIs from map generation, persistence, and client rendering
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:58:02 +00:00
root c0e015e6e5 fix(client): resolve three TypeScript type errors
Add missing Vite client type declarations, fix canvas-to-HTMLImageElement
cast in CharacterCompositor, and use proper Stats/StatName types in
NpcInfoPanel instead of loose Record<string, number>.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:23:48 +00:00
root afbf85d7ff feat(client): improve day/night cycle and add time indicator
Fix vertical line artifacts in nighttime overlay by using a single
rectangle for full night and a base+sweep approach for transitions.
Increase night darkness from 0.3 to 0.45 for more distinct nighttime.
Add a time indicator bar at top-center showing day/night progress
with sun/moon icons matching the EarthBound-inspired UI style.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:19:05 +00:00
root 067976f9a2 feat(client): rework NPC panel tabs to vertical left-edge S/R/H/I style
Replace horizontal Status/Relations/History tabs with vertical single-letter
tabs (S/R/H/I) on the left edge of the panel. Add dedicated Inventory tab,
removing inventory from the Status tab. Panel structure reworked to flex row
with tab column + panel body, matching the LeftPanel's tab styling but mirrored.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 02:59:22 +00:00
root 797ea2d410 feat(client): wire StocksPanel into LeftPanel with R tab
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 02:55:52 +00:00
root 3dbf5b707b feat(client): add StocksPanel UI component
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 02:55:47 +00:00
root 803e6c9b8c feat(client): add stockpile socket callbacks to SocketClient
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 02:55:44 +00:00
root 9f77a84d6f feat(server): add pickup system for NPC stockpile material retrieval
NPCs can now retrieve crafting materials from stockpiles instead of
always gathering raw resources. The industry system checks if a
stockpile has needed materials before falling back to gathering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 02:52:37 +00:00
root d5ad7d5f7f feat(client): wire InventionsPanel into GameScene
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:46:21 +00:00
root e27f2381eb feat(client): add inventions tab with notification dot to LeftPanel
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:45:10 +00:00
root 6b932d12a7 feat(client): add InventionsPanel UI component
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:44:30 +00:00
root 01e6d9c526 feat(client): add invention event/history callbacks to SocketClient
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:43:38 +00:00
root c7bf7c9ef4 feat(client): add Phase D UI integration (D.1-D.3)
- D.1: Inventory display in NPC info panel (two-column grid below stats)
- D.2: Activity labels for gather/craft/build/dropoff goals
- D.3: Gold color for invention events in feed, lightbulb icon in history

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:13:15 +00:00
root 2abcb7b1e1 feat(client): render stone terrain tiles as gray overlays
Stone tiles now display as gray rectangles with darker borders instead of
being hidden under the base grass layer. Also treats stone as a land tile
for water edge autotiling so water/stone boundaries render correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:52:10 +00:00
root 7194321e1b feat(memory): add client memory events, History tab in NPC info panel
Wire SocketClient to receive memory-event and memory-history socket
events. GameScene stores per-NPC memory events and updates the info
panel in follow mode. NpcInfoPanel gains a third "History" tab showing
a reverse-chronological event log with emoji icons per event type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:02:16 +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 daddf2583d feat(thought): wire client socket, GameScene thought handling, emoji animation, and info panel display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:12:00 +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 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