Show HN: Moongate – Ultima Online server emulator in .NET 10 with Lua scripting (github.com)
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.
41 comments
[ 3.5 ms ] story [ 56.7 ms ] threadDo you have a YouTube that shows off the progress of what's complete?
Obligatory nitpicky aside, a time-honored tradition of HN:
I've long been irritated by the use of the term "server emulator" in gaming contexts. Technically these projects are just reimplementations of a proprietary networking protocol. Nobody calls Samba a "server emulator" because it reimplements the Windows file sharing protocol, because Samba isn't "emulating" anything from the perspective of the traditional definition of "emulator" in computer science.
But for some reason, I guess because "emulator" has colloquially been redefined by non-CS nerd gamer normies as a term for software that lets you play proprietary games on platforms they were not designed for, we have ended up in this new status quo where the term's definition has expanded in this game of telephone way that annoys mainly me and not many other people.
And what's kinda funny is I say that it is a "new" status quo, but it's not even that new. I recall, what, like 20 years ago now I was in an edit war on Wikipedia fighting with people over the "server emulator" article, insisting that the term was technically inaccurate and should not be used. Unsurprisingly in retrospect, I lost that edit war.
Nowadays the whole thing feels like my first "old man yells at cloud" moment, of which I'm sure I'll experience more as I age. I certainly do find new slang introduced by gen Z like "he got the riz!" to be quite cringey, so it looks like I'm well on my way to getting crotchety and terrible about the natural evolution of language! ;)
It's very different from modern games, where each player looks like the fantasy version of a Marvel super hero.
It sounds like a fan-driven reboot of this game has a fairly decent following, in a very similar way to what UO experiences? It feels like there is still player desire to have mundane sorts of immersive RPG experiences in this way.
This endeavour sounds a whole lot like a server emulator for Infantry Online that was started by an incredibly talented developed 16 years ago ("aaerox"). I found the original svn commit on Sourceforge [1]. It's since moved to GitHub but has been active for 16 years and it has much of the same functionality you've already built, but done by more than a dozen developers over a decade-and-a-half.
Kudos to you. You've gotta explain how you've managed to do so much all by yourself.
[0] https://github.com/moongate-community/moongatev2/graphs/cont... [1] https://sourceforge.net/p/infserver/code/1/
Curious about the sector-based delta sync — how do you avoid packet bursts when a player enters a busy area with lots of items and mobiles?
Also interesting to see NativeAOT used here. Was that mainly for deployment simplicity or performance?
"Who owns the UO IP now and how litigious are they?"
Ultima Online launched in September 1997. The first "offline emulator" launched in October. Emulators became playable by mid 1998. https://www.uox3.org/history/timeline.txt
My brother and I bought IX when it was released but it was a buggy nightmare so we gave up and never experienced Ultima proper. However, my brother and his friend got into UO and played a ton. His friend was a greifer at the time going by the name SirDarkSpell and supposedly made a bit of a name for himself. This was around 2000 or so? I bet the two of them would love to hear about this project as both of them have fond memories of UO.
Anyway. Might just throw my weekend into the Stygian Abyss...
I spent many many hours in UO when I was young.
It was so great playing in some shards with hundreds of real persons.
I've been building a MORPG version of a kind of Ultima 3.5 on the side in spurts for the last 5 years using Go, postgres, and React on the frontend. Top view tile graphics, old school keyboard control/commands. It's pretty janky still, but I hope to do a Show HN at some point.
I think I need to take some inspiration from you and partition the world into sectors, I have a n^2 scaling problem right now as there are more PC and NPC in the world.
In hindsight I am very glad Origin was not overly litigious and didn't send the FBI to my house for "hacking" their game.
When I was in high school, I played a lot of UO. It was actually the last computer/video game I ever played regularly, because I convinced myself as a teenager that I was addicted to it and needed to drop it "cold turkey" to focus on academics and extracurriculars.
(A sign of the times for the late-1990s nostalgics: I sold my UO account on eBay for a few thousand dollars and an MTG Mox Pearl. I owned a bunch of virtual real estate, e.g. a UO tower on an island only accessible via moongate. The high bidder "threw in" a Mox Pearl as a kind of informal escrow, to make sure I completed the account transfer after getting paid.)
Before I dropped UO from my life, I discovered UOX. I was learning C++ and UOX was a great way for me to practice my emerging C++ skills.
My clearest memory of feeling the power of programming was when I created a mod for my UOX server that allowed me to drop an unlimited number of interconnected and color-coded moongates all over my server, creating something akin to the feeling of the game "Portal," but long before Valve released "Portal."
It was after having a blast with UOX that I decided to dig into programming much more. Somehow, the UOX server mod made programming feel "real" for me in the way my prior forays into coding simply didn't.
That led to me learning Python -- as a way of toying around with the Slackware Linux server I had in my basement. I left C++ behind, but it was an important stepping stone for me. Now, decades later, learning Python was probably the single most important decision of my life in childhood. (See e.g. https://amontalenti.com/about)
UOX is such a cool project. UO was a really ahead-of-its time internet game, as well. Great memories. Thank you.
Are there UO clients besides the official one?