Skip to main content

A modern Python port of the ROM 2.4b6 MUD engine with full telnet server and JSON world loading

Project description

QuickMUD - A Modern ROM 2.4 Python Port

Version Python 3.10+ License: MIT Tests ROM 2.4b Parity Function Coverage Integration Tests

QuickMUD is a modern Python port of the legendary ROM 2.4b6 MUD engine, derived from ROM 2.4b6, Merc 2.1 and DikuMUD. This is a complete rewrite that brings the classic text-based MMORPG experience to modern Python with async networking, JSON world data, and 100% ROM 2.4b behavioral parity.

🎮 What is a MUD?

A "Multi-User Dungeon" (MUD) is a text-based MMORPG that runs over telnet. ROM is renowned for its fast-paced combat system and rich player interaction. ROM was also the foundation for Carrion Fields, one of the most acclaimed MUDs ever created.

✨ Key Features

  • 🎯 100% ROM 2.4b Behavioral Parity CERTIFIED: Official certification with comprehensive audits (see certification)
  • 🚀 Modern Python Architecture: Fully async/await networking with SQLAlchemy ORM
  • 📡 Multiple Connection Options: Telnet, WebSocket, and SSH server support
  • 🗺️ JSON World Loading: Easy-to-edit world data with 352+ room resets
  • 🏪 Complete Shop System: Buy, sell, and list items with working economy
  • ⚔️ ROM Combat System: Classic ROM combat mechanics and skill system
  • 👥 Social Features: Say, tell, shout, and 100+ social interactions
  • 🛠️ Admin Commands: Teleport, spawn, ban management, and OLC building
  • 📊 Comprehensive Testing: 3,508 / 3,521 tests passing (99.6%) across unit, integration (1,000+), and command-registry suites
  • 🔧 ROM C-Compatible API: Public API wrappers for external tools and scripts (27 functions)

📦 Installation

For Players & Server Operators

pip install quickmud

Quick Start

Run a QuickMUD server:

Telnet Server (port 5001):

python3 -m mud socketserver
# or
mud socketserver

⚠️ macOS Users: Port 5000 is used by macOS AirPlay Receiver (Monterey+). QuickMUD defaults to port 5001 to avoid conflicts. To use a different port: python3 -m mud socketserver --port 4000

WebSocket Server (port 8000):

python3 -m mud websocketserver
# or
mud websocketserver

WebSocket dependency note: browser WebSocket clients require Uvicorn to have a supported WebSocket implementation available. If /ws upgrade requests fail, install one of:

./venv/bin/python -m pip install websockets
# or
./venv/bin/python -m pip install 'uvicorn[standard]'

SSH Server (port 2222):

python3 -m mud sshserver
# or
mud sshserver

All servers provide:

  • ✓ Game tick running at 4 Hz
  • ✓ Time advancement
  • ✓ Mob AI active

Connect to the server:

Via Telnet:

telnet localhost 5001

Via SSH:

ssh -p 2222 player@localhost
# Note: SSH username/password are ignored; MUD authentication happens after connection

🌐 Web Interface

QuickMUD includes a WebSocket server, but the browser interface lives in a separate companion project so this engine repo can remain the canonical, ROM-faithful Python backend.

Recommended layout:

~/dev/projects/
  rom24-quickmud-python/
  quickmud-web-client/

The browser client should connect to:

ws://127.0.0.1:8000/ws

Browser Client Setup

From the companion quickmud-web-client repo:

cd ~/dev/projects/quickmud-web-client
npm install
npm run dev:all

That workflow:

  • starts this QuickMUD engine's WebSocket server
  • starts the frontend development server
  • opens the browser client against the local /ws endpoint

The browser client is intended to follow the same ANSI, account login, account creation, character selection, and in-game command flow as telnet/SSH rather than using a browser-only shortcut login path.

Companion Repo

The web interface is intended to live in a separate repository named quickmud-web-client. Keep that project focused on browser UX, terminal rendering, reconnect behavior, and login flow while leaving gameplay and ROM parity logic in this backend repo.

🏗️ For Developers

🏗️ For Developers

Development Installation

git clone https://github.com/Nostoi/rom24-quickmud-python.git
cd rom24-quickmud-python
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e .[dev]

Running Tests

pytest  # Run all 3,500+ tests
pytest tests/integration/ -v  # Run integration suite (1,000+ tests)

Development Server

python -m mud  # Start development server

🎯 Project Status

  • Version: 2.6.73 (Production Ready — gameplay parity shipped, OLC cluster in progress)
  • ROM 2.4b Gameplay Parity: ✅ 100% (official certification) — combat, skills, spells, movement, communication, world/db, save/load, mob programs, and all 255 ROM commands are implemented and audited.
  • ROM C Source Audit: 34 of 43 ROM C source files audited (24 at strict 100%); remaining work is the OLC editor cluster (olc.c, olc_act.c, olc_save.c, olc_mpcode.c, hedit.c) plus a small partial-audit tail (board.c 95%). Several audited files sit at 85–98% with deferred-by-design or sibling-gated gaps (act_move.c, comm.c, nanny.c, const.c, music.c, board.c). Gameplay is not blocked on any of them. See docs/parity/ROM_C_SUBSYSTEM_AUDIT_TRACKER.md.
  • ROM C Function Coverage: 96.1% (716/745 functions mapped)
  • Test Suite: 3,508 / 3,521 passing (99.6%), 11 skipped, 2 known pre-existing failures, full run ~8 min. Three layers — unit (tests/test_*.py), integration (tests/integration/, 1,000+ tests), and command-registry (test_all_commands.py). Pre-existing skips/failures are catalogued in docs/parity/PRE_EXISTING_FAILURES_TRIAGE.md.
  • Active focus: olc.c cluster — OLC-020/022/023 + STRING-001..012 closed; remaining CRITICAL gaps (OLC-016/017/018/019, the *edit create subcommands) gated on the held olc_act.c sibling audit.
  • Compatibility: Python 3.10+, cross-platform

🏛️ Architecture

  • Async Networking: Modern async/await with Telnet, WebSocket, and SSH servers
  • SQLAlchemy ORM: Robust database layer with migrations
  • JSON World Data: Human-readable area files with full ROM compatibility
  • Modular Design: Clean separation of concerns (commands, world, networking)
  • Type Safety: Comprehensive type hints throughout codebase

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please read our Contributing Guidelines and feel free to submit pull requests.

📚 Documentation

Official Certification

User Documentation

Developer Documentation


Experience the classic MUD gameplay with modern Python reliability! 🐍✨

For a fully reproducible environment, use the pinned requirements files generated with pip-tools:

pip install -r requirements-dev.txt

To update the pinned dependencies:

pip-compile requirements.in
pip-compile requirements-dev.in

Tools like Poetry provide a similar workflow if you prefer that approach.

Run tests with:

pytest

Publishing

To release a new version to PyPI:

  1. Update the version in pyproject.toml.
  2. Commit and tag:
git commit -am "release: v1.2.3"
git tag v1.2.3
git push origin main --tags

The GitHub Actions workflow will build and publish the package when the tag is pushed.

Python Architecture

Game systems are implemented in Python modules:

  • mud/net provides asynchronous telnet and websocket servers.
  • mud/game_loop.py drives the tick-based update loop.
  • mud/commands contains the command dispatcher and handlers.
  • mud/combat and mud/skills implement combat and abilities.
  • mud/persistence.py handles saving characters and world state.

Start the server with:

python -m mud runserver

Docker Image

Build and run the Python server with Docker:

docker build -t quickmud .
docker run -p 5001:5001 quickmud

Or use docker-compose to rebuild on changes and mount the repository:

docker-compose up

Connect via:

telnet localhost 5001

Data Models

The mud/models package defines dataclasses used by the game engine. They mirror the JSON schemas in schemas/ and supply enums and registries for loading and manipulating area, room, object, and character data.

Project Completeness

QuickMUD is a production-ready ROM 2.4b MUD with ✅ 100% behavioral parity to the original ROM 2.4b6 C codebase:

✅ Fully Implemented Systems

  • Combat Engine: Complete ROM combat mechanics with THAC0, damage calculations, and weapon special attacks
  • Skills & Spells: All ROM skills and spells with correct formulas and targeting
  • Character System: Classes, races, advancement, equipment, and encumbrance
  • World System: Area loading, room resets, mob/object spawning, and JSON world data
  • Shop Economy: Buy/sell with pricing formulas, shop restocking, and inventory management
  • Communication: Say, tell, shout, channels, and 100+ social interactions
  • Mob Programs: Complete trigger system with conditional logic and ROM API
  • OLC Building: Area/room/mob/object/help editors with save/load functionality
  • Admin Tools: Teleport, spawn, ban management, wiznet, and debug commands
  • Networking: Async telnet, WebSocket, and SSH servers with game tick integration

📈 Quality Metrics

  • Test Suite: 3,508 / 3,521 passing (99.6%), 11 skipped, 2 known pre-existing failures (full run ~8 min); pre-existing skips/failures are catalogued in docs/parity/PRE_EXISTING_FAILURES_TRIAGE.md.
  • Behavioral Parity: 100% of ROM 2.4b6 gameplay subsystems audited (combat, skills, spells, movement, communication, world/db, save/load, mob programs, 255/255 commands).
  • Function Coverage: 716/745 ROM C functions mapped (96.1%)
  • ROM C Source Audit: 34 of 43 files audited (24 at strict 100%); remainder is the OLC editor cluster (olc.c/olc_act.c/olc_save.c/olc_mpcode.c/hedit.c) and a small partial tail (board.c 95%).

🔧 Advanced Features

For developers interested in extending QuickMUD beyond ROM 2.4b:

  • Modern Architecture: Async/await networking, SQLAlchemy ORM, type hints
  • JSON World Data: Human-readable area files (easier editing than ROM .are format)
  • Multiple Protocols: Telnet, WebSocket, SSH connection options
  • ROM API Wrapper: 27 public API functions for external tools and scripts
  • Comprehensive Testing: Golden file tests derived from ROM C behavior
  • Documentation: User guides, admin guides, and builder migration guides

📚 For Contributors

See ROM_PARITY_FEATURE_TRACKER.md for detailed feature status and AGENTS.md for AI-assisted development workflows.

Development Guidelines:

  1. ROM Parity First: Reference original ROM 2.4 C sources in src/ for canonical behavior
  2. Test Coverage: Add tests in tests/ with golden files derived from ROM behavior
  3. Backward Compatibility: Don't break existing save files or area data
  4. Documentation: Update relevant docs and inline code documentation
  5. Performance: Consider impact on the main game loop and player experience

Experience authentic ROM 2.4 gameplay with modern Python reliability! 🐍✨

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rom24_quickmud_python-2.7.0.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rom24_quickmud_python-2.7.0-py3-none-any.whl (622.6 kB view details)

Uploaded Python 3

File details

Details for the file rom24_quickmud_python-2.7.0.tar.gz.

File metadata

  • Download URL: rom24_quickmud_python-2.7.0.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rom24_quickmud_python-2.7.0.tar.gz
Algorithm Hash digest
SHA256 d38d46036aaf08e21419652524b4f62d5f288bc3a41e1d58b139e809c09ffadb
MD5 00eaa886d464e3e6fcc50c3d30f2d802
BLAKE2b-256 c0bcd964063d4f6f89fb69fb029d3a2c1968e6e5cdaae7b1b47aa708c6022ca4

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom24_quickmud_python-2.7.0.tar.gz:

Publisher: release.yml on Nostoi/rom24-quickmud-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rom24_quickmud_python-2.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rom24_quickmud_python-2.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2dc3b34296b6329f1d802d2e8b0a1179c9de881230b0a28ea9e87422659e8ae7
MD5 eb7d139ca0254743afaea58a14f12023
BLAKE2b-256 b6f1be803dd0ed2a556c2d34039d416759e863709f735190c44488dfa28e6959

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom24_quickmud_python-2.7.0-py3-none-any.whl:

Publisher: release.yml on Nostoi/rom24-quickmud-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page