Binary In Doom

This page talks about an odd Doom II map I created that counts in binary. You can get it here.

Update

On 2009-06-10 I mentioned this page on the Doomworld Forums. You can read the thread here. I've learned from that thread is that this idea is not quite as original as I had thought. One person mentioned that there is an existing 4 bit counter map. There is also this attempt to do binary logic in Doom.

Overview

Those of you, like me, who are old enough to have played Doom I and Doom II when it was still new and exciting may recall a bit about how maps are structured. Although it's 3D when you play it Doom maps are pretty much 2D. The map creator works with something like a floor plan. The map creator is able to add line segments to the map that cause a chosen area (or "sector" in Doom speak) to perform a given action. For example, the map creator may choose to have a door open when the player passes a given point and then close again when the player passes another point.

Since the state of the game (whether doors are open or closed, etc.) can be controlled by various rules I've always been curious if Doom can be used to do arbitrary calculations (if it's Turing Complete, in computer science speak). Since I've come up with a map that can count in binary I believe that the answer is yes.

My map is a Doom II map that replaces map01. It consists of nine small rooms in a row that are connected by eight doors. In order to complete the map as quickly as possible the player starts at the left most end and runs to the right until he or she encounters a door. When the player encounters a door he or she should then take a left into some teleports. The teleports open the next door and send the player back to the beginning. Also, as the player passes through each door it closes behind him. Here is a screen shot that the text in the "Technical" section will help explain:

Screenshot of binary.wad in Doom II

Here's another screen shot. This can be seen by turning 90 degrees to the right at the initial starting point. It reveals the state of all the doors. Each open door, or one, has a light. Each closed door, or zero, does not have a light. The state displayed in this case is 00001101 = 8 + 4 + 1 = 13:

Screenshot of the lights in binary.wad in Doom II

Technical

The state of each door (whether it is open or closed) corresponds to one of the eight bits of a byte. Initially all the doors are closed, which is like eight zeros in a row. The player is only able to run completely to the end when all eight doors are open, which is like eight ones in a row. If the player plays optimally the doors count in binary.

The doors are arranged in little bit order in the sense that the first door encountered is the least significant. The number of candles to the left of each door indicate it's bit number. That is the first door has zero candles indicating it is bit 0 with a value of 2**0. The second door has one candle indicating it is bit 1 with a value of 2**1, etc. The first screenshot above shows the first two doors open. So, in the first screenshot above the byte is set to 2**1 + 2**0 = 2 + 1 = 3 = 11 in binary.

The armor bonus, which can be seen in the doorway of the second door in the first screenshot above (below the crosshair), helps the user keep track of the number of unique doors that he or she has been through since each armor bonus increases the player's armor by 1%.

The player can take a left prematurely into the teleports, but doing so only makes it take longer. The player starts with all zeros (all closed), which is the lowest possible number. The player wants to get to all ones (all open), which is the highest possible number, so that he or she can run to the end. Taking a left prematurely just closes some doors without opening another. This necessary decreases the value of the byte.

The player must leave the starting point 255 times to get all the doors open. One final run to get to the end brings it up to 256 (2**8). At 2 seconds per run it takes about 8 1/2 minutes to complete assuming the player doesn't get bored and quit first.

The map was created in Yadex, which is a Doom level editor. This screenshot from Yadex gives a good overview of the entire map:

Screenshot of binary.wad in Doom II

Note that the doors are slanted. This is so that the entire map may be payed by holding down the forward button. When the forward button is held down each time the payer encounters a door he or she slides to the left into the teleports. This results in the map counting in binary without any human intervention. The player can be thought of as an electron in a computer.

In order to illustrate how some of the line segments work I've highlighted the first door, which is a sector, with yellow in this closeup:

Screenshot of binary.wad in Doom II

Notice how a line segment near the top is highlighted with a red arrow tip as well as one on the right side of the door. The one on top opens the door when the player passes over it to get to the teleport line segment at the very top. The one on the right side of the door closes the door as the player passes through the door. Note that the line segment below the door opening line segment is another teleport line segment that is triggered if the player tries to sneak back into the room after opening the door without teleporting.

Installation

If you want to play it you'll need Doom II. The Freedoom WAD files are good enough. Try a free Doom port such as PrBoom. Finally my binary WAD file, which is here, can be run with:

prboom -file binary.wad -warp 01

Anyway, I hope you found this odd Doom map interesting. I had fun making it.

License

All of the binary* files on this site are subject to the GPL license version 2 or later.