python mudlib using telnetlib3
EmbeddedIFSession runs the hybrid interpreter in a daemon thread, bridged to the async MUD loop via threading.Event synchronization. .z3 files use the embedded path; other formats fall back to dfrotz. - MUD ZUI components: MudScreen (buffered output), MudInputStream (thread-safe input), MudFilesystem (quetzal saves), NullAudio - save/restore via QuetzalWriter/QuetzalParser and :: escape commands - state inspection: get_location_name(), get_room_objects() - error reporting for interpreter crashes - fix quetzal parser bit slice bug: _parse_stks used [0:3] (3 bits, max 7 locals) instead of [0:4] (4 bits, max 15) — Zork uses 15 |
||
|---|---|---|
| .claude | ||
| content | ||
| docs | ||
| scripts | ||
| src/mudlib | ||
| tests | ||
| worlds/earth | ||
| .dockerignore | ||
| .gitignore | ||
| compose.yml | ||
| demo_terrain.py | ||
| Dockerfile | ||
| DREAMBOOK.md | ||
| justfile | ||
| mud.tin | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
mudlib
A telnet MUD engine. No client needed — just telnet and you're in.
Built on telnetlib3, Python 3.12+, managed with uv.
Quickstart
uv sync
just run
Then connect: telnet localhost 6789
Commands
just check # lint + typecheck + test
just run # start the server
just debug # start with debug logging
just render # generate world map HTML
What's in here
src/mudlib/— the engine (commands, world, combat, rendering, storage)tests/— pytest testsworlds/— world definitions (yaml/toml)docs/— internal knowledge baseDREAMBOOK.md— vision and wild ideas
How it works
The world is a toroidal 2D grid of terrain tiles, not discrete rooms. Players see a viewport centered on their position. Terrain types have mechanics — shallow water slows you, mountains block you, forests hide you.
Combat is timing-based with telegraphed moves and cooldown management, not turn-based.
The server runs a tick-based async game loop alongside the telnet server. SQLite handles persistence. Session mode stacks filter what reaches the player depending on context (exploring, fighting, composing, solving puzzles).