{"slug": "hallow-mud-a-halloween-mud-where-gemma-invents-the-one-ghost-we-didn-t-write", "title": "Hallow Mud: a Halloween MUD where Gemma invents the one ghost we didn't write", "summary": "A developer built Hallow Mud, a text MUD set in 1870s Swede Hollow, Saint Paul, in which every NPC is played by an open-weight Gemma model and the game invents one unscripted character, the Stranger, at the start of each session. In one test run Gemma created Astrid Nylund, a rifle-carrying woman who confronted the lamplighter about what had changed in the Hollow. The project runs Gemma 3 12B locally on an RTX 4080 at about 40 tokens/s or Gemma 4 31B via the Gemini API, and is built as a fork of the LlamaTale engine.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine](https://dev.to/challenges/hacktoberfest-week4-2026-10-26)*\n\n**Hallow Mud** is a text MUD set on All Hallows' Eve, 1870, in Swede Hollow: the ravine in Saint Paul, Minnesota, where Swedish immigrants built shacks along Phalen Creek. The dead of the Hollow are back tonight:\n\nEvery NPC is played by an open-weight model. You talk to them in plain language; they answer in character, remember you, react to each other, and some of them wander the Hollow on their own. The model rewrites every room description when the server starts, so each night's Hollow reads differently, and all players share it, so looking around never waits on the model.\n\nAnd then there is **the Stranger**. We didn't write them. At the start of each game, Gemma gets the story context and one question: *\"Someone is here tonight who no one in the Hollow has ever seen before. Who are they?\"* Whoever it invents steps out of the fog, and the rest of the cast has to deal with them. In one test run Gemma created Astrid Nylund, a woman with a rifle, who walked straight up to the lamplighter and started questioning him about what had changed in the Hollow. Nobody scripted that.\n\nThat's my take on *Ghost in the Machine*: a ghost that literally comes from the machine.\n\n**Play it** in two places. Pick a name, create a character, and you're in the Hollow with whoever else is online on that server.\n\n*A minute in the Hollow on the local server: Brita and Näcken each answer within about fifteen seconds.*\n\nI think it's really fascinating to see the generated conversations, but don't take my word for it, try it out!\n\nA Halloween text MUD set on All Hallows' Eve, 1870, in [Swede Hollow](https://en.wikipedia.org/wiki/Swede_Hollow,_Saint_Paul), the Swedish immigrant ravine in Saint Paul, Minnesota. The dead of the Hollow are back tonight, and every one of them is played by [Gemma](https://ai.google.dev/gemma).\n\nBuilt for the [Hacktoberfest Open-Source AI Challenge, Week 4: Ghost in the Machine](https://dev.to/challenges/hacktoberfest-week4-2026-10-26).\n\nThe game engine is a fork of [LlamaTale](https://github.com/neph1/LlamaTale) by neph1, itself built on [Tale](https://github.com/irmen/Tale) by Irmen de Jong. Our changes live on the [`hallow-mud` branch of tobese/LlamaTale](https://github.com/tobese/LlamaTale/tree/hallow-mud).\n\n**Gemma, two ways.**\n\n`gemma3:12b` on Ollama, on a gaming laptop (RTX 4080, 12 GB VRAM), with the game server running right next to it. I benchmarked Gemma 3 12B, Gemma 4 12B and Gemma 4 26B-A4B; Gemma 3 12B with an 8k context fits fully on the GPU at about 40 tokens/s, which is fast enough that NPCs answer while the scene is still fresh.`gemma-4-31b-it` through Google's Gemini API (OpenAI-compatible endpoint). Slower, but noticeably better prose, and it needs no GPU, so it's the backend for the always-on server on Render.\nSwitching between them is one line in `llm_config.yaml`.\n\n**The engine.** LlamaTale is a MUD engine where the LLM narrates, plays NPCs, and builds world content through JSON-schema structured output. The story itself (zone, NPCs, quests, Swedish 1800s items such as the *lie* scythe and the *folkdräkt*) is plain Python in `story/`.\n\n**The look.** Each NPC has a portrait and each room a picture, in the style of hand-tinted 1870s tintypes. Gemini's image model painted them in advance, from the same descriptions Gemma plays the characters from (the script is in `tools/paint_resources.py`). The Stranger can't be painted in advance, so the game paints their portrait the moment Gemma invents them, before they step out of the fog. The web client is restyled in Hacktoberfest's colours and fonts.\n\n**What I had to fix along the way** (all on the fork, each with tests):\n\n`say to <npc>` never reached the NPC, and NPC names matched case-sensitively`<thought>` blocks leaked into the game text; they're now stripped`ERROR IN DRIVER MAINLOOP`; now the NPC just stares, lips moving, and no words come`/private/etc`, plus test fixes for Python 3.11+` look` asked the model to rewrite the room for that one player, so players queued behind each other for 20 to 30 seconds; now each room is rewritten once when the server starts and shared, and looking around is instant\nTwo fixes went upstream as PRs: [#145](https://github.com/neph1/LlamaTale/pull/145), which neph1 has merged, and [#146](https://github.com/neph1/LlamaTale/pull/146).\n\n**The whole stack is open, so I could fix it instead of working around it.** Tale is a MUD framework from the 2010s, LlamaTale adds the LLM layer on top, and Hallow Mud is a fork of that. When the engine got something wrong, like NPCs never hearing `say to`, I fixed it in the engine, with tests, and sent the fixes back upstream. One has already been merged.\n\n**Open weights are faster here, not just cheaper.** Gemma 3 12B runs on the laptop next to the game server, so an NPC answers in about ten seconds. The same conversation through a hosted API took close to a minute. For a game, that's the difference between talking to someone and waiting for a letter.\n\n**Open weights mean no bill per word.** Running locally there is no per-token cost, so the NPCs can gossip with each other, rewrite the rooms and react to everything all night long without anyone watching a meter.\n\n**One model family, two places to run it.** The same Gemma runs on my own GPU and on Google's API, so moving between them is a line in a config file, not a rewrite. The always-on server uses the API; the fast one uses the laptop.\n\n**Small stories get to exist.** Swede Hollow was a ravine of Swedish immigrant shacks in Saint Paul, cleared in 1956 and a park today. No product team would build a game about it. Open tools let one hobbyist do it in a few days.\n\nThe whole project started from this prompt to Claude Code:\n\nHallow Mud\n\nThis project is meant to be a contribution to Hacktoberfest:\n\n[https://dev.to/challenges/hacktoberfest-week4-2026-10-26](https://dev.to/challenges/hacktoberfest-week4-2026-10-26)\n\nMy idea is to build a LLM Mud with Halloween Theme\n\nMud LLM Base\n\n[https://github.com/neph1/LlamaTale](https://github.com/neph1/LlamaTale)\n\nor\n\n[https://www.fluffos.info/](https://www.fluffos.info/)\n\nTry to figure out how the llm actually is involved.\n\nThe back story:\n\n[https://en.wikipedia.org/wiki/Swede_Hollow,_Saint_Paul](https://en.wikipedia.org/wiki/Swede_Hollow,_Saint_Paul)\n\nThe NPCs I think should be based on the inhabitants from there that now are ghosts, zombies, werewolfs, vampires or similar.\n\nWeapons and armour could be based on Swedish 1800s things:\n\nFolkdräkter\n\nLie, Sledgehammer\n\nAnd other things along that line.\n\nIn the challenge there are a number of prize categories, if we can find a match that would be a bonus.\n\nThe one that caught my eye is gemma.\n\nFor the local llm, we have q-bert, if MACHINES.md isn't in the global dirs, check sibling project systema-naturae.\n\nLets dive into the MUD!\n\nThe Dungeon Master\n\nBesides some python version issues, that basically made a running system.\n\nFrom there the session kept going: the fixes to the engine listed above (two of them sent upstream as pull requests), the Stranger, the portraits, the theme, and the two public servers.\n\nWhen the autumn is advancing, the wind is howling and Halloween is nigh, then the mood is set for a real adventure with terrifying encounters...\n\nWhen attending Uni, my friends and I were playing MUDs a lot. Today, I mostly play FFXIV, with stunning graphics and really advanced fighting. But it is the spirit of the game that matters, and MUDs still have it! \n\nCoding has been done in really advanced environments like Visual Studio or JetBrains' many tools. Visual Studio Code was sort of a step backwards to a text editor, of course with plugins and tools for almost anything.\n\nNow, I am sitting with a command prompt again, but with agents it can do about anything! \n\nAnd the terminal cursor really calls for an entry of *hallow-mud*.\n\nI recently stumbled on a MUD with an LLM, and this challenge felt like a perfect fit!\n\nAnd for a Swede, I thought that Swede Hollow would be a good setting.\n\n**Best Use of Gemma**: every NPC, every room description, and the Stranger are Gemma, run locally on Ollama or hosted via the Gemini API. (The pictures, including each night's portrait of the Stranger, come from Gemini's image model.)\n\n**Best Use of Render**: Render is the game's AI runtime and hosts its front end. The multiplayer server runs there as a Docker web service, built from the repo and deployed on every push to `main`: it runs the game, calls Gemma through the Gemini API for every NPC, room and Stranger, paints each night's Stranger, and serves the web client players connect to. See the `Dockerfile`.", "url": "https://wpnews.pro/news/hallow-mud-a-halloween-mud-where-gemma-invents-the-one-ghost-we-didn-t-write", "canonical_source": "https://dev.to/tobeseuser/hallow-mud-a-halloween-mud-where-gemma-invents-the-one-ghost-we-didnt-write-1fbd", "published_at": "2026-10-30 22:30:48+00:00", "updated_at": "2026-10-30 22:49:41.352468+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-agents", "ai-tools", "generative-ai"], "entities": ["Gemma", "Google", "Ollama", "LlamaTale", "Hacktoberfest", "Swede Hollow", "Render", "Gemini API"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/hallow-mud-a-halloween-mud-where-gemma-invents-the-one-ghost-we-didn-t-write", "markdown": "https://wpnews.pro/news/hallow-mud-a-halloween-mud-where-gemma-invents-the-one-ghost-we-didn-t-write.md", "text": "https://wpnews.pro/news/hallow-mud-a-halloween-mud-where-gemma-invents-the-one-ghost-we-didn-t-write.txt", "jsonld": "https://wpnews.pro/news/hallow-mud-a-halloween-mud-where-gemma-invents-the-one-ghost-we-didn-t-write.jsonld"}}