- Fix LLM stats panel stuck on "Loading stats..." by requesting stats
immediately after admin authentication succeeds
- Add retry mechanism for backstory generation (up to 3 attempts with
increasing delays) so transient failures don't permanently skip NPCs
- Fix stale model bug: queued LLM requests now use the current model at
dequeue time instead of capturing it at enqueue time, so fallback
model switches take effect for pending requests
- Add per-template maxTokens (backstory: 350, invention: 300, desire:
250) to prevent "length" finish truncation on structured JSON responses
- Remove unused "reasoning" field from backstory prompt to reduce token usage
- Add failure logging throughout LLM pipeline (backstory null results,
queue errors) for better diagnostics
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Wire npcBrainSystem to RuntimeConstants (was using hardcoded shared imports)
- Add auth gating on admin-update-constant and admin-reset-defaults sockets
- Unsubscribe from previous tab's data sources on left-panel tab switch
- Use per-key debounce timers in AdminPanel to avoid dropped changes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace single-tile tree rendering with 6 multi-tile tree variants using
the treesnstone.png tileset. Each tree is 3 tiles wide with canopy tiles
on the decorations layer (above characters) and ground/shadow tiles on
the trunkDecorations layer (below characters). Add trunk bridge tiles
(tile 41) behind transparent canopy areas to connect canopy to ground
visually, fixing floating canopy appearance.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shows category-colored diamond bullets for active desires and
placeholder slots in the Status tab, between backstory and thoughts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
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>
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>
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>
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>
- 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>
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>
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>
- 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>
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>
- 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>
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>
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>
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>
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>
- 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>