Anyworld, a self-hosted multiplayer text RPG where a local LLM is the Dungeon Master

Wait 5 sec.

Hey everyone, I’ve been working on a game called Anyworld. It’s a browser-based multiplayer (single player also supported) text adventure inspired by the early days of AI Dungeon, especially its browser-based free version AI Dungeon 2. The setup is pretty straightforward: one person hosts the server and runs the model via llama.cpp (OpenAI or other cloud APIs are also supported, and great for non-English play!), and your friends join through a browser link. The host sets the scene and the goals, players type out their actions, and the LLM acts as the DM to resolve the chaos and drive the story. Admittedly the host requires some technical skills with Python, and possibly with networking (opening routes to the hosted game via VPN, port forwarding etc.). I'll work on this as well as the development continues. Using Docker was suggested in another subreddit, so I'll definitely consider that, as it would allow including both the llama.cpp backend, recommended model and configurations etc., in addition to the game itself. Instead of pasting the entire repo documentation, here are the main features right now: How it plays True multiplayer resolution: Players submit their actions, and the model resolves the whole round together. It actually accounts for characters interacting or getting in each other's way. Real dice rolls: When an action is uncertain, Python handles the actual RNG math. The model just takes those hard dice results and narrates the consequences. Custom scenarios: You write the setting, characters, and opening state. It isn’t limited to fantasy. Party chat: There's an OOC chat separate from the game events so you can talk without the LLM reading it. Zero setup for players: No one but the host needs to install anything or run a model. It works on desktop and mobile browsers. DM Tools & Hidden Mechanics Private DM guidance: As the host, you can feed the model hidden info; NPC motives, secret rules, or where you want the story to go. Secret triggers: You can set up one hidden percentage roll per game (e.g., If a player enters a building, there's a 20% chance the building collapses on the player). Python rolls the probability in the background, and if it triggers, the model weaves the consequences into the story without showing the players the underlying math. Under the Hood & Memory Context management: It budgets the context window and uses a structured memory system. Older rounds are compressed into world states, player facts, and unresolved threads. It also does a secondary model pass to audit those summaries so it doesn't accidentally delete important facts. Language support: If you use the OpenAI backend, you can play in non-English languages (the narration and outcomes will naturally follow whatever language you wrote the scenario in). Note: The local llama.cpp backend currently instructs the model to narrate in English. This is because the local models my development PC can run were terrible with any other language than English. Session recovery: Disconnected tabs auto-rejoin. If someone accidentally closes out, they can log back in and their unfinished actions and history are waiting for them. Self-signed certificates for HTTPS-enabled connections: The game creates self-signed certificates upon launch, which enable encrypted connections. The problem with self-signing is that joining players receive a warning that the site may not be secure. However, most browsers allow the players to continue to the game despite the warning. This is a suboptimal way to handle HTTPS, so I'll work on a more robust solution at some point. It’s still a work in progress. Right now, a server only runs one game at a time, and if you restart the server, the live session is lost (it generates HTML/JSONL transcripts, but they aren't loadable save states yet). The overall story quality is also going to heavily depend on which model you use and how you tweak the settings. Suggested model: During development, I used llama.cpp and Gemma 4-26B-A4B Q4 with a context size of 128k and found it to be more than an adequate backend for functioning as the DM. Even the speeds are fast enough with my RTX 5070 Ti 16 GB that round resolutions take only 5 or so seconds. The specific model I used and can recommend: https://huggingface.co/EZForever/gemma-4-26B-A4B-it-qat-uncensored-heretic-UDmerge-GGUF (the model was great at following instructions and remembering plot points even with longer contexts) Recommended parameters for Gemma 4 models: - temperature 1.0 - top-p 0.95 - top-k 20 - min-p 0.0 - presence-penalty 0.0 - repeat-penalty 1.0 Of course, feel free to try your own models! AI use disclosure: I used Alibaba Cloud's Qwen 3.8 27b and OpenAI's GPT-5.6 Luna and GPT-6 Astra models to help develop the game. How to run: Read INSTALL.md to set up, configure and run the game. README.md contains some details on how the game functions. I'll post a link to the repository in the comments. I'll post the link to the repository in the comments. Some gameplay in Finnish with OpenAI's Luna: https://preview.redd.it/08f8zljik8th1.png?width=1837&format=png&auto=webp&s=0c34f119d460eb970253ebe182e4381325a3ac09 The game is MIT licensed, so open source all the way. Forking or collaborating is encouraged. I'd love to hear some feedback, and I hope someone finds the game fun to play!   submitted by   /u/northpoler [link]   [comments]