GitXplorerGitXplorer
s

dum

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
d1310483ec27f1e1a29b8e7927376bdf5edbf385

Zombie players

ssmitelli committed 5 years ago
Unverified
e22669ba605593e5f92b2b19cf48789c24baa987

Telnet/nc knowledge

ssmitelli committed 5 years ago
Unverified
03f9058b5f841f058466480011d5e2822c240130

README proofread pass

ssmitelli committed 5 years ago
Unverified
eb069bb133ebecd659e970c9f3d08e950f116997

Add readme, player names, room player list, fix dud origin room, cleanup

ssmitelli committed 5 years ago
Unverified
beea7594a1ef52b5285716f6b74215e6a16f48ce

Initial megacommit

ssmitelli committed 11 years ago

README

The README file for this repository.

DUM

=================     ====          ====   ========  ========
\\ . . . . . . .\\   //. \\        // .\\  \\. . .\\// . . //
||. . ._____. . .|| ||. . ||      || . .|| || . . .\/ . . .||
|| . .||   ||. . || || . .||      ||. . || ||. . . . . . . ||
||. . ||   || . .|| ||. . ||      || . .|| || . | . . . . .||
|| . .||   ||. _-|| ||-_ .||      ||. _-|| ||-_.|\ . . . . ||
||. . ||   ||-'  || ||  `-||      ||-'  || ||  `|\_ . .|. .||
|| . _||   ||    || ||    ||      ||    || ||   |\ `-_/| . ||
||_-' ||  .|/    || ||    \|.    .|/    || ||   | \  / |-_.||
||    ||_-'      || ||      `-__-'      || ||   | \  / |  `||
||    `'         || ||                  || ||   | \  / |   ||
||            .===' `===.            .===' /==. |  \/  |   ||
||         .=='   \_|-_ `===.    .===' _-|/   `==  \/  |   ||
||      .=='    _-'    `-_  `===='  _-'   `-_  /|  \/  |   ||
||   .=='    _-'          `-______-'         `' |. /|  |   ||
||.=='    _-'                                    `' |  /==.||
=='    _-'                                           \/   `==
\   _-'                                               `-_   /
 `''                                                     ``'

A damn unfinished MUD.

About

Many years ago, I worked with a team that had an interesting whiteboard problem they would present to interview candidates: Design a multi-user dungeon (MUD) whose world consists of a two-dimensional grid of square rooms. Each room can be connected to any combination of its four adjacent rooms with doors. Some of the doors only allow passage in one direction. The rooms are generated randomly as the world is explored by players. As players arrive and leave, the world persists as long as the server continues to run.

Eventually it became apparent that nobody on the team had ever actually attempted to solve the problem with a full implementation. So I took it upon myself to try. This is the result, with some fun affordances added in.

Install and Run

Depending on the configuration of your system, you might need to say python, python2 or python2.7. Same deal with pip. DUM must be run under Python 2.7, and the version of pip must correspond that version of Python as well.

You might want to use Virtualenv to keep your system clean. Otherwise,

pip install -r reqs.txt
python run.py

Once the server starts, it listens on TCP port 8123 on all available interfaces.

Playing the Game

From the computer running the server, run:

telnet localhost 8123

To connect to a DUM server from a different machine, substitute the server IP address or hostname:

telnet 192.168.42.42 8123
telnet triton 8123

(Many modern operating systems don't ship with a Telnet client by default, which is a dumb tragedy. It should be possible to use netcat or nc to do the same thing, provided it transmits CRLF when the Enter key is pressed. nc -C achieves that on my system, YMMV.)

If connection is successful, a brief intro will appear followed by the dum> prompt. Any of the following commands can be used:

  • name {str}: View or set the player name. name by itself shows the current player name, and name perljam sets the player name to perljam.
  • look: Describe the room the player currently occupies, along with what's in it.
  • walk {dir}: Move to an adjacent room using a cardinal direction (north) or an abbreviation of one (n). There must be a door in the desired direction. Beware: Some doors are one-way and cannot be backtracked through!
  • help: Display a summary of game commands.
  • quit: Leave the game and disconnect from the server.

The principle of the game is straightforward: look around the room to see what's there, walk through one of the available doors, and repeat. If another player is in the same room as you, the game will let you know. The game world is stable and can be drawn out on paper as new areas are explored. Disconnecting and reconnecting will place you back in the origin room.

Yes, it's Python 2.7

While Python 3.4 was available in 2014 when DUM was originally written, the project was developed and tested in Python 2.7 only. The bulk of the syntax should work without modification in newer Python versions (I smoke-tested it with 3.8) but the game will not play correctly due to Python 3's Unicode handling and the changes to str/bytes.

The fix may be as simple as upgrading the Twisted version, but I'm not particularly eager to mess with it at the moment.

License

MIT