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>
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>
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>
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>
- 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>
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>
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>
- 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>
- 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>
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>
- 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>