← All games
Active October 2026

DalilaMud

An Italian text-based multiplayer RPG (MUD) — a heavily customized CircleMUD 3.0 fork, rescued from its old VM, moved onto a database, and now running around the clock on my NAS.

Web · Telnet

CMUDCircleMUDDockerSQLite

What it is

DalilaMud is a MUD — a Multi-User Dungeon, a fully text-based role-playing game where multiple players explore and live in the same world by typing commands. It’s a heavily customized, Italian-language fork of the classic CircleMUD 3.0, grown one system at a time over the years.

Playing

▶ Play in your browser — just open the page, nothing to install. If you prefer a MUD client (telnet, Mudlet…), connect to gioca.dalila3.it, port 4000. The game also has an official site, www.dalila3.it, with a guide to the world, the rules and a map of the realm.

The customizations

On top of stock CircleMUD, a lot of bespoke systems have been built:

From VM to git (2026)

For years the code lived only on a VM, edited live. In 2026 I copied it into a local dev environment, put it under git for the first time, and ported it to build natively on macOS/clang (the source was written in decades-old C conventions). During the import I also tracked down and fixed a couple of historical oddities — including a bug that bloated the saved-”mob” file enormously because it wrote uninitialized memory to disk: fixed with a simple memset before saving.

From files to a real database

The four flat-file save systems (characters, objects/houses, saved mobs and shops, mail/boards/clans) were replaced, one at a time, with SQLite: a pragmatic approach with columns for the fields the game actually queries (level, class, last login…) and JSON for everything else (stats, skills, active effects), so adding a new field stays a code change rather than a schema change. The nice part: all persistence for each subsystem funnels through a handful of functions — I rewrite those without touching the hundreds of call sites scattered across the rest of the code.

Importing the old files (written by a 32-bit build, with a different binary layout than today’s 64-bit one) meant decoding them by hand, byte by byte. That turned up a couple of long-standing bugs nobody had noticed before — including a silent mail-loss issue affecting a quarter of the players, caused by a mix-up between a character’s in-memory slot position and its permanent id — fixed along the way.

Stronger passwords

With the data now on a database, I took the chance to also rebuild password handling from scratch, which had been tied to a weak cipher only available on Linux. It now uses PBKDF2-SHA256, implemented in-house and verified against the standard’s test vectors, works identically on Mac and NAS, and automatically upgrades each player’s old password the next time they log in — no action needed on their part.

Always on: from the Mac to the NAS

The final step was to stop having the MUD run only when my Mac happens to be on. It now lives in a Docker container on my Synology NAS, managed through Container Manager. An automated pipeline keeps it up to date: tagging a new version triggers a GitHub Actions build that publishes the image, and the NAS periodically checks for a newer version and updates itself, with regular database backups and an email alert if anything goes wrong.

A graphical interface for Mudlet

MUDs have always been played with a plain telnet client, but the server can now do more: alongside the text it sends structured data over the GMCP protocol — health, room and exits, inventory, channel messages — that a modern client can turn into a graphical interface. Players still on telnet get exactly the same text as before. The game text is ISO-8859-1, and for clients that ask for it the server converts it to UTF-8 on the fly, so accented letters come out right everywhere.

For Mudlet I wrote a package that adds:

There’s no need to even download it: when Mudlet connects, the server announces the package and Mudlet installs it and keeps it up to date on its own. If you prefer, you can download DalilaMud.mpackage and install it by hand from Mudlet’s Toolbox → Package Manager → Install.

Play in the browser

The same GMCP data also drives a web client: a small Python gateway, in a second container on the NAS, turns each browser’s connection into telnet towards the game and relays it over a WebSocket, and the page shows the text with its colours, the command line and the health, mana and movement bars. The NAS publishes it over HTTPS through the DSM reverse proxy, with a Let’s Encrypt certificate. The game still sees each player’s real address: the gateway tells it, and the server only believes the gateway.

The web client isn’t just text: it has channel tabs (private, group, clan, public), an objects panel with the same actions as the Mudlet package, and a canvas map — the wilderness as tiles, with visited rooms added as you go, remembered in each player’s own browser. Below 900 pixels wide (a phone), chat, map and objects move behind two buttons. The server also answers MSSP requests, the protocol public MUD listings use to read a game’s details, so the game can be listed on public MUD directories.

The visited-room map is now kept on the server, per character, instead of only in the browser: the gateway learns the character’s name from the game itself (the only one that can say it, so a browser can’t write someone else’s map), sends the map at login, and saves it as you explore. Walking by keyboard works here too: Shift plus the arrows (as well as Option/Alt and the numeric keypad), while the plain arrows stay what they’ve always been, for the cursor and history. If the connection drops while you’re in game, the browser reconnects on its own with increasingly spaced retries — unless you’ve just left on purpose.

Lost accents and a world that updates itself

The game is in Italian, yet for decades anyone typing “è” or “à” had them silently dropped: input only accepted ASCII. Now the server decodes whatever arrives — UTF-8, latin-1 or cp1252 — into the game’s internal format, turning curly quotes, ellipses and dashes into plain ASCII. One trap: old passwords had been saved with the accents already stripped, so the check retries a version without non-ASCII characters.

Hunting for other accent problems turned up an old wound: in six world files the accented letter had been replaced by the Unicode replacement character (about 455 times, “sommità” turned into “sommit�”). The original letter was gone for good, so the words were rebuilt one by one in the game’s style. Alongside that, a clean-up of the boot log: 211 mobs with a “special behaviour” that was never written, boards in a zone that isn’t loaded, and an object that was never made.

That raised a problem: the NAS data volume was seeded from the image only once, so fixes to the world never reached production. The answer is a three-way sync at every start- up: it compares the live file, the one in the image, and the one applied last time. If it changed only in the repository, it’s replaced (keeping a backup copy); if it changed only in the game, it’s left alone; if it changed in both, the game’s version stays, the new one is saved aside and flagged in the log. It’s needed because the game itself rewrites some world files — player constructions, shops bought in-game — and a plain “overwrite everything” would have wiped them.

A bug born in the port: settings read sideways

The game’s settings file — probabilities, mob speed, how fast skills improve — was a C structure written to disk as-is by a 32-bit build. On 64-bit, the spare padding made it bigger than the file (171,824 bytes against 137,624), and since the port day, 22 September, the values were read shifted and the general ones came out as zero. Among the effects: worn equipment was damaged every combat round. I fixed the sizes, added a compile-time check, and moved the settings into the database, with saveable profiles, importing the old files value by value. To make up for gear that had already worn out, there’s a Quest Master command, riparatutto, that restores a character’s objects. In the same vein, a string copy on overlapping buffers made every set command abort on macOS, and set and trust on an offline character wrote to a file that was never opened: both fixed.

A shared map, and a world that can grow

Mudlet and the web client now share the explored map. At each entry the game generates a random token, valid for twenty-four hours after its last use, with which Mudlet downloads and uploads the map from the gateway; for each area the version with more rooms wins, so nothing explored is lost.

The wilderness can grow too: the map’s size and origin are no longer constants in the code but data, and the world can expand up to 1000×1000 squares without renumbering any existing room. Measured on a test copy: at start-up 0.5 seconds and 45 MB for today’s 200×200 map, 1.1 seconds and 327 MB at 1000×1000. Filling it with content is still to do.

Three planes from the Commedia: Inferno, Purgatorio, Paradiso

The chosen way to grow the world isn’t one enormous map but several planes: every wilderness-type zone is a plane of its own, with its own map and geometry, and Mudlet draws each in a separate area. On top of this structure I’m building three planes inspired by Dante’s Divine Comedy, for levels 45 to 70, reached from Daresia: Inferno (45-55), Purgatorio (55-63) and Paradiso (63-70). Names and characters are the Commedia’s, but every text is original — no rights-covered modern translations.

All three planes are now complete. The Inferno runs from the Antinferno to the ice of Cocytus, with rivers to cross in different ways (paying a toll, showing proof, slaying the guardian), and a Virgil who accompanies whoever reaches the bottom and gives them the key to climb. The Purgatorio has the seven terraces, the fire and, at the mountain’s top, the Earthly Paradise: two rivers cutting through the forest, Matelda, the procession and a group boss, the Drago del Carro, whose defeat opens the way to the heavens. The Paradiso is a 181×181 map with a hub, the Eterna Margarita, where you meet Beatrice, and nine heavens to climb one after another, each kept by a guardian who wants the trophy of an elite enemy and in exchange gives the heaven’s light, all the way to the Empyrean and the final trial.

Because walking in circles killing monsters would be boring, every walkable circle has eight themed towers, one per compass point, each an area of twenty to thirty rooms over several floors, with its own creatures and a lord at the top: the Paradiso brings the total to eighty towers. One rule I set myself: no figure repeats across the planes — not among creatures, loot or verses — and a script checks it before every addition.

The tower lords and Lucifer himself were too easy, so in v1.49 I turned them into real bosses. The tower lords (56 in the Inferno) shield themselves out of combat, and in combat take turns knocking down the tank, tripping another attacker, disarming, or casting fire spells on a random attacker, and heal when close to falling. Lucifer has 30,000 hit points, a fire shield and, every other round, the wind of his six wings on the whole group, a frost breath, a crushing blow on one attacker, paralysis on anyone who isn’t the tank; below a third of his life he feeds on a sinner and recovers 10%.

Whoever wins the final trial doesn’t go home empty-handed: the graces of the Empyrean go to the whole group present at the victory, as random equipment — Light, Splendour or Glory, in order of rarity — bound to the character, who can keep several but wear only one. The planes’ keys are taken away. The maps of Inferno, Purgatorio and Paradiso are also on the game’s site, with a caption for each circle.

A crash only Linux could see

Right after releasing the version with the Earthly Paradise’s towers, the game on the NAS began restarting forever, with a free(): invalid pointer error just after loading the social messages. The culprit was an old bug: the loader wrote past the end of a table, because the file held entries that are real commands, not socials. It had never shown on the Mac; Linux’s library only noticed once the bigger world had shifted the heap. I ran the game under AddressSanitizer, which found five more memory errors that had lurked for years, and then two use-after-free bugs in the periodic update. The lesson: before every release, a pass with the tools that check memory, because “it works on the Mac” means nothing.

Who’s playing? Telegram notifications

Running a MUD also means noticing when someone logs in. The server now posts to a private Telegram group on every login and every new character, with the client used (telnet, Mudlet or browser), and on every exit too. The game doesn’t talk to Telegram directly: it fires a single UDP packet at the web gateway, fire-and-forget, so if the receiver is down the game never notices. The gateway sends at most one message per character every ten minutes (otherwise constant reconnects would flood the group) and rereads a settings file on every event, where someone can be excluded — me, for instance — without restarting anything. Every morning a report summarises the server log’s errors (counted by kind, with addresses masked), crashes and restarts, or says all is well; a crash sends the last log lines at once. Staff events also arrive (immortals’ commands worth knowing, like shutdowns or edits to a character) along with great feats, such as a boss of the three planes beaten by a group. From the group, /echo sends a message to every connected player (“Important message from the STAFF”), with the sender kept only in the log. Bug reports written in-game land in the same group, with the room and the text, from anyone; and typing /chi in the group makes the bot ask the game who’s connected and reply with the list. The group deletes messages after a week, and the server’s logs are pruned beyond six months, as stated in the site’s privacy policy. One instructive stumble: local tests against a fake plain-HTTP Telegram went perfectly, but in production the minimal image lacked the certificates for outgoing HTTPS connections, and the messages didn’t go out until I added them.

Twelve thousand rooms to check, by machine

Walking around the game I noticed quite a few wrong exits, and in mid-October I decided to check them all. I wrote a script that reads only the world files actually loaded (about 12,400 rooms in 315 files) and classifies the problems: exits to rooms that don’t exist, probable typos (another room with a nearby number leads back), doors on one side only, exits whose counterpart leads elsewhere, one-way exits, loops and mazes. A second script draws the areas the way Mudlet does, so errors can be spotted by eye. Typos and doors were fixed, and 136 new rooms came out of the check. One instructive case: the passage of Minos in the Limbo went north, but the threshold is on the north side and the second circle lies toward the centre, that is south: it had been backwards from the start. About six hundred one-way exits remain to be reviewed by hand, often intentional.

Beyond level 70: the Nine Worlds

Level 70 was the ceiling, with immortals starting at 71. To let mortals grow, I moved the immortals’ ranks up to 1001-1021 (with a one-time migration of every saved immortal, their items and board messages) and raised the mortal ceiling to 100. That meant widening experience to 64 bits (level 100 needs about 35 billion points, with a curve that grows 13% per level), writing 30 new practices for levels 71-100, five per order plus a level-100 special with neutral names, and widening hit points past 32,767 — a 50,000-hp boss had been killed by a single blow, because the number overflowed. The change also fixed a latent bug: mobs of level 92-100 were reading past the end of the level tables.

Over level 70 the way goes Norse, built from the Eddas (public domain, no modern versions). From a small island southwest of Daresia, ringed by reefs, Heimdallr guards the Bifrost and stops anyone below level 70; a ferryman takes you there for a rune bought from a wandering seller, one rune per crossing, with the return free. Beyond lies a plane of islands floating in the sky, 220×220 cells generated by a script: Asgard at the centre, around it the other realms, joined by the great ash Yggdrasil. Step past an island’s edge and you fall into the void: everything is lost, like a classic death trap, and you’re reborn in Valhalla. The plane is now complete: Asgard, Alfheim, Vanaheim, Svartalfheim, Jotunheim, Niflheim, Muspelheim and Helheim, each with four to six mythic places — the hall of the fallen, the giants’ yard, the forge of Volundr — an inn and a shop. Every realm beyond Asgard is reached from one of Yggdrasil’s branches, guarded by a figure of the myth who wants a token won in the previous realm. And since levels 71-100 would otherwise be reached by repeating the same kills, experience is locked by realm: above level 73 it comes only from the new worlds, with a ceiling for each, up to Helheim for the last stretch.

The last level isn’t given for free. Whoever collects the experience for 100 stays at 99 and is taken, a few seconds after logging in, to the mirror of Hel: a double of themselves, with the same equipment and ten percent stronger. A detail I had to fix by hand: monsters fight with their own dice, so a double of a martial artist hit far weaker than the real thing, and now each of its blows is worth at least 1.1 times the average of yours. Win and you’re level 100, announced to the whole game and to the Telegram group; lose and the gods “do not yet consider you worthy”: no corpse, experience back to the start of level 99, Valhalla. The Nine Worlds also have their own equipment, and the gods can give gifts that vanish when they’re no longer needed.

Middangeard: levels 100 to 200

Level 100 was no longer the end either. The next world is Middangeard, the Old English word for the land of men, and it draws only on sources in the public domain: the Kalevala, Beowulf, the Norse sagas, Irish myth. (I checked the copyright question first: Tolkien’s names are not free to use, but the Eddas he read are.) It’s a 260×260 continent, ten regions of ten levels each, again with experience locked region by region, and the way in is always from Daresia: a boat leaves from the eastern port and takes only whoever is level 100 or more. Die there and you’re reborn in the first village, but keep your equipment; the borders are open sea, not a void. For this the mortal ceiling went to 200, with the experience curve and the titles stretched by 5% a level.

Middangeard is now complete: all ten regions are open, each reached by a token won in the previous one.

The last level works like the mirror of Hel: whoever has the experience for 200 stops at 199 and is raised only by defeating Tethra, the lord of the last island. Every region also has its own road joining the main places, as Daresia has between its towns: a rule I made for every new map after noticing the Nine Worlds had none.

The crafts of the planes grow along: each region brings new materials (bog iron, birch, amber, then linden, garnet, steel; barrow iron, yew, jet, and so on up to the clover and pearls of the Isles) and workshops where they’re worked, so a crafted item matches or beats a lord’s loot.

A mistake worth telling: Väinämöinen’s boat sailed from the pier of the port, but the pier hung from the old harbour, replaced by a newer map, so nobody could walk to it. I’d placed the figure without ever walking there from a public place. Now a test does the walk.

From passing rooms to real places

There’s a limit I recognised looking at Middangeard after finishing it: many of its areas were three to five rooms, enough for a map and a boss, too few to feel like a place. So I decided to enlarge every area: villages and halls of twelve to fifteen rooms, fighting areas of twenty to twenty-five, the lords’ areas around thirty, over several levels when the geography calls for it (Vipunen’s tomb spans three floors, Angantyr’s barrow four). In all, Middangeard grew from about 210 to about 1,280 rooms. The new rooms have hand-written texts, one by one, and generic creatures that rise in level towards the bottom of each area, with a bit less experience and no special loot; the old rooms keep their numbers, so nothing that existed breaks. An automatic check verifies that every room is reachable and exits are one step away, to keep the maps clean. I wrote the ten regions one after the other, from Vainola westwards to the Blessed Isles, and released them together as v1.78. Then came the Nine Worlds, with the same method: forty-three areas that went from 153 to about 890 rooms, the lord of each world with a hall of thirty rooms (Valhalla, the throne of Surtr, Lyngvi…), the one-room inns grown to ten, the world tree Yggdrasil to twenty along its trunk and branches. They came out as v1.79. The check that walks every room from the map cell took almost an hour on the two thousand rooms, and under load some tests failed for no real reason: run again with less parallelism, they all passed. Along the way the automatic checks caught a few traps, such as creatures whose names clashed with those of the named figures of their area, which the generator now refuses to create.

Smaller changes along the way

Status

The migration is complete: no game state is read from the old flat files any more, everything lives in the database and runs steadily on the NAS, currently on v1.79. The old import files remain only as a historical backup, no longer read by the game.

Stack

C · CircleMUD 3.0 · Docker · SQLite · GMCP · Lua (Mudlet) · Python (aiohttp) · WebSocket · GitHub Actions · Synology Container Manager