Show HN: Moongate – Ultima Online server emulator in .NET 10 with Lua scripting
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, KestrelWhat'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
233 points by squidleon - 135 comments
It's very different from modern games, where each player looks like the fantasy version of a Marvel super hero.
Modern MMOs are theme parks where everyone gets the same ride (with pay per win). UO was a living world where your role emerged from what you chose to do, not from a quest marker telling you where to go next.
Sort of. They disabled big parts of the "real economy" in beta. Turned out that players didn't like it that NPC shopkeepers kept standard working hours and didn't want to buy their 5000 skullcaps from their skill grinding.
Likewise they even more quickly got rid of the real ecology feature, both because it was computationally intensive but also because players would strip mine the ecology.
Players didn't buy those 5000 junk skullcaps either. They wanted stuff that was actually valuable, which meant those practice items were recycled or thrown in the trash.
I remember when the UO team added trash barrels and created the "Clean up Brittania" event. The game's servers were struggling to deal with large numbers of these junk objects that people littered on the ground so the devs decided to enlist the players' help cleaning it up, just like a real-life public park cleanup project! Players got rewarded special items based on the amount of junk they cleaned up.
But that's what I meant by "sort of", as it wasn't the pure simulation that was originally promised. Another example was that all the early dupe bugs created a real need for serious gold sinks that weren't planned into the original design.
Even WoW had a player economy via the auction house, and that's about as dumbed down as an MMO gets. Though I agree that the evolution of the player run markets, plus the eventual vendor support added by DD & crew were cool.
I've experienced it first hand, but I can't grasp why it worked well like it did.
Also there was a whole niche industry of collecting non-droppable items which spawned in the game world but were not fixed on the map (we think they were added post map creation), so they could be "pick pocketed" off the surfaces they were on and taken back to your home every wipe. There was a huge rush after servers came back on after a wipe for folks to go find the most rare items to stock up their towers and keeps.
The bugs were part of the game culture. The first time that you learned that items in the bottom right corner of your first house -- because they could be stolen through a bug even if your house was locked -- was something everyone jointly went through.
UO also had maybe the closest thing to a true player economy than any game. There was a legitimate path to making money (and having fun) to just mining ore and selling ingots. You would sell your iron bars in an unattended vendor to other players at your own price. Those bars would get bought by a blacksmith player to produce armor that they sold to other players... who would buy it to go adventuring in the dungeons.
Eve Online accomplished something a little more combat-focused, but similarly diverse in playstyle, mostly by dint of having a single large persistent world-shard with minimal functional instancing.
What do you mean by this?
I'd go a step further, not just equally compelling, but it'd be interesting to see some games, particularly RPGs, where combat is effectively optional. One of many ways to level up your character and complete the objectives of the game.
There aren't many out there where you could have a complete pacifist playthrough, for example, and if there is, you usually still have to resort to theft, or use of paralyze & calm spells.
In most RPGs your professions (farming, herbalism, mining, etc.) are just secondary skills to help you progress in combat, and all the good stuff comes from killing enemies.
But to answer your question, there are three different clusters but contradictory sets of answers. And this was the problem.
1) It was a sandbox game developed with a focus on recreate a living world. A real ecology, real economy, skill based character system instead of classes where your skills tracked what you actually did, a focus on all sorts of roles - part of the original pitch was players could be the town blacksmith or whatever. I knew someone who spent several months playing an interior decorator for instance. Some people, such as myself, were attracted to this.
2) The same freedoms from #1 attracted PvP style gamers, especially from the then nascent FPS style games. Griefing, rampant slaughter, that sort of thing.
3) It also attracted PvE players who weren't at all interested in a realistic world and demanded the sort of conveniences we see in modern MMOs: mobs pinned to locations, predictable drops, predictable quest lines, instancing, optional PVP, etc.
You'll note that most of the people you see reminiscing online are from groups #1 and #2. Group #3 by and large hated the game and left as soon as they could. And your typical group #1 player eventually got annoyed at group #2 and just left altogether.
It's a hard problem to recreate UO because of this tension. Without allowing group #2 to exist you don't have the same environment. But by allowing group #2 to exist, they'll eventually take over and chase away everyone else.
At the end of the day, UO was a game that was simply a moment in time that can never be recreated. Too much of what made it great was due to the fact that it was a new thing.
I think the barrier to entry is the equivalent of several complete, fun, balanced single player games operating together in balanced harmony. Not impossible, but highly improbable.
UO forced many different types of players to coexist in the same world that simply do not mix anymore. You had peaceful dungeon crawlers and craftsmen coexisting alongside killers, rapists, thieves (wild that stealing items from other players inventory was actually a thing, probably unheard of in today’s MMOs).
The friction between these different types of players is where the magic happened, it’s what created real conflict and higher stakes in the world. When you stepped out of your house, there was always a risk that killers could be lurking ready to murder you and loot your house dry. And if you forget to lock the door, someone passing by will clean your house out for anything valuable.
In a way, old school UO was a true Middle Ages type MMO, everything since then has only grown more civilized, more enshittified. People don’t want to pay for a world that doesn’t give a shit if they have a bad experience. The truth is though there was no “bad experience”, it was all just an experience.
The defense to this was to carry dozens upon dozens of nested bags, because each bag opening could trip the pick pocket detection.
Also the defense to your home was to literally circle it in tents/buildings creating an empty courtyard that you could only teleport into with a rune you kept safely in your bank box. There were some warping bugs that would allow you into a courtyard though, or even through the front door (circle of visibility bug, as well as floor tile warping).
I mean there absolutely were bad experiences. Griefing drove lots of players away, which is why they implemented Trammel.
You want enough friction to generate interesting interactions, you don't want so much freedom that the worst exploiters start to crowd out every honest player, because then, just like in a rundown lawless neighborhood, you're getting a lesson in the broken window theory and you're only left with the scammers.
The whole point of the game was to live in this fantasy world, not beat it. There were no quests. No antagonist. Just good and evil and everyone in between. For once I wish a studio would take this to heart and build something like that again. Minecraft exploded due to this sandbox nature. However, you still got to give players a shovel and a bucket.
I loved Everquest and World of Warcraft but those didn't feel "raw" enough for me.
The Realm is my dark horse submission for best MMO. (Yea, yea, yeah Meridian 59 and Underlight too)
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.
I think this changed during the Mondrian era but in my favorite era, SA/Renaissance, those were the baddies that made you run.
Lich King as well.
I played on the JP/KR asian servers in a PK/APK/PVP guild so maybe it was just my bubble but it was pretty common to see players with 7 skills maxed out. If I remember correctly
- sparring
- swordsman or fencing
- magic
- magic resistance
I don't remember the rest. It's not quick or easy like modern games, but we would regularly power level each other's alts and it took maybe 2 weeks to max out all 7 skills? We had a bear trapped in the guild house so we could power level wrestling and other combat skills.
It was a sad day when UO introduced Trammel.
Haven't put any time in MMORPGs for 15 years, but aren't there still "exclusive" guilds that do things regular players can only aspire to?
That game was my life. It's how I learned how to code among many other skills.
In an odd sort of way I suspect UO would have been better off had it come out a year or two earlier. It'd not have been remotely as popular, but wouldn't have attracted such a large crowd. And because they drew from a much larger crowd than the intended audience there were a lot of people who got disgruntled. But it makes sense because the game was literally not designed with their desires in mind.
This is honestly the best way I have ever heard this described! It really is that 'end of the road' feeling that I get, once I have experienced a large chunk of the game loop, that has me disconnect from games and feel hollow.
This is probably why I keep going back to huge modpacks for Minecraft with a friend. It is so open and expansive, with so much to do, that you never really feel like it's the end... You just feel like you have had your fill, until next time.
I personally only got to watch my older brother play UO, and then he brought me into the launch of WoW which was a pivotal experience. But the end game always felt like it falls flat.
>It's very different from modern games, where each player looks like the fantasy version of a Marvel super hero
But isn't this true for most games?
>UO was the only game that I've ever played where you had "commoner" players. A lot of players failed to scale up, or to obtain top notch equipment.
I guess the main example I'm thinking of is Path of Exile. There is such a massive difference between your average player and the top tier. Or even not the top tier but enthusiasts.
I mean almost by definition most people wont have top notch equipment?
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/
the big picture question is, if you can mess around with the bot to do anything, why spend it on this game? why not make your own original game instead?
I do use ChatGPT sometimes as a tool while working on the project (similar to using documentation, Stack Overflow, or an IDE assistant), but the post and the project direction are my own. So what?
In hindsight I am very glad Origin was not overly litigious and didn't send the FBI to my house for "hacking" their game.
Projects like UOX3 are a big part of the history of the Ultima Online emulator scene, so it’s great to hear from someone who helped maintain it.
One maybe obvious way would be that asking for rumors will actually creates the scenario that the NPC describes.
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?
On sector sync bursts — this is something I'm actively tuning. Right now when a player enters a new sector, we sync all ground items and mobiles in the surrounding sectors (configurable radius). For busy areas that can mean a lot of packets at once. The current approach is:
doesn't look like there is much going on to protect packet bursts there aside from smart-ish proximity sector loading. the work is done at boundry.
dove into it because i have been recently working on frustrum spawning to reduce net burst in a similar project, was kind of curious if something similar was used as a method to pre-warm the upcoming sector but I didn't catch anything.
fun and easy to read. thanks op and parent for getting me to look through it.
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...
Do you have a YouTube that shows off the progress of what's complete?
I'll probably add a short demo gif or video to the README at some point, but for now the best way to see it is to clone it and run it
All the recent LLM advances would make for very interesting and very fun NPC interactions in a MMORPG today too. Even small player community servers could be viable long term because of the ability to seed complex interactions with NPCs into on-going story lines.
Throwback!
Pretty sure I still have the source to SphereServer sitting somewhere on my NAS. It was my first exposure -- in early high school -- to coding in a group and operating a Linux server.
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.
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! ;)
I think the distinction is a lot greyer than the black/white you propose.
The very first popular online games used servers mostly to redistribute (and maybe time sync) packets from clients. There is no standard way to to do that. Player-created servers did their best to emulate the official servers logic but it was indeed impossible to replicate it perfectly.
e.g. when breaking up large maps into sectors, the official server might broadcast your location and projectiles X units away and emulators would broadcast it X + 500 units away, which could have an impact on gameplay.
Emulator feels fitting when there is no official server spec to reimplement.
edit: emulator also feels appropriate where servers are responsible for NPC activity or quest-like mechanics. This goes beyond implementing a network protocol. The gameplay is massively impacted.
You're not wrong that "server emulator" is a generically correct use of the term emulation, in the same sense that it is a correct use of the word for someone to say they emulate a fashion sense of a celebrity they like in their own wardrobe.
But in computer science, strictly speaking, the original definition of emulator was more strict. It was about things like emulating processor architecture A so as to execute programs written for it on processor architecture B.
And part of why expanding the definition to include "server emulators" annoys me is why has this definition expansion occurred only in gaming contexts? If a free UO server is a "server emulator" then why is Samba not also a server emulator? The lack of consistency is irritating to me, and it only happened because gamers like the term emulator, not due to any kind of rigorous computer sciencey reason.
This is interesting to me, if only because it's such a natural bit of slang. Given that it's a shortened form of "charisma", this one just Makes Sense to me! I figure it'd be incredibly cringe for me to use at my age, but it's a good term IMO.
There's been research by linguists (John McWhorter comes to mind) analyzing this phenomenon and it basically just comes down to the fact that as we age, we get more set in our ways, so the linguistic innovations that younger people do just have a tendency to annoy us, even when they logically follow or are objectively useful.
I try not to let it bother me, because it's irrational to feel that way, but it just does lol
I don't know if there are "family-friendly" presets for such things, but so far Copilot has been reasonably helpful at helping me along -- I just don't have it all working yet. If you have any resources you come across, I would be interested in comparing notes. :)
They've reworked a lot of systems and it's basically 100x better than original UO.
There are several systems in place, which original devs wouldn't even dream of and saying that, official Ultima Online is still running. :D
It's PvP server, but with balanced PvP which really works for everyone. Not like original devs, they just dropped PvP because cookie-cutter players cried.
Personally though, I feel they've overengineered it a bit. So many custom systems layered on top that it starts to feel more like WoW with UO graphics than actual UO. The original charm was in the simplicity you, a sword, and a world that didn't care about your feelings. But that's just my taste, and clearly thousands of players disagree with me, so what do I know. And yes, the fact that official UO is still running in 2026 is both beautiful and insane
I recently tried https://www.classicuo.eu/ ClassicUO, and the nostalgia was incredible. Granted it is not playable, but there is something about that experience that all of the assistants, hotkeys, etc. fail to capture.
Dead on.
I spent many many hours in UO when I was young.
It was so great playing in some shards with hundreds of real persons.
"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
Are there UO clients besides the official one?
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.