Guides

SMAUG with SMAUG

SmaugFUSS is a maintained derivative of the original SMAUG codebase, retaining its Diku/Merc roots while fixing critical bugs. However, it assumes 1990s compilation environments. This guide addresses the GCC 10+ toolchain changes that break legacy builds, configures the specific directory hierarchy SMAUG expects, and enables OLC for online building. You will compile the C source, fix linker errors caused by header variable definitions, and secure the file permissions required for runtime area writing.

45-60 minutes10 steps
Linux terminal icon representing MUD server administration
SmaugFUSS runs in a standard Linux terminal environment
1

Clone SmaugFUSS and Verify Source Integrity

SmaugFUSS is actively maintained on GitHub. Clone the repository and verify you have the src/ directory containing the Makefile. Check that you have either the 1.9 or 2.0 branch; 1.4 is legacy and lacks modern fixes.

terminal
git clone https://github.com/SmaugFUSS/SmaugFUSS.git
cd SmaugFUSS/src
ls -la Makefile

⚠ Common Pitfalls

  • Do not use the original SMAUG 1.4a from 1998; it lacks 64-bit fixes
  • Ensure you have the 'src' directory, not just area files
2

Install Build Dependencies

SmaugFUSS requires zlib for compression and standard build tools. On modern distributions, you also need libc6-dev for 64-bit support.

terminal
sudo apt-get update
sudo apt-get install build-essential gcc make zlib1g-dev libc6-dev

⚠ Common Pitfalls

  • Missing zlib1g-dev causes 'zlib.h not found' during compile
  • On Alpine Linux, use musl-dev instead of libc6-dev
3

Fix GCC 10+ Multiple Definition Errors

GCC 10 changed the default from -fcommon to -fno-common. SmaugFUSS defines variables in headers (like in db.h) that get included in multiple .c files, causing linker errors. Edit the Makefile to add -fcommon to CFLAGS or fix the extern declarations.

Makefile
# In src/Makefile, find CFLAGS line and add:
CFLAGS = -g -O2 -Wall -fcommon

# Alternative: Fix the headers properly by adding 'extern' and defining once in db.c

⚠ Common Pitfalls

  • Ignoring this results in 'multiple definition of' linker errors for global variables
  • -fcommon is a temporary fix; proper extern declarations are better for production
4

Configure Directory Structure and Permissions

SmaugFUSS expects specific directories at runtime: ../player, ../log, ../area, and ../gods. Create these sibling directories to the src/ folder and set restrictive permissions since the game runs as a user but writes player files.

terminal
cd ..
mkdir -p player log gods area
chmod 770 player log gods
chmod 755 area
ls -ld player log area

⚠ Common Pitfalls

  • Running smaug without these directories causes immediate crash on boot
  • World-writable player directories are a security risk; use 770 with proper group ownership
5

Compile with 64-bit Pointer Support

Modern Linux uses 64-bit pointers. SmaugFUSS uses %ld format specifiers for pointers in some legacy code. Compile with -Wno-format to suppress warnings, or better, fix the format strings to use %p. Ensure you compile with -DLINUX flag.

terminal
cd src
make -j$(nproc) CFLAGS="-g -O2 -fcommon -DLINUX -Wno-format"
# Verify binary architecture:
file smaug

⚠ Common Pitfalls

  • Format warnings about pointer/int mismatches are harmless but indicate legacy code
  • Without -DLINUX, the code assumes BSD sockets and fails to compile
6

Initialize System Data and Port Configuration

Before first boot, edit ../area/sysdata.dat to set your MUD's name, port, and admin parameters. The stock port is 4000. Ensure the port matches your firewall rules. Set the 'Admin' line to your implementor character name.

sysdata.dat
# In ../area/sysdata.dat:
MudName       MyMUD~
Port          4000
Admin         Implementor~
LevelToBuild  51
...

⚠ Common Pitfalls

  • Port numbers below 1024 require root privileges (avoid this)
  • Changing MudName after player creation causes recognition issues with pfiles
7

Boot the MUD and Check for Errors

Run the binary from the src/ directory. It expects to find ../area/ relative to the executable. Watch for 'Booting Database' messages and any 'Error' lines regarding missing area files. The stock areas should load without errors.

terminal
./smaug 4000
# In another terminal, test connection:
telnet localhost 4000

⚠ Common Pitfalls

  • 'Unable to bind to port' usually means the port is in use or requires permissions
  • If areas fail to load, check that you copied all .are files from the repository to ../area/
8

Create Implementor Account and Enable OLC

Log in via telnet, create a character. To gain immortal status, you must manually edit the player file in ../player/ or use the hotboot feature if available. For SmaugFUSS, set the level in the pfile to 65 (MAX_LEVEL). Then use 'redit', 'oedit', 'medit' commands.

terminal
# Alternative: Edit player file directly (while MUD is down)
cd ../player
ls -la # find your name
# Edit the file, find 'Level' field, change to 65

⚠ Common Pitfalls

  • OLC commands require LEVEL_CREATOR (usually 60+) in SmaugFUSS
  • Always make area backups before OLC edits; corrupted area files crash the MUD on next boot
9

Configure Automatic Restart with systemd

For production, create a systemd service unit to keep the MUD running. Use Type=simple and ensure WorkingDirectory points to your src/ folder. Run as a dedicated mud user, never root.

smaug.service
# /etc/systemd/system/smaug.service
[Unit]
Description=SmaugFUSS MUD
After=network.target

[Service]
Type=simple
User=mud
WorkingDirectory=/home/mud/smaug/src
ExecStart=/home/mud/smaug/src/smaug 4000
Restart=on-failure

[Install]
WantedBy=multi-user.target

⚠ Common Pitfalls

  • Running as root allows OLC to overwrite any system file
  • Not setting Restart=on-failure means crashes require manual intervention
10

Verify OLC Persistence and Back Up Areas

Test OLC by creating a new room with 'redit' and saving with 'save_area'. Check that ../area/room.wld (or your custom area file) has been modified. Set up a cron job to copy area files to a backup directory daily, as SMAUG area corruption is difficult to recover from without backups.

terminal
# Add to crontab for mud user
crontab -e
# Daily backup at 3 AM:
0 3 * * * tar czf ~/backups/areas-$(date +\%Y\%m\%d).tar.gz ~/smaug/area/

⚠ Common Pitfalls

  • OLC saves overwrite area files immediately; there is no version control by default
  • Corrupted area files often cause infinite boot loops; test changes on a copy first

What you built

Your SmaugFUSS instance is now running on modern Linux. You have addressed the GCC 10 compilation barrier, configured proper file permissions for security, and enabled OLC for world building. Monitor your logs/ directory for bugs and player complaints. For further customization, examine the src/mud.h file for hardcoded limits and the area/ folder for quest script examples using SMAUG's MPROG syntax.