Skip to content

moongate-community/moongatev2

Repository files navigation

Moongate v2

Moongate logo

.NET 10 AOT Enabled Lua Scripting GPL-3.0 License

CI Coverage Docker Image

Moongate v2 is a modern Ultima Online server built with .NET 10, NativeAOT support, deterministic game-loop processing, Lua scripting, and a chunk/sector-based spatial world model.

Looking for Collaborators

I am actively looking for contributors and reviewers.

Quick Start

Requirements

  • .NET SDK 10.0+
  • Ultima Online data files (client)

Run Server (local)

git clone https://github.com/moongate-community/moongatev2.git
cd moongatev2
dotnet run --project src/Moongate.Server -- --root-directory ~/moongate --uo-directory ~/uo

Run Server (Docker quick start)

git clone https://github.com/moongate-community/moongatev2.git
cd moongatev2
docker build -t moongate:local .
docker run --rm -it \
  -p 2593:2593 \
  -p 8088:8088 \
  -v "$HOME/moongate:/app/moongate" \
  -v "$HOME/uo:/app/uo" \
  moongate:local

Server port: 2593
HTTP/UI API port: 8088

Default credentials: admin / password
Change them immediately from the server console with .password.

Player portal routes:

  • Dev UI: http://localhost:5173/portal/login
  • Embedded UI: http://localhost:8088/portal/login
  • Authenticated profile: http://localhost:8088/portal/profile

Run UI (dev)

cd ui
npm install
npm run dev

UI default URL: http://localhost:8088/

What Is In Scope Today

  • UO TCP server + packet pipeline
  • Deterministic single game-loop with separate network inbound/outbound workers
  • Source-generated packet/command/listener registration
  • Sector/chunk spatial system with lazy warmup and broadcast radius
  • Snapshot + journal persistence (MessagePack source-generated, AOT-safe)
  • Lua scripting runtime for commands, gumps, item/mobile behavior
  • Classic books rendered from moongate_data/templates/books/*.txt, with support for both read-only content and writable books (0x93 header saves, 0x66 page saves)
  • HTTP admin API + OpenAPI for tooling/UI
  • Web admin UI (ui/) for item templates and server/admin workflows
  • Player portal for authenticated account overview, profile editing, and password change (/portal/login, /portal/profile, /api/portal/me, /api/portal/me/password)

Project Highlights

  • Spatial model is sector-first (chunk-style), not pure repeated range scans.
  • World generation pipeline uses named generators (IWorldGenerator) and command-triggered runs (example: doors).
  • Doors support runtime open/close behavior and network updates.
  • AOT stability issue in persistence was resolved by moving to MessagePack-CSharp source-generated contracts.
  • Mobile domain model was refactored to remove Level and Experience from UOMobileEntity (they are not part of the base UO mobile model).

Screenshots

Web Admin UI

  • UI Screen 1: login and initial admin entry point. UI Screen 1
  • UI Screen 2: authenticated dashboard and main navigation. UI Screen 2
  • UI Screen 3: item templates search with image previews. UI Screen 3

In-Game Features

  • Character Creator at Docks: character creation flow and initial spawn area. Character Creator at Docks
  • Door Open/Close Fix: the bug is still there (damn doors). Door Open/Close Fix
  • Orion Lua Brain: scripted NPC behavior example (orion.lua) with speech loop (my cat is always hungry and always looking for food). Orion Lua Brain
  • Teleport Gump: Lua-driven teleport UI and location workflow. Teleport Gump

Documentation

  • Docs home: docs/index.md
  • Getting started: docs/articles/getting-started/
  • Architecture: docs/articles/architecture/
  • Scripting: docs/articles/scripting/
  • Persistence: docs/articles/persistence/
  • Networking/protocol: docs/articles/networking/
  • Operations/stress test: docs/articles/operations/stress-test.md

Published docs: https://moongate-community.github.io/moongatev2/

Benchmarks and Stress

  • Benchmarks project: benchmarks/Moongate.Benchmarks
  • Black-box socket stress tool: tools/Moongate.Stress
  • Guide: docs/articles/operations/stress-test.md

Acknowledgements

Moongate v2 is inspired by the UO emulator ecosystem.

Special thanks:

Data imported/adapted from ModernUO distribution is used in selected world datasets (decoration, locations, signs).

Star History

Star History Chart

Contributing

Contributions are welcome. Please open an issue/discussion first for non-trivial changes.

  • Follow CODE_CONVENTION.md
  • Keep tests green
  • Keep docs aligned with runtime behavior

License

GPL-3.0. See LICENSE.

About

Moongate is modern Ultima Online server built from scratch in C# with AOT compilation for high performance and nostalgic gameplay experience.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors