Two important changes today: fixing a critical NPC movement bug and standardizing all game content to English.
Bug Fix: NPCs Frozen in Multiplayer
NPCs stopped moving when Firebase multiplayer was enabled. Root cause was a race condition in the host election system:
- After
initMultiplayer(),mp.enabledistrueimmediately butmp.isHoststaysfalseuntil the async Firebase host election callback fires - During this window, the condition
if (!mp || !mp.enabled || mp.isHost)evaluates tofalse--updateNpcs()is skipped - Additionally, stale host entries from crashed sessions could make the current player permanently "non-host" while no actual host is broadcasting NPC data
Fix: Added shouldRunNpcSim getter to the multiplayer module that tracks:
hostResolved: whether host election has completedlastNpcSyncAt: timestamp of last NPC data received from host- Falls back to local NPC simulation if no host sync received within 5 seconds
English-Only Standardization
Since multiplayer brings together players from different regions, mixed Korean/English content created a confusing experience. All game content is now English-only.
Changes Across 11 Files
| Area | What Changed |
|---|---|
| Default language | 'ko' → 'en' in main.js |
| NPC names | Korean → romanized English (Dokkaebi, Haru, Byeoli, etc.) |
| 25 regex patterns | Korean topic/sentiment/action detection → English equivalents |
| LLM prompts | Removed Korean prompt variant; English-only prompts to Gemini |
| Tag parsing | [부탁:] → [request:], [동행] → [follow], [안내:] → [guide:] |
| HTML template | All Korean button/label defaults → English |
| Language selector | Removed from name modal (English-only) |
| Place aliases | Korean → English (공원→park, 광장→plaza, etc.) |
| 200+ code comments | Korean → English across all source files |
| Farewell detection | Korean patterns → English patterns |
| Personality matching | Korean traits → English (밝→bright, 조용→quiet, etc.) |
NPC Name Mapping
The village characters keep their Korean-origin names, romanized for readability:
| ID | Name | Role |
|---|---|---|
| guide | Yujin | Village guide (docent) |
| yoo | Hyogon | Village developer |
| heo | Dokkaebi | Ghost story lover |
| kim | Haru | Optimistic daydreamer |
| baker | Milsuni | Bakery owner |
| barista | Mocha | Cafe barista |
| grandpa | Neuti | Village elder |
| ... | 18 more | Various roles |
Files Modified
src/playground/main.js-- NPC names, default lang, regex patterns, all commentsserver/llm-proxy.mjs-- Removed Korean prompts, unified to Englishsrc/playground/systems/conversation.js-- Korean regex → Englishsrc/playground/core/constants.js-- Place aliases, all commentsplayground/index.md-- HTML template defaults to Englishsrc/playground/systems/tag-game.js-- Commentssrc/playground/systems/weather.js-- Commentssrc/playground/systems/guide-greeting.js-- Commentssrc/playground/systems/npc-data.js-- Commentssrc/playground/renderer/renderer.js-- Commentssrc/playground/renderer/entities.js-- Comments
What's Preserved
- The i18n system infrastructure remains (for potential future localization)
- Korean translations kept in
i18n.jsas reference - Village lore and cultural identity maintained through romanized names
Build passes all 7 verification checks. Net result: -227 lines (removed redundant Korean prompt variant).