A Walk in the Dark A look in to the mind of an RPG designer



The Day After

Happy Post-April Fools Day everyone!

Time for an explanation... On April 1st 2001, while I was actively developing The Opera, a total conversion for Half-Life, I launched an "Opera Pre-Alpha", which is actually still visible and downloadable HERE through the Internet Archive (amazing... the ZIP file is still there to download!). You can read the entire background there.

No images are visible in the archive, but here it is for those of you unable to run that version:


Six months ago, amidst the news of "D&D Next", I made the choice to do it again and create another language interpreter using Dungeons and Dragons content. To be honest I had three choices of games I wanted to emulate: Zork, Wizardry (Proving Grounds of the Mad Overlord) or Ultima (III: Exodus or IV: Quest of the Avatar). All things considered, Zork was the easiest to do.

I did not have the benefit of having the source code to the original one I created 12 years ago (in C++, if you're wondering), so I set out to re-create the entire natural language interpreter in C#.Net. Yes, you read that correctly... I didn't use an existing interpreter like Z or Muddle; I created my own interpreter from scratch.

The result was The Caverns of Mayhem: A Dungeons and Dragons Adventure!


This was actually somewhat of a challenge to do. Not so much the language interpreter - I've done that at least three times before, each time in a different programming language - but how exactly to translate the D&D game mechanic to an interactive text adventure. I did the best I could, but there are certain things that are noticeably absent; for example, I didn't implement skills because I didn't quite know how. And the cleric's Channel Divinity powers were for the most part omitted because most of them were reactions which just wouldn't work.

To "win" you have to battle your way to the treasure room, take the treasure and return to the tavern with it. There are goblins and a medusa in your way; everything else is just filler. As was the case with the first one I did in 2001 (read the write up linked above), there was a lot more that I was thinking about but just didn't have time to do. For example, I had much more interaction planned with the tavern staff, the orc and the gazebo.

Now, in case you haven't tried some of these, here are some things you can try and some Easter eggs:

  • There are numerous responses taken verbatim from Zork, such as responses to suicide, jumping, yelling or typing "xyzzy" (or any other magic word from Sorcerer, Enchanter, Spellbreaker or Wishbringer for that matter).
  • Use any one of George Carlin's seven dirty words.
  • Use a Doom cheat code like "idkfa" or "iddqd". The response mimics what the game Hexen does if you try to enter a non-Hexen cheat code in to it.
  • As a wizard, "cast magic missile" while in darkness.
  • "Cast burning hands" (as a wizard) or "cast flames of the phoenix" (as a monk) in the presence of the gazebo.
  • Sell the orc's pie in the tavern.
  • Count the leaves. This is an inside joke in several Infocom titles. The number also has special mathematical significance: 69 in hexadecimal is 105 in decimal, and 69 in decimal is 105 in octal. I had other plans for the leaves, but just never got around to them.
  • Search the refuse in the Refuse Room. Yes, I implemented dire rats that most people will never see.
  • As a barbarian, you can "rage" or "flip out".
  • Roll the dice and either get snake eyes (curse) or box cars (boon).
  • Try to cast a spell while in the tavern.
  • Besides myself, all the other names in the README are characters from films directed by Stanley Kubrick.
  • Other things I don't remember.

I worked on and off on it for the past two months, and it was kinda fun to do and I'm actually really proud of it. I wish I could do more, but there simply wasn't enough time. And it wasn't perfect; there was actually a crashing bug if you tried to eat the leaves (among other commands). I have since fixed that and uploaded the new version.

If you are curious, below is a link to where you can download the complete source code in C#.Net to The Caverns of Mayhem: A Dungeons and Dragons Adventure! The project is compatible with Microsoft Visual Studio 2010 and only requires the Microsoft .NET Framework v2.0 to run.

I hope you all enjoyed it as much as I enjoyed creating it. Maybe next year I'll have a Wizardry emulator...

Download complete The Caverns of Mayhem:
A Dungeons and Dragons Adventure
source code
(C#, Microsoft Visual Studio 2010)

Filed under: 5E, DnD, Programming, RPG Comments Off
Comments () Trackbacks (0)
  1. That medusa was tough! One thing I couldn’t figure out: how do I regain spells? I tried a variety of commands to try to pray for spells as a cleric, with no luck. The orc with the pie was fun, as were other elements. Thanks!

Trackbacks are disabled.