MUD Protocols & Networking
Connection Model
Traditional MUDs operate over TCP/IP using the Telnet protocol (RFC 854/855). A player connects a client to a server’s IP address and port (commonly port 23 or 4000+). The connection lifecycle:
- TCP connection established
- Telnet option negotiation (capabilities exchange)
- MUD-specific protocol negotiation (GMCP, MSDP, etc.)
- Login/authentication
- Gameplay (bidirectional text + out-of-band data)
- Disconnect
Telnet Foundation
Basic Telnet (RFC 854)
- Text-based, bidirectional
- IAC (Interpret As Command, byte 255) introduces control sequences
- Options negotiated via WILL/WONT/DO/DONT sequences
Standard Telnet Options Used by MUDs
| Option | Purpose |
|---|---|
| NAWS (RFC 1073) | Negotiate About Window Size — client reports terminal dimensions |
| TTYPE (RFC 1091) | Terminal Type — client reports terminal capabilities |
| CHARSET (RFC 2066) | Character set negotiation |
| EOR (RFC 885) | End of Record — marks prompt boundaries |
| SGA (RFC 858) | Suppress Go Ahead — enables full-duplex |
MUD-Specific Protocols
GMCP (Generic MUD Communication Protocol)
Telnet option code: 201
GMCP enables structured JSON data exchange between server and client without cluttering the text stream. It superseded ATCP.
Message format:
IAC SB GMCP <package.command> <JSON data> IAC SE
Negotiation:
- Server:
IAC WILL GMCP - Client accepts:
IAC DO GMCP - Client subscribes:
Core.Supports.Set ["char 1", "room 1", "comm 1"]
Standard packages (as implemented by Aardwolf — the reference implementation):
char.base — Rarely-changing character info
{"name": "Lasher", "class": "Warrior", "subclass": "Soldier",
"race": "Human", "clan": "Crusader", "pretitle": "",
"tier": 9, "remorts": 7, "redos": 0, "level": 201, "pups": 500}
char.vitals — Health/resource tracking
{"hp": 100000, "mana": 90000, "moves": 41599}
char.stats — Training-affected values
{"str": 251, "int": 250, "wis": 249, "dex": 248, "con": 247, "luck": 246,
"hr": 500, "dr": 500, "saves": -200}
char.maxstats — Maximum values
{"maxhp": 50099, "maxmana": 50029, "maxmoves": 30000,
"maxstr": 300, "maxint": 300, "maxwis": 300, "maxdex": 300, "maxcon": 300, "maxluck": 300}
char.status — Experience and state
{"level": 210, "tnl": 1000, "hunger": 70, "thirst": 80,
"align": 1000, "state": 3, "pos": "Standing", "enemy": "", "enemypct": ""}
State codes: 1=login, 2=MOTD, 3=active, 4=AFK, 5=note, 6=building, 7=pager, 8=combat, 9=sleeping, 11=resting, 12=running
char.worth — Currency and achievements
{"gold": 23128310661, "bank": 750000, "qp": 5052186, "tp": 1234,
"trains": 5000, "pracs": 3000, "qpearned": 6000000}
room.info — Current location
{"num": 5922, "name": "At the Entrance to the Academy",
"zone": "aylor", "terrain": "city",
"details": "", "exits": {"e": 5920, "s": 5916, "w": 12611},
"coord": {"id": 0, "x": 37, "y": 19, "cont": 1}}
Continent codes: 0=Mesolar, 1=Southern Ocean, 2=Gelidus, 3=Abend, 4=Alagh, 5=Uncharted Oceans, 6=Vidblain
comm.channels — All chat messages
{"chan": "gossip", "msg": "You gossip 'hello world'", "player": "Abelinc"}
Supported channels: answer, auction, barter, cant, chant, claninfo, clantalk, commune, curse, debate, ftalk, gametalk, gclan, gossip, grapevine, gratz, gsocial, gtell, helper, immtalk, inform, ltalk, market, music, newbie, nobletalk, pokerinfo, question, quote, racetalk, restores, rp, say, spouse, tech, telepathy, tell, tiertalk, wangrp, wardrums, yell
comm.quest — Quest lifecycle events
// Quest start
{"action": "start", "targ": "a goblin warrior", "room": "Dark Cave",
"area": "Goblin Mines", "timer": 52}
// Quest complete
{"action": "comp", "qp": 16, "tierqp": 9, "pracs": 0, "trains": 0,
"tp": 0, "gold": 4831, "completed": 111}
// Quest timeout
{"action": "timeout", "wait": 30}
comm.tick — Server pulse notification
{}
comm.repop — Area reset
{"zone": "aylor"}
group — Party information
{"groupname": "adventurers", "leader": "Lasher", "count": 2,
"kills": 50, "exp": 10000,
"members": [
{"name": "Lasher", "hp": 50000, "mhp": 50000, "mana": 40000, "mmana": 40000,
"moves": 30000, "mmoves": 30000, "align": 1000, "tnl": 500, "lvl": 201,
"qt": 0, "qs": 0, "here": true}
]}
Quest status (qs): 0=can quest, 1=questing, 2=on cooldown, 3=mob/unable
MSDP (MUD Server Data Protocol)
Telnet option code: 69
Binary protocol for structured data exchange, developed 2009. More compact than GMCP but less human-readable.
Byte codes:
| Code | Name | Value |
|---|---|---|
| MSDP | Protocol identifier | 69 |
| MSDP_VAR | Variable marker | 1 |
| MSDP_VAL | Value marker | 2 |
| MSDP_TABLE_OPEN | Object open | 3 |
| MSDP_TABLE_CLOSE | Object close | 4 |
| MSDP_ARRAY_OPEN | Array open | 5 |
| MSDP_ARRAY_CLOSE | Array close | 6 |
Format: IAC SB MSDP MSDP_VAR <variable> MSDP_VAL <value> IAC SE
Commands: LIST, REPORT (continuous updates), SEND (one-shot), RESET, UNREPORT
Standard reportable variables:
- General: account name, character name, server ID, server time
- Character: health, mana, experience, level, alignment, movement, money, status
- Combat: opponent name, health, level, strength
- Mapping: room vnum, coordinates, terrain, exits
- World: in-game time
MSSP (MUD Server Status Protocol)
Standardized server metadata for MUD directories and crawlers. Allows automated collection of accurate, real-time MUD information.
Required fields: NAME, PLAYERS (current count), UPTIME (Unix timestamp)
Categorization fields:
- FAMILY: AberMUD, CoffeeMUD, DikuMUD, Evennia, LPMud, MOO, TinyMUD, Custom, etc.
- GENRE: Fantasy, Sci-Fi, Horror, Modern, etc.
- GAMEPLAY: Hack and Slash, PvP, PvE, Roleplaying, Social, etc.
- STATUS: Alpha, Closed Beta, Open Beta, Live
- GAMESYSTEM: D&D, d20, Turn Based, Real Time, Custom, None
World metrics: AREAS, ROOMS, MOBILES, OBJECTS, CLASSES, LEVELS, RACES, SKILLS, HELPFILES
Protocol support flags: ANSI, UTF-8, VT100, XTERM 256 COLORS, XTERM TRUE COLORS
MXP (MUD eXtension Protocol)
HTML-like inline formatting for MUD output. Enables clickable links, styled text, images, and interactive elements.
Key tags:
<A href="url">— Open web link in browser<SEND href="command">text</SEND>— Clickable text that sends a command to the MUD<EXPIRE>— Remove previously displayed links (e.g., when changing rooms)<B>,<I>,<U>,<COLOR>— Text formatting- Image maps with
ISMAPattribute for clickable graphical elements
Use case: Room exits as clickable links, item names as clickable “look” commands, mob names as clickable “consider” commands.
MCCP (MUD Client Compression Protocol)
Zlib-based compression for MUD data streams. Two versions:
- MCCPv1: Telnet option 85 — compresses server→client only
- MCCPv2: Telnet option 86 — improved negotiation, widely supported
Reduces bandwidth 60-80% for text-heavy MUD output. Most modern clients support it.
ATCP (Achaea Telnet Client Protocol)
Predecessor to GMCP, developed by IRE (Iron Realms Entertainment) for Achaea and related MUDs. GMCP largely supersedes it but some MUDs still support both.
ANSI Color Codes
MUDs use ANSI escape sequences for colored text:
\033[<code>m
Standard 16 Colors
| Code | Foreground | Code | Background |
|---|---|---|---|
| 30 | Black | 40 | Black |
| 31 | Red | 41 | Red |
| 32 | Green | 42 | Green |
| 33 | Yellow/Brown | 43 | Yellow |
| 34 | Blue | 44 | Blue |
| 35 | Magenta | 45 | Magenta |
| 36 | Cyan | 46 | Cyan |
| 37 | White | 47 | White |
- Bold/bright:
\033[1m(makes foreground bright) - Reset:
\033[0m - 256-color:
\033[38;5;<n>m(foreground),\033[48;5;<n>m(background) - True color (24-bit):
\033[38;2;<r>;<g>;<b>m
Modern Alternatives
WebSocket-Based MUDs
Modern MUDs increasingly support WebSocket connections alongside or instead of telnet:
- Browser-based clients with no installation
- Full HTML/CSS/JS for rich UI
- JSON messaging (similar to GMCP but native)
- Evennia includes a built-in HTML5 web client
- DikuMUD III (2020) uses HTML5 + WebSockets
Advantages of WebSocket approach
- Firewall-friendly (port 80/443)
- TLS encryption native
- Rich client capabilities (maps, sidebars, status bars)
- Mobile-friendly
- No special client software needed
Major MUD Clients
| Client | Platform | Language | Key Features |
|---|---|---|---|
| Mudlet | Cross-platform | Lua scripting | GMCP, mapping, modern UI, open source |
| MUSHclient | Windows | Lua/JScript | Aardwolf’s recommended client, plugin system |
| TinTin++ | Unix/Mac | Built-in | Terminal-based, powerful scripting, protocol support |
| Blightmud | Cross-platform | Lua | Rust-based, modern terminal client |
| zMUD/CMUD | Windows | zScript | Legacy but feature-rich, commercial |