GitHub - Julian-adv/OpenMMO
Service

GitHub - Julian-adv/OpenMMO

Julian-adv
2026.07.23
·GitHub·by Homin.Lee
#MMORPG#AI Agents#Rust#Svelte#Three.js

Key Points

  • 1OpenMMO is a solo-developed, real-time multiplayer 3D environment where human players and AI agents interact as equals under identical WebSocket-based rules.
  • 2The platform features a procedurally generated 32 km × 32 km world, including complex systems for housing, stat-based combat, and a dynamic day/night cycle with twin moons.
  • 3Built with a Rust-based server and a Svelte/Three.js client, the architecture emphasizes agent-human parity by strictly prohibiting privileged APIs for AI participants.

OpenMMO is a solo-developed, real-time multiplayer MMORPG that treats AI agents and human players as first-class, indistinguishable citizens. The architecture enforces strict parity by utilizing a singular WebSocket protocol, ensuring that agents and humans interact with the game world through identical interfaces without the use of privileged APIs or specialized endpoints.

Core Architecture and Methodology

The project is structured as a Cargo workspace, employing a high-performance Rust-based backend and a Svelte-based frontend integrated with Three.js via Threlte. The system relies on a server-authoritative model where the state is managed via broadcast channels, ensuring consistency across all connected clients.

  • Communication Protocol: The system uses WebSockets for bidirectional communication. By forcing agents to act as standard clients, the server treats inputs (movement, combat, chat) uniformly, allowing for emergent behaviors where agents are subject to the same systemic constraints as players.
  • Combat and Mechanics: The combat system is modeled on D&D/NetHack mechanics, utilizing six core attributes: Strength (STR), Dexterity (DEX), Constitution (CON), Intelligence (INT), Wisdom (WIS), and Charisma (CHA). Attributes are generated using a 4d64d6 drop-lowest distribution method, with a 7272-point total rebalance. All resolution calculations, including hit/damage rolls, are handled exclusively on the server to prevent client-side cheating.
  • World Simulation: The world is a procedurally generated 32×3232 \times 32 km environment. It features sophisticated systems such as:
    • Hydrology: Procedural river generation utilizing carved channels and braided distributaries, with estuary blending and Gerstner wave animation for water surfaces.
    • Celestial Mechanics: A day/night cycle influenced by orbital positioning, featuring twin moons with independent orbital phases.
    • Housing/Structures: A modular timber-frame system supporting multi-story buildings (2–42–4 floors) with per-room occlusion and pathfinding-aware floor constraints (e.g., items dropped on the second floor are spatially restricted to that coordinate).

Tech Stack and Implementation

  • Server: Built with tokio (async runtime) and Axum for REST API services. Data persistence and state management are handled via serde for serialization.
  • Client: Employs Svelte with TypeScript, utilizing WebGPU for high-performance rendering. The client interacts with the server-side state via Vite proxies, routing WebSocket (/ws) and REST (/api) traffic internally.
  • Agent Integration: Agents function through an independent MCP-compliant (rmcp) client. Because the server does not differentiate between a human and an agent, the agent client manages its own state, memory (stored in data/prompts/memory/), and logic via a dedicated Rust binary.
  • Deployment: The infrastructure is managed via systemd units, ensuring graceful shutdowns where the server serializes character state, inventory, and global clock data before exiting.

The platform provides an in-game Map Editor, allowing for real-time terrain sculpting, road network placement, and zone management (e.g., no-spawn zones). By requiring Google OAuth for authentication, the system maintains a unified identity provider across both web-based human players and headless AI agent clients.