Upgrading Tips

From DikuMUD Wiki
Revision as of 06:14, 15 November 2026 by Agent-mud (talk | contribs) (checked against the current code (wiki review 2026-11-15))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

How to bring your game up to date with the DikuMUD III repository, and how to bring in zones and players from an older VME game.

Before you start

Back up vme/lib/. It holds the player files, the boards and everything DIL programs have saved. Once a newer server has saved the players, an older server can no longer read them: it stops with "FATAL: Attempted to read ... version number ... which was NEWER than this implementation can handle". So the backup is your only way back.

Also keep a copy of anything you changed in the repository: vme/etc/server.cfg, vme/etc/zonelist, your zones in vme/zone/. Those files are part of the repository, so an update can change them too. The tidy way is to keep your changes as commits on a git branch of your own and merge the new version into it:

git checkout -b mygame        # once: your changes live on this branch
git commit -a -m "My settings"
...
git fetch origin
git merge origin/master       # take in the new version

Git then tells you where the new version and your changes overlap.

Updating

From the top of the repository:

git pull                      # or the fetch and merge above
cmake .                       # only needed if the build files changed, harmless otherwise
make all -j$(nproc)
ctest

make all rebuilds the programs, the .dat files in vme/etc/ and every zone (all zones recompile when vmc or a header in vme/include/ changes), and runs the unit tests. Then restart the server; it reads the programs, zones and definitions only when it starts. If you run the game with startvme.sh, the in-game reboot command does it. Restart mplex too if it changed. mplex can stay up across a server restart: the players get "Please be patient..." and are let in again when the server is back.

If the build fails after an update, check that you still have all the packages in Manual:Installation; new versions sometimes need another library.

Player files

The server reads player files written by older versions and converts them as it loads them; for example, the old & colour codes in titles and descriptions are turned into HTML. Each player is saved in the current format at the next save. To convert all players at once, stop the game, back up vme/lib/, and run from vme/bin/:

./vme -c          # load and save every player file again, then exit

./vme -L only lists the player files. ./vme -C also deletes corrupt and old characters, so use it with care.

Zones with the old colour codes

Before DikuMUD III, zones used codes such as &c+w, &n and &l for colours and layout. DikuMUD III uses HTML instead; see Manual:Zone Manual/Color and Formatting Codes. The compiler doesn't convert the old codes, so a zone that still has them shows them as text in the game.

vme/src/defcomp/fixhtml.c is a small converter for such zone sources. The build doesn't make it, so compile it yourself:

gcc -o fixhtml vme/src/defcomp/fixhtml.c
./fixhtml < oldzone.zon > oldzone.zon.new

It reads a zone on standard input and writes it on standard output. Inside strings it turns the colour codes into <div class='...'> tags, &n into <br/>, &l into <pre> and && into &amp;. It reports codes it doesn't know and quotes that are never closed. For example, the line

title "&c+wHello&cw there&n"

comes out as

title "<div class='cpw'>Hello</div><div class='cw'> there<br/></div>"

vme/zone/removefinal.sh runs the converter over every .zon file in a directory and writes .zon.new files beside them. It expects the program at ../vme/bin/fixhtml, so edit that path to where you compiled it.

A way to work:

  1. Convert all the zones.
  2. Search the new files for & and check that each one is part of HTML (&amp;, &lt; and so on) and not a leftover old code.
  3. Where an old code was typed wrongly, fix it in the original zone and convert again. Repeat until no old codes are left.
  4. Replace the zones with the new files, compile them with vmc and look at them in the game.

Older conversions

vme/scripts/ still has the gawk scripts (convert.zone, convert.socials, convert.help, convert.wizhelp) that converted a VME 1.x game to VME 2.0 in 2001. They are only of use for a game that old, and its zones will still need the colour conversion above and other fixes before the current vmc accepts them.