Difference between revisions of "Getting started - Step by Step"

From DikuMUD Wiki
Jump to navigation Jump to search
(Created page with "To get started with DikuMUD, you're going to need a few things. First of all, you're going to need a host machine to run it on. It's easiest if this is one you own, but it's...")
 
(checked against the current code (wiki review 2026-11-15))
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
−
To get started with DikuMUD, you're going to need a few things.
+
This page takes you from nothing to playing your own DikuMUD III game in a browser. It uses Ubuntu; other Linux distributions work the same way with their own package names. [[Manual:Installation]] has the details behind each step.
  
−
First of all, you're going to need a host machine to run it on. It's easiest if this is one you own, but it's also ok as long as you have permission. Running a MUD means that there will be network connections to the machine and the to do that it's going to have to listen for network traffic.  Those owning the machine might not take kindly to allowing these network connections.  There's security risk involved, and there may be a cost involved for the traffic itself.
+
== 1. A machine to run it on ==
 +
You need a Linux machine you may run a server on. It is easiest if it is your own. A MUD listens for network connections, and whoever owns the machine may not want that: it is a security risk, and the traffic may cost money. For trying things out, your own computer is fine; nothing has to be reachable from the internet.
  
−
The MUD will run on a wide variety of platforms, but is written using '''(distribution)''', a LINUX host.
+
== 2. Install the tools ==
 +
<pre>
 +
sudo apt install build-essential cmake git bison flex perl \
 +
    libboost-dev libboost-filesystem-dev libboost-regex-dev libboost-test-dev \
 +
    libssl-dev rapidjson-dev libcrypt-dev
 +
</pre>
  
−
==== Pre-requisites ==== - stuff that has to already be installed on the platform include
+
== 3. Get the source ==
 +
<pre>
 +
git clone https://github.com/Seifert69/DikuMUD3.git
 +
cd DikuMUD3
 +
</pre>
 +
This makes a <code>DikuMUD3</code> directory that is also a git repository linked to the one on GitHub, so <code>git pull</code> fetches later changes.
  
−
    gcc/g++
+
The quick way, used on this page, is to run the game straight from this directory. That is fine for trying it out. For a game that others play, think early about keeping your own changes (configuration, zones) on a branch of your own, so that updates from GitHub can be merged in; see [[Upgrading Tips]].
−
    flex/bison (sudo apt-get install bison flex)
 
−
    boost devel (sudo apt-get install libboost-all-dev)
 
  
−
For CentOS:
+
== 4. Build ==
−
    sudo yum group install "Development Tools"
+
<pre>
 +
cmake .
 +
make all -j$(nproc)
 +
</pre>
 +
This builds the server (<code>vme</code>), the network front end (<code>mplex</code>) and the zone compiler (<code>vmc</code>) into <code>vme/bin/</code>, compiles all the zones, and runs the unit tests at the end. It takes a few minutes. If the machine runs out of memory, use a smaller number than <code>$(nproc)</code>, for example <code>-j2</code>.
  
−
should do it, but you may need:
+
<code>cmake .</code> makes a debug build, which is right while you are learning. For a game with players, see the build types in [[Manual:Installation]].
−
    sudo yum install boost-devel flex-devel
 
  
−
To download a copy, you can pull down a current copy of the software from GitHub with:
+
== 5. Start the game ==
−
+
Open three terminals (or use <code>screen</code> or <code>tmux</code> if the machine has no desktop). In each one, go to <code>vme/bin</code> first.
−
    git clone https://github.com/Seifert69/DikuMUD3.git
+
 
 +
Terminal 1, the game server:
 +
<pre>
 +
cd DikuMUD3/vme/bin
 +
./vme
 +
</pre>
 +
Its messages go to <code>vme.log</code> in the same directory, not to the terminal.
 +
 
 +
Terminal 2, the websocket front end for the browser:
 +
<pre>
 +
cd DikuMUD3/vme/bin
 +
./mplex -w -p 4280
 +
</pre>
 +
 
 +
Terminal 3, the logs:
 +
<pre>
 +
cd DikuMUD3/vme/bin
 +
tail -f vme.log mplex.log
 +
</pre>
 +
 
 +
The server log names a number of zones it could not open (<code>Could not open data file</code>). That is expected: the list of zones in <code>vme/etc/zonelist</code> is longer than the set of zones in the repository.
 +
 
 +
If you prefer telnet, start a telnet front end too, in another terminal, with its own log so it does not share <code>mplex.log</code>:
 +
<pre>
 +
./mplex -p 4242 -l mplex-telnet.log
 +
</pre>
 +
and connect with <code>telnet localhost 4242</code>.
 +
 
 +
== 6. Connect with the web client ==
 +
Open <code>DikuMUD3/vme/www/client/index.html</code> in a browser (for example <code>firefox vme/www/client/index.html</code>). In the connect form, choose '''This computer''' (protocol <code>ws</code>, host <code>localhost</code>, port <code>4280</code>) and connect. You should see the game's welcome screen.
 +
 
 +
== 7. Create your god ==
 +
Create a new character called '''Papi'''. This name is set by <code>immortal_name</code> in <code>vme/etc/server.cfg</code>, and a character with that name is made the highest level (255) when it enters the game. Before anyone else can reach your game, change <code>immortal_name</code> to a name of your own and create that character.
 +
 
 +
Now look around. [[Wizarding 101]] and [[Manual:Wizhelp Files]] describe the administrator commands.
 +
 
 +
== 8. Stop it, change something, start it again ==
 +
Press Ctrl-C in the terminal running <code>vme</code>. The server saves the players and stops. mplex tells the players that the connection was broken. It keeps running and reconnects by itself when the server is back.
 +
 
 +
Try a change: set <code>mudname</code> in <code>vme/etc/server.cfg</code> to the name of your game and start <code>./vme</code> again.
 +
 
 +
When you change a zone in <code>vme/zone/</code>, compile it and restart the server, since zones are read only at boot:
 +
<pre>
 +
cd DikuMUD3/vme/zone
 +
../bin/vmc -m -d ../etc/ -I../include/ *.zon
 +
</pre>
 +
The [[Manual:Zone Manual]] explains how zones are written.
 +
 
 +
== 9. Keeping it running ==
 +
Programs started in a terminal stop when you log out. For a game that stays up, use <code>vme/bin/startvme.sh</code> and <code>stopvme.sh</code>. They run vme and the mplexers in the background and start them again when they stop, which is also what makes the in-game <code>reboot</code> command work. See [[Manual:Installation]], which also covers opening the game to the internet (firewall, <code>wss://</code> certificates, putting the web client on a web server).
 +
 
 +
== Where next ==
 +
* [[Understanding the File System]]: what is in each directory.
 +
* [[Understanding the Architecture of DikuMUD at runtime]]: how the programs work together.
 +
* [[Manual:Discord]]: linking the game to a Discord server.

Latest revision as of 06:14, 15 November 2026

This page takes you from nothing to playing your own DikuMUD III game in a browser. It uses Ubuntu; other Linux distributions work the same way with their own package names. Manual:Installation has the details behind each step.

1. A machine to run it on

You need a Linux machine you may run a server on. It is easiest if it is your own. A MUD listens for network connections, and whoever owns the machine may not want that: it is a security risk, and the traffic may cost money. For trying things out, your own computer is fine; nothing has to be reachable from the internet.

2. Install the tools

sudo apt install build-essential cmake git bison flex perl \
    libboost-dev libboost-filesystem-dev libboost-regex-dev libboost-test-dev \
    libssl-dev rapidjson-dev libcrypt-dev

3. Get the source

git clone https://github.com/Seifert69/DikuMUD3.git
cd DikuMUD3

This makes a DikuMUD3 directory that is also a git repository linked to the one on GitHub, so git pull fetches later changes.

The quick way, used on this page, is to run the game straight from this directory. That is fine for trying it out. For a game that others play, think early about keeping your own changes (configuration, zones) on a branch of your own, so that updates from GitHub can be merged in; see Upgrading Tips.

4. Build

cmake .
make all -j$(nproc)

This builds the server (vme), the network front end (mplex) and the zone compiler (vmc) into vme/bin/, compiles all the zones, and runs the unit tests at the end. It takes a few minutes. If the machine runs out of memory, use a smaller number than $(nproc), for example -j2.

cmake . makes a debug build, which is right while you are learning. For a game with players, see the build types in Manual:Installation.

5. Start the game

Open three terminals (or use screen or tmux if the machine has no desktop). In each one, go to vme/bin first.

Terminal 1, the game server:

cd DikuMUD3/vme/bin
./vme

Its messages go to vme.log in the same directory, not to the terminal.

Terminal 2, the websocket front end for the browser:

cd DikuMUD3/vme/bin
./mplex -w -p 4280

Terminal 3, the logs:

cd DikuMUD3/vme/bin
tail -f vme.log mplex.log

The server log names a number of zones it could not open (Could not open data file). That is expected: the list of zones in vme/etc/zonelist is longer than the set of zones in the repository.

If you prefer telnet, start a telnet front end too, in another terminal, with its own log so it does not share mplex.log:

./mplex -p 4242 -l mplex-telnet.log

and connect with telnet localhost 4242.

6. Connect with the web client

Open DikuMUD3/vme/www/client/index.html in a browser (for example firefox vme/www/client/index.html). In the connect form, choose This computer (protocol ws, host localhost, port 4280) and connect. You should see the game's welcome screen.

7. Create your god

Create a new character called Papi. This name is set by immortal_name in vme/etc/server.cfg, and a character with that name is made the highest level (255) when it enters the game. Before anyone else can reach your game, change immortal_name to a name of your own and create that character.

Now look around. Wizarding 101 and Manual:Wizhelp Files describe the administrator commands.

8. Stop it, change something, start it again

Press Ctrl-C in the terminal running vme. The server saves the players and stops. mplex tells the players that the connection was broken. It keeps running and reconnects by itself when the server is back.

Try a change: set mudname in vme/etc/server.cfg to the name of your game and start ./vme again.

When you change a zone in vme/zone/, compile it and restart the server, since zones are read only at boot:

cd DikuMUD3/vme/zone
../bin/vmc -m -d ../etc/ -I../include/ *.zon

The Manual:Zone Manual explains how zones are written.

9. Keeping it running

Programs started in a terminal stop when you log out. For a game that stays up, use vme/bin/startvme.sh and stopvme.sh. They run vme and the mplexers in the background and start them again when they stop, which is also what makes the in-game reboot command work. See Manual:Installation, which also covers opening the game to the internet (firewall, wss:// certificates, putting the web client on a web server).

Where next