An AI-enabled engine for building multiplayer text worlds.
Download MegaMOO Source on GitHub
Questions and help:
GitHub Discussions
— ask anything, including the basics. Answers stay public and searchable.
Chat:
the MegaMOO Discord
— for hellos, works in progress, and thinking out loud.
MegaMOO is a text-based virtual world engine — the LambdaMOO model rebuilt from scratch in Python 3. It hosts a shared, programmable world that players connect to over telnet or websocket, where they move between rooms, handle objects, and talk to each other. Builders and programmers extend that world while it is running, by writing code directly into the live database.
It combines the object-oriented model LambdaMOO proved in 1990 with modern
Python: asyncio networking, SQLite persistence, and the full
standard library available inside the world's own code.
MegaMOO keeps what makes a MOO a MOO — objects carrying their own properties and verbs, single-parent inheritance, programming the world from inside it while it runs — but verbs are written in Python rather than the MOO language. Existing MOO code does not run unmodified and has to be ported. Because the object model carries over unchanged, that work is mostly mechanical substitution inside the verb bodies.
A browser client is included. Start a world with
--web and players can play it in a browser with no client to
install — a terminal with colour and clickable exits, a map that draws
itself as they explore, and their own triggers and aliases in Lua or
JavaScript. Telnet players and browser players share the same world.
See The Web Client.
MegaMOO is one Python process and one database file. Installing it is
pip install megamoo, and that is the whole of it: the engine
has zero third-party dependencies, so there is nothing
further to satisfy — no web server to configure, no database server to
administer, no build step, nothing to compile. (The one vendored library
anywhere in the project is the Lua interpreter the browser client's
optional scripting host uses; it ships as a static file.)
That matters more than it sounds. It means a world costs nothing to keep
running and can live on a laptop or the cheapest VPS you can rent. The
running world is a single file you can copy; the source you write —
verbs/ and game/ — is an ordinary directory that
belongs in git. And you can run five worlds at once on one machine without
them interfering with each other.
MegaMOO exposes its live world through a local API, so an AI assistant can work inside the running game rather than guessing at it from source files. Connected that way, an assistant can read what an object really holds, write a new command, run it as a test character, read exactly what the game printed back, and check the log when something breaks — then fix it, with the world still running and players still connected.
The engine's design happens to suit this unusually well. Every command is a short, self-contained Python file with a fixed set of variables available and no imports to resolve, so a single command is a small, bounded problem — the kind an assistant handles reliably. World-building stops being a slow edit–restart–reconnect loop and becomes a conversation.
| Verb code is pure Python | No purpose-built MOO language to learn. |
| SQLite persistence | Your whole world is one portable file. |
| Hot reload | Change a command; the next player to type it runs the new version. No restart. |
| ANSI colour | 16, 256, and hex RGB. |
| MUD protocols | GMCP, MSDP, MSSP, MXP. |
| Browser client | Terminal, automap and player scripting, served by the game itself. |
| Effects and tickers | Timed buffs, debuffs, and scheduled behaviour. |
| Accessibility | Per-player screenreader mode that strips colour and decoration. |
Why a world that contains its own code is the right shape for building virtual places.
ThenCreating a world of your own, starting it, playing in a browser or over telnet, and running several at once.
BuildHow a name is assembled, how players refer to things, and the commands that make them.
BuildDigging rooms, connecting them, and the messages players see as they move.
BuildWhere commands live, staff authority, and giving one object behaviour of its own.
BuildHow players find out how your world works — and why commands document themselves.
OrganiseReserving a block of numbers so a zone stays together.
Bring to lifeTickers and effects — things that happen without a player typing anything.
Bring to lifeEdibles, drinkables and the merchant system.
ReferenceEvery staff command, grouped by what it is for, with the level each one needs.
ReferenceImporting an old database, the staff commands you already know, and porting MOO verb code to Python.
ReferencePlaying in a browser, the out-of-band data stream, player scripting, and extending the client yourself.
The chapters teach by example; the
Command Reference lists every staff command
in one place. For the engine itself — the object model, the parser, verb
types and the systems underneath — see the developer manual in
docs/manual/.