How the realm is built.
For the curious and the technical: the engine, the tools I build the world with, the database, why the only way in is a browser, and how one developer and a set of AI tools build all of it.
Dark Realms began as a SMAUG MUD. Like a lot of MUDs, it kept falling into the same trap: the vision was always bigger than what the code could do and the time there was to build it. This version is written from scratch, and no line of Merc, Diku or SMAUG code is in it. That gave me the chance to make a few big decisions early and stick to them. This page is about those decisions and why I made them.
By the numbers
All of that was built by one person in about three months. That pace isn't normal, and I won't pretend it is: it comes from building with AI tools, which I describe at the end of this page.
Figures as of December 2026.
The stack
| Game server and engine | C# 14 on .NET 10, hosted in ASP.NET Core |
|---|---|
| Realtime connection | SignalR over WebSockets, with my own versioned protocol on top |
| Game client and World Studio | React and TypeScript, built with Vite |
| Database | PostgreSQL, through Entity Framework Core |
| Website | Astro, built to static pages |
| Wiki | Wiki.js, with pages kept as Markdown in git |
Why .NET rather than C, the language of the old MUDs? Dark Realms isn't limited by raw CPU. It's a large, long-lived set of rules that have to keep working with each other for years. Strong types, mature async networking, good testing and diagnostics, and no manual memory management are worth far more to me than squeezing out the last cycle. One platform also covers the engine, the web APIs and the World Studio back end.
The engine: one writer, one order
The old MUD engines kept the whole world in global variables that any piece of code could change at any time. It's fast to write and very hard to reason about. My engine works the other way: exactly one part of the program changes the live world.
Everything else asks. The web connection, the timers, NPC behaviors, World Studio publishing and staff tools all put a request in one queue. The engine takes one item at a time, applies the rules, and emits structured events that describe what happened. Here's the path of a single command:
- 1You type
cast fireball brutein the client, or click the same thing on a panel. - 2Translate
The server turns the line into a typed action. Raw text stops here: the engine never sees it.
- 3Queue
The action joins the single queue of work for the world, together with timers that are due.
- 4Resolve
The engine checks the rules, changes the world and records what happened as structured events.
- 5Deliver
Each event goes to everyone who could perceive it, in order.
- 6Show
Your client draws the combat line, moves the health bar and updates the target panel from the same event.
- 7Save
Writers outside the game loop save what changed to the database, a moment later.
Determinism
The engine has its own simulation clock. Game rules never read the computer's clock, never sleep and never use timers that fire on their own thread. Anything due at the same instant runs in an explicit order, and randomness comes from a seeded source. Real time is measured outside the engine and fed in as "this much time has passed."
That makes a bug reproducible: the same starting world, the same commands and the same passage of time always give the same events, in the same order. Tests can run a day of game time in milliseconds without sleeping. A few "golden" tests compare a whole run, line by line, against a trace checked into the repository. Here's a piece of the engine's first one: a rejected command, then two timers due at the same instant, which run in the order they were scheduled.
seq=05 time=0000ms audience=session:…0002 type=CommandRejected command=…0003 code=fixture.denied
seq=06 time=0010ms audience=broadcast type=ScheduledDeltaApplied label=alpha delta=2 value=7 scheduled-seq=1
seq=07 time=0010ms audience=broadcast type=ScheduledDeltaApplied label=beta delta=3 value=10 scheduled-seq=2
seq=08 time=0010ms audience=session:…0001 type=SessionDisconnectRequested
seq=09 time=0010ms audience=broadcast type=EntitySurvivedDisconnect value=10Architecture tests in the build fail if engine code reaches for the wall clock, a database or the web layer.
Meaning before words
Mechanics never depend on English text. A combat round is an event with an attacker, a target, a damage type, an amount and anything special about it: a critical, a chain of hits, a stun. The sentence you read is made from that event at the very end. The same event can fill a panel, update a health bar and become a line of text, and changing the wording can never break a rule.

Content is data
Areas, NPCs, items, abilities, classes, quests and behaviors are data with stable IDs, not code. When a builder wants a greeting when you enter, a reward for handing over an item, or a guard who shouts for help, that's a behavior rule: a trigger, conditions and actions, authored in World Studio. This one belongs to the guards of a bonded warehouse at the docks, which players can rob:
{
"name": "Defense: call the guards",
"trigger": { "kind": "attacked", "arguments": { "byCharacter": "true" } },
"conditions": [],
"actions": [
{ "kind": "say", "arguments": { "text": "Thieves in the bond! Watch, to me!", "to": "room" } },
{ "kind": "call-for-help", "arguments": { "group": "ports-warehouse", "radius": "2" } }
],
"cooldownSeconds": 20,
"chancePercent": 100
}When I need something the engine can't do yet, I write that new piece in C#, test it, and then expose it to World Studio so it can be combined with everything else.
Lua, when data isn't enough
I also designed a sandboxed Lua layer for the rare cases a rule can't express. A Lua script will be able to watch events, read what it's allowed to read and ask the engine to act. It won't be able to touch files, the network, the database or the game's internals, and it runs under strict limits on time, actions and spawns. So far I haven't needed it. Some places I expect it to earn its keep:
- Puzzles with memory. A riddle chamber where the right answer depends on what the party did in the last three rooms.
- Games inside the game. A dice or card game in a tavern, with its own rules and turns.
- Encounters with unusual phases. A boss that swaps bodies with a player, or rewrites the room around the fight.
- Generated places. A maze laid out fresh for each group that enters a private realm.
World Studio
World Studio is my building tool, a separate web app with its own sign-in. Old MUDs edited the live world in place, with online creation commands. A typo could take an area down, and nothing kept a history. In World Studio, everything that makes up the world is a record with its own editor:
| The world | areas on a map canvas with floors, rooms, exits, doors and locks, the overland map, planes, continents, climates and weather |
|---|---|
| Who lives there | 2,460 kinds of NPC with stats, combat doctrine, behavior rules, shops, daily routines and spawns |
| What they carry | objects, loot tables, recipes, materials, currencies, vehicles, ferry lines and text styles |
| Who you are | species, races and classes, nearly 1,900 abilities and 2,100 effects, reactions and portraits |
| What you do | quests, achievements, deeds, Legendary talents, events, organizations, housing plots and the store |
| How it reads | help pages, socials, channels, noteboards, and the colors and styles of every kind of text |
Every editor also shows where a record is used, what's wrong with it and what changed in the current draft, and a search reaches every record in the world.




World Studio works more like source control for the world:
- Change sets. A builder opens a change set, which is a private draft copy of the whole world taken from the live revision. Nothing in a draft touches the live game.
- Validate. The draft is checked as a whole: every exit leads somewhere, every reference exists, every piece of markup is well formed. A failed check stops the publish. It never skips a broken record and hopes.
- Preview. A draft can run in its own isolated copy of the engine, with no link to the live world or its players.
- Publish. A valid draft becomes a new, immutable revision. The engine installs it into the running world as one ordered step, and refuses if, for example, it would remove a room a player is standing in. No restart.
- Roll back. Every published revision is kept. Rolling back publishes an older one through the same checks.
With more than one change set open, there was a catch. Each draft starts as a full copy of the world, so the last publish used to win. One day an import of 53 new races was published, and then an older draft that still had only 4 was published on top of it. The 53 races vanished from the live game. Now a change set that is out of date can't be published. It has to pull in what changed in production first, with a three-way merge between the original copy, the draft and the live world, and conflicts show up field by field.
Staff permissions are narrow capabilities, not the old numbered immortal levels. Reviewing, publishing, taking over or closing someone else's change set are separate permissions, and each of those actions is audited with a reason. Staff work happens on staff accounts kept apart from anyone's personal characters.
World Studio is also an API. Scripts can create and revise areas through the same change sets, validation and publishing that the editors use. The guard rule above was written by one. That's also how I bring old areas forward: read the original for its rooms, prose and ideas, then rebuild it natively, rather than porting vnums and mudprogs as they were.
The database
Durable data lives in PostgreSQL: accounts, characters, items, organizations, the world revisions, audit trails and statistics. The most important rule about it is a negative one: the database is not the game. The engine never waits on a query in the middle of a fight. It keeps the live world in memory and reports what changed.
- Write-behind. After each unit of work the engine reports a character's state as one complete snapshot: level, experience, attributes, classes, location. A writer outside the game loop saves only the newest one per character, a quarter of a second later, so a burst of changes becomes one write. Because each snapshot is complete, a retry or a replay does no harm.
- Items have one owner. Every item that has moved, changed or been made has a row, held by exactly one room, character or container. Item changes from one unit of work are saved in order in a single transaction. An item can't be duplicated by a restart, and one that was destroyed can't come back.
- The database enforces what matters. Unique names, who owns which character, one open transfer per character. Trades between two accounts lock both in a fixed order, so two at once can't deadlock or both succeed.
- Statistics are facts. Raw events are kept for 13 months and rolled into daily and lifetime totals kept forever. That's what feeds The Realm and the hiscores.
Why PostgreSQL? Most of what I store is relational and needs real integrity: ownership, uniqueness, transactions that span two accounts. PostgreSQL gives me that, plus JSON for the world-revision documents, and it's dependable and open source.
Hotboot: updates without goodbyes
Old MUDs had the copyover: the server handed its open Telnet sockets to a new copy of itself. A WebSocket can't outlive the process that holds it, so I couldn't do that. Instead a hotboot is a fast, announced restart that saves everything a player would miss.
I sort every change by how much it has to disturb. Content from World Studio goes in live, with no restart. A hotboot starts a new server on the same database. It restores a snapshot of the soft state: open doors, lit torches, weather, groups, who was sitting or sleeping. Your client pauses, reconnects on its own with a one-time resume ticket, and puts you back where you were. Only real maintenance, such as a database change the old state can't survive, needs a cold start.
The web client, and why there's no Telnet
The client is a web app. A classic command line sits in the middle, and around it are panels you can show, hide, collapse, move and resize: your character, vitals, the room and who's in it, your target, the map, quests, inventory, channels. The layout presets go from Classic (just the text and the command line) to Expanded, and room descriptions can sit in a banner above the chronicle or flow in the chronicle like a classic MUD. You can keep two characters open in tabs. A panel never invents state. Everything it shows comes from events the server sent, and if your character didn't perceive something, the panel doesn't know it either.

The connection speaks a versioned protocol. The client and server agree on a version and a set of capabilities when they connect, so a new feature can ship without breaking a client that's a release behind.
Here's the decision I get asked about most. Dark Realms doesn't support Telnet, and won't. That means no MUD clients like Mudlet or MUSHclient, no ANSI color, no VT100 screens. I actually built a Telnet connection early on, with GMCP. I retired it, for these reasons:
A game of data, not a stream of bytes
Telnet delivers a stream of characters. Everything I show in a panel (a health bar, a map, a target, a list of who's in the room) would have to be squeezed into that stream, either as text for client scripts to scrape or as GMCP side messages that each MUD client supports differently. Every feature would need two presentations and two sets of tests. When I kept the two paths in step, the terminal path slowed every new feature down and limited what I would let myself design. With one client I know exactly what every player sees.
Color that means something
ANSI color is 16 colors, or 256 at best, written into the text as codes like the old &R. The color is baked in at the moment the line is sent. My text uses meaning instead: this is fire damage, this is a god speaking, this is an epic item. Builders write it with a small markup language that has a closed set of tokens, so there's no way to slip raw HTML or styles into the game:
The bell rope hangs <bold>perfectly still</>. Under the floor,
something <damage.necrotic>cold</> is waiting. (A literal << stays a "<".)The browser applies a theme to that meaning. The theme is published with the world, so it can restyle old lines as well as new ones. It's checked for contrast, and it can never make text blink. A terminal can't do any of that.

The best items go further, with text styles of their own: real CSS, checked and scoped so it only ever reaches inside the item's name, and players can turn animation or styles off. Here's a level 200 Legendary monk looking at themself:

look self. Item names are colored by quality, and two carry text styles: the Phantasm Belt in Prism and Gungnir in Gilt.Accounts that stay safe
Telnet sends everything as plain text, including your password, and few MUD clients support encryption well. In the browser everything runs over HTTPS. Sign-in uses secure, HTTP-only cookies, and two-step authentication works the same everywhere you sign in. That includes confirming a character transfer or deletion, which in Telnet would be a password typed in the clear.
Nothing to install, nothing to configure
Anyone with a browser can play in a few seconds, on any computer. A new player doesn't have to learn a MUD client before learning the game, and I don't have to support a dozen clients with different quirks. Quick-action buttons and the action bar cover the commands you use most, and anything the client provides is within the rules.
I know this decision costs me some players who've spent decades in a favorite client, and I don't make it lightly. But one client, done properly, is how one developer can make a world this deep feel good to play.
The APIs
Everything the client does goes through the same public paths, with nothing special for my own front end:
- Gameplay runs over one realtime hub. A connection says hello, agrees on a protocol version, and then starts or resumes a session. The server assigns every session ID itself and never accepts one from a client.
- Accounts and characters are ordinary web APIs: sign-in, two-step setup, the character roster, transfers, friends, messages and profiles. Writes are rate limited, and anything sensitive asks for your password again.
- Public pages like profiles and hiscores have small anonymous, rate-limited endpoints that show only what players have chosen to make public.
- World Studio has its own API and its own sign-in, separate from playing, and every route checks a specific staff capability.
- The game data API serves the website and wiki. It needs an API key, which is stored hashed, limited to the data it may read and locked to known hosts. It reads the published world and a public snapshot refreshed every 30 seconds, never the live game loop.
The game is also connected to Discord. You can link your account, show a character card if you choose to, get private channels for your organization that follow in-game membership, and see announcements as they happen.
The website and the wiki
This site is built from the game's own data. The race and class pages come from the published world when the site is built, so they can't drift from what's in the game. Live figures (who's online, Tidings, the Chronicle, hiscores) are fetched by a small service on the server, which holds the API key and writes plain files for the site to show. Your browser never sees a key.
What's new is written from the changes I merge, rewritten for players and published an hour after release. In-game help builds an entry for every class, race, ability and area from the world itself. The wiki goes deeper, with guides I keep in git and sync to the wiki, and the site's build fails if it links to a wiki page that doesn't exist. The spoiler rule is overviews, not specifics. The wiki will tell you a boss exists and what it can drop. It won't tell you the drop rates or the answer to a riddle.
Staging, production and tests
There are two realms on the server: a test realm where new content and code are tried first, and the live one. Content is built and played on staging, then promoted to production as one checksummed world file and published through the same World Studio checks. A code release goes into its own folder with its database migrations, and a hotboot switches to it.
Behind it all are more than 8,100 automated tests: engine rules, deterministic replays, database migrations against a real PostgreSQL, the World Studio publish path, and the client's panels and protocol.
Built with AI, directed by a person
Dark Realms has one developer. A game this size, with an engine, a client, a building tool, a website and 147 areas, isn't something one person can finish alone, let alone in three months. So I'll say it plainly: Dark Realms is built with AI tools, in both its design and its code.
That doesn't mean typing "build me a MUD, make it good, no mistakes" and shipping whatever comes back. It's a workflow with checks at every step, and a human decision at the start and the end of each feature:
- 1An idea
It starts with something I want: a system, a fix from a playtest, a feeling the game is missing.
- 2A proposal
The idea becomes a written design: what it is, how it fits, what it touches, and every question that has more than one good answer. Those questions come to me, and my answers are recorded with the design.
- 3Vetting
The design is checked against the code and the other designs for accuracy and fit. Does it contradict something? Does the engine already do half of it? Is a number off?
- 4Small slices
The work is cut into pieces that can each be built, tested and reviewed on their own.
- 5Build and test
Each slice is written with its tests. The full test suite and the architecture tests have to pass, and a separate review looks for bugs before anything is merged.
- 6Agent playtests
AI helpers play the feature as players would, on a local copy of the game, and report what broke, what read badly and what made no sense.
- 7Handoff
A short document says what was built, what was decided along the way and what is still open.
- 8My playtest
I play it. If it's right, it ships to the test realm and then the live one. If it isn't, we go around again.
It's a collaboration, and it runs both ways. When the tools aren't sure about something, a rule that could be read two ways or a number that seems off, they stop and ask before building. When I don't know exactly what I want until I see it working, I play it, and we change course. Those 250-odd design documents and 130 decision records are largely that conversation, written down. A lot of the engine's discipline (one writer, determinism, golden traces, architecture tests) exists because it lets both me and the tools change a large system without breaking it.
Some people won't like that the game is built this way. Some will feel it cheapens the craft. That's a fair thing to feel, and I'm not going to hide how the game is made. But I think what counts is the result: whether the world is worth exploring, whether the systems hold together, whether it's fun. If it is, I don't think the tools should matter.
