Resources

100 ROM resources for MUD players

The ROM (Rivers of MUD) 2.4 codebase, derived from Merc and Diku, remains a cornerstone of text-based RPG development. This resource provides technical guidance for administrators and developers looking to modernize, maintain, and expand a ROM-based MUD in a contemporary hosting environment while preserving its classic gameplay feel.

100 ROM resources for MUD players illustration
Placeholder illustration shown while custom artwork is being produced.

Modernizing the Build Environment

  1. 1

    Glibc Crypt Library Linking

    beginnerhigh

    Modern Linux distributions no longer include the crypt functions in glibc by default. Add '-lcrypt' to the 'L_FLAGS' line in your Makefile to resolve 'undefined reference to crypt' errors during linking.

  2. 2

    GCC 10+ Multiple Definition Fix

    beginnerstandard

    Modern GCC versions use '-fno-common' by default, causing 'multiple definition' errors for global variables in ROM. Add '-fcommon' to your CFLAGS in the Makefile to maintain compatibility with legacy variable declarations.

  3. 3

    64-bit Pointer to Integer Casting

    advancedhigh

    ROM often casts pointers to 'int', which causes crashes on 64-bit systems where pointers are 8 bytes. Audit 'recycle.c' and 'save.c' to use 'long' or 'intptr_t' for pointer storage and retrieval.

  4. 4

    Replacing sys_siglist

    intermediatestandard

    The 'sys_siglist' array is deprecated. Update 'comm.c' to use 'strsignal(sig)' to handle signal logging for crashes and reboots properly.

  5. 5

    MAX_STRING_LENGTH Overflow Protection

    beginnermedium

    Stock ROM uses a 4096-byte buffer for most strings. Increase 'MAX_STRING_LENGTH' in 'merc.h' to 8192 or 16384 to prevent truncation in modern, high-detail area descriptions.

  6. 6

    Valgrind Memory Leak Detection

    advancedhigh

    Run the MUD binary through Valgrind in a local environment. Focus on 'recycle.c' and 'db.c' to identify leaks in the descriptor and character allocation loops that cause long-term instability.

  7. 7

    Makefile Portability

    beginnerstandard

    Standardize the Makefile by using '$(CC)' and '$(CFLAGS)' variables rather than hardcoded 'gcc' calls to allow for easier cross-compilation on different architectures.

  8. 8

    Git Version Control Initialization

    beginnerhigh

    Initialize a Git repository in the 'src' directory. Commit the stock ROM 2.4b6 code first to allow for 'git diff' tracking of all future customizations and patches.

  9. 9

    Standardizing Time Functions

    intermediatemedium

    Replace legacy 'gettimeofday' calls with 'clock_gettime(CLOCK_MONOTONIC, ...)' in 'comm.c' to ensure consistent game pulse timing regardless of system clock adjustments.

  10. 10

    Automated Startup Script

    beginnerstandard

    Modify the 'startup' shell script to use 'nohup' and redirect 'stderr' to a dedicated 'log/stderr.log' to capture segmentation fault details that don't make it to the standard log files.

Gameplay and Mechanics Customization

  1. 1

    Class Table Expansion

    intermediatemedium

    To add a new class, update 'class_table' in 'const.c', define the class index in 'merc.h', and ensure 'skill_table' includes level requirements for the new class.

  2. 2

    Implementing ANSI Color Parsing

    intermediatehigh

    Integrate a color parser in 'comm.c' that converts tags like '{R' to ANSI escape sequences. Ensure the 'send_to_char' function calls the parser before sending data to the descriptor.

  3. 3

    Integrating Ivan's OLC

    advancedhigh

    Install the On-Line Creation (OLC) patch to allow builders to modify rooms, mobs, and objects in-game. This eliminates the need for frequent reboots and manual .are file editing.

  4. 4

    Dynamic Buffer System

    advancedhigh

    Replace static 'char buf[MAX_STRING_LENGTH]' declarations with a dynamic 'BUFFER' type (found in many ROM snippets) to prevent buffer overflows during high-volume output.

  5. 5

    Customizing the Leveling Curve

    intermediatemedium

    Adjust the 'exp_per_level' function in 'magic.c' or 'fight.c'. Stock ROM uses a linear progression; modifying the multiplier can create a more exponential difficulty curve.

  6. 6

    MobProgram Integration

    advancedhigh

    Add the MobProgram (MP) engine to allow NPCs to react to player actions, enter/exit triggers, and combat events via script files stored in the 'area' directory.

  7. 7

    Race Ability Differentiation

    intermediatemedium

    Modify 'pc_race_table' in 'const.c' to include unique skill modifiers or innate spells (like 'infravision' or 'fly') to make racial choice impactful beyond stat bonuses.

  8. 8

    Automated Auction System

    intermediatestandard

    Implement a global 'auction' command that utilizes a timer and a global pointer to a 'struct obj_data' to manage player-to-player item sales without a physical location.

  9. 9

    Sub-class/Specialization Logic

    advancedmedium

    Extend the player structure in 'merc.h' to include a 'specialization' field, allowing players to choose a branch of their class at level 30 that unlocks specific 'skill_table' entries.

  10. 10

    Combat Damage Capping

    intermediatestandard

    Implement a 'cap' in the 'damage' function within 'fight.c' to prevent 'one-shotting' mobs or players when using highly customized equipment with high 'damroll' stats.

Data Management and Persistence

  1. 1

    Pfile Flat-file Optimization

    beginnerstandard

    ROM's player files (pfiles) are text-based. Organize the 'player' directory into subdirectories (a/, b/, c/) based on the first letter of the name to avoid filesystem slowdowns with large player bases.

  2. 2

    Area File Versioning

    intermediatestandard

    Ensure all area files use the '#AREA' header with versioning. This allows the loader in 'db.c' to handle legacy area formats from older Merc versions during the migration process.

  3. 3

    Automated Cron Backups

    beginnerhigh

    Set up a crontab to run a shell script every 6 hours that creates a compressed tarball of the 'area', 'player', and 'gods' directories, storing them off-site via SSH or S3.

  4. 4

    SQL Integration for Stats

    advancedmedium

    Link the MUD to a MySQL/PostgreSQL database using the 'libmysqlclient' library. Push player statistics (level, kills, deaths) to the DB on 'do_save' for web-based leaderboards.

  5. 5

    Note System Categories

    intermediatestandard

    Expand 'save.c' and 'note.c' to support multiple note boards (Changes, Ideas, Penalties, News) to keep administrative communication organized.

  6. 6

    Hotboot/Copyover Implementation

    advancedhigh

    Implement a 'copyover' command that saves all descriptors, executes the new binary, and re-attaches the descriptors, allowing for code updates without kicking players offline.

  7. 7

    CIDR-based IP Banning

    intermediatemedium

    Upgrade the 'ban.c' system to support CIDR notation (e.g., 1.2.3.0/24). This is essential for blocking modern VPN ranges and botnets that target open MUD ports.

  8. 8

    Object Extra Description Cleanup

    beginnerstandard

    Audit stock area files to remove redundant 'extra descriptions' that consume memory. Use a script to identify objects with descriptions that match the short name exactly.

  9. 9

    Player File Corrupton Recovery

    intermediatehigh

    Implement a 'backup' flag in 'save.c' that creates a '.bak' copy of a player file before overwriting it during a save, providing a fallback if the MUD crashes mid-save.

  10. 10

    Limbo.are Maintenance

    beginnerstandard

    Never delete 'limbo.are'. It contains hardcoded VNUMs for essential items (like the 'dummy' object and 'mushrooms') that the engine expects to exist at boot time.