Top
Best
New

Posted by squidleon 16 hours ago

Show HN: Moongate – Ultima Online server emulator in .NET 10 with Lua scripting(github.com)
I've been building a modern Ultima Online server emulator from scratch. It's not feature-complete (no combat, no skills yet), but the foundation is solid and I wanted to share it early.

What it does today: - Full packet layer for the classic UO client (login, movement, items, mobiles) - Lua scripting for item behaviors (double-click a potion, open a door — all defined in Lua, no C# recompile) - Spatial world partitioned into sectors with delta sync (only sends packets for new sectors when crossing boundaries) - Snapshot-based persistence with MessagePack - Source generators for automatic DI wiring, packet handler registration, and Lua module exposure - NativeAOT support — the server compiles to a single native binary - Embedded HTTP admin API + React management UI - Auto-generated doors from map statics (same algorithm as ModernUO/RunUO)

Tech stack: .NET 10, NativeAOT, NLua, MessagePack, DryIoc, Kestrel

What's missing: Combat, skills, weather integration, NPC AI. This is still early — the focus so far has been on getting the architecture right so adding those systems doesn't require rewiring everything.

Why not just use ModernUO/RunUO? Those are mature and battle-tested. I started this because I wanted to rethink the architecture from scratch: strict network/domain separation, event-driven game loop, no inheritance-heavy item hierarchies, and Lua for rapid iteration on game logic without recompiling.

GitHub: https://github.com/moongate-community/moongatev2

240 points | 135 commentspage 3
tamat 12 hours ago|
Is the UO protocol documented?

Are there UO clients besides the official one?

DeathArrow 14 hours ago||
I like seeing how more projects use .NET, which is a great platform.
squidleon 14 hours ago|
Thanks! I've been developing in .NET for 20 years and it's come a long way , from the Windows-only Framework days to what it is now. NativeAOT, cross-platform, incredible performance. And if you've never tried it on Apple Silicon the M4 chips are absolutely insane. The server compiles to a single native binary and runs like a dream on ARM.
oblio 30 minutes ago||
Have you built mobile apps with it?
jajuuka 13 hours ago||
This is super cool. Never played UO myself, but had friends who did. I'll be keeping an eye on this as someone interested in the private MMO server community. Hope others can contribute and build this up even more.
7bit 10 hours ago||
Cool Project. How did you know how to talk to clients?
stackghost 13 hours ago||
Impressive work! Does it support the smooth boat movement packets from the newer clients?
kpw228 13 hours ago||
panda king
bhekanik 14 hours ago||
[flagged]
squidleon 13 hours ago||
hank you! That separation was a very deliberate choice I've seen firsthand how quickly things degrade when packet handling leaks into game logic.

You're touching on a real pain point. Right now the Lua boundary does show measurable overhead under load, especially with per-tick callbacks across many entities (doors, spawners, etc.). MoonSharp's interop cost adds up when you're calling into Lua thousands of times per tick.

I'm actively looking at batching script invocations per tick and capping the budget so a heavy script wave can't blow up tail latency. The goal is to keep the game loop deterministic if Lua eats too much of the tick budget, defer the rest to the next tick rather than letting the whole loop stall.

It's one of those problems where the architecture gives you a clean place to solve it (the boundary is explicit, so you can meter it), but the solution still needs work. Appreciate you calling it out — good toknow others think about the same tradeoffs.

jasonjayr 13 hours ago||
Luanti(previously Minetest) does a similar trick: c++ core/game engine, but all the game logic is in lua.
DigiEggz 11 hours ago||
[dead]
kpw228 13 hours ago|
[flagged]