Real-time Events
The frontend and backend communicate through WebSocket events.
Common events
| Event | Meaning |
|---|---|
TOWN_STATE |
Full snapshot when a client connects. |
NPC_MOVED |
A resident started moving toward a target. |
NPC_SPOKE |
A resident said something. |
NPC_IDLE |
A resident idled or arrived. |
NPC_EMOTE |
A resident displayed an emote. |
NPC_REASONING |
A reasoning trace for the AI panel. |
PLAYER_CHAT |
A visitor sent a message. |
CLIENT_SETTINGS |
Browser preference update such as language. |
Feed synchronization
The map bubble and Town Activity are both derived from realtime events. The feed deduplicates replayed or synchronized duplicates so one visible line does not appear several times.
Language switching
When the visitor changes language:
- the frontend sends client settings,
- backend updates preferred language,
- stale speech bubbles are cleared,
- stale old-language speech decisions are ignored,
- new NPC speech follows the selected language.