This document summarizes the architecture currently implemented in this repository.
For current operational details, see docs/PROJECT_STATUS_2026.md.
- Browser client (
client/) runs Babylon.js, HUD/UI, and WebSocket protocol handlers. - Server (
server/) runs Express + WebSocket and the authoritative simulation loop (WorldTick). - Data/content layer is JSON-first via
game-data/, optionally replaced at runtime by a published content pack.
- Client sends
login/input/move_intent/interact/attack/use_skillmessages over WebSocket. - Server validates and routes messages in
GameWebSocketServerandWorldTick. WorldTickruns periodic simulation updates (players, NPCs, systems, events).- Server broadcasts
entity_sync, status updates, and subsystem payloads. - Client updates world state and Babylon scene from authoritative sync payloads.
server/src/core/WorldTick.ts: main orchestrator.server/src/networking/WebSocketServer.ts: WS connection and protocol transport.server/src/modules/npc/*: NPC runtime, memory, relationships, heuristics.server/src/modules/ouroboros/*: autonomous world-agent loop.server/src/modules/quest/*+questline/*: quests and questlines.server/src/modules/world/*: world/chunk/weather/object systems.server/src/modules/combat/*,loot/*,inventory/*,skill/*: combat and progression.server/src/modules/vote/*,warfront/*,core/WorldBossDungeonSystem.ts: live event systems.server/src/modules/content/*+api/adminContentRoute.ts: admin content and GLB management.server/src/modules/playtester/*: autonomous playtester and monitor/stream stack.server/src/modules/gameplay/GameplayFusionDirector.ts: quest echo + adaptive profile + construction contracts integration.
client/src/main.ts: application boot.client/src/engine/babylon/*: Babylon rendering and asset loading.client/src/core/MMORPGClientCore.ts: sync/state integration with renderer.client/src/networking/websocketClient.ts: WS protocol client.client/src/ui/*: HUD, panels, mobile controls, overlay components.client/src/playtesterMonitorViewerMain.ts: lightweight monitor viewer.client/src/playtesterRenderPublisherMain.ts: render publisher for monitor stream mode.
- Auth provider in current client runtime: Supabase (
client/src/config/gameAuth.ts->supabase | none). - WS auth verification on server: Supabase JWT settings via
.env. - Persistence drivers implemented server-side:
auto | postgres | file.autochooses Postgres when DB is configured, else file fallback.
- Source content root:
game-data/. - Optional published content root:
published-content/current/withUSE_PUBLISHED_CONTENT=1. - Asset path conventions:
/assets/models/...for client-facing model URLs.- Optional
/world-assets/...static serving for mirrored/source assets.
- PM2-managed Node server on VPS.
- CI/CD workflows trigger verification and deployment on
main. - Environment is controlled by
.envon server, template indeploy/.env.production.template.