The magazine of the Melbourne PC User Group

Your own Doom levels: Part 1
Douglas Aberdeen

So you have fished all the levels, found all the secrets and killed all the monsters. What now? Answer: Make your own levels. Not long after Doom's release, a myriad of level editors was written by Doom programming fanatics all over the world.

Editors

I have tried many of the available editors and the best two I have come across are DEU and Waded. Both are available on Melb PC BBS in the Doom areas. Waded is a DOS program, and DEU has a DOS version and a more recent Windows version (32-bit or 16-bit). The several other Windows editors I have used are extremely slow and prone to GPFs. Two other editors, DOOMED and Doom Construction Kit, are programs you may want to check out if neither DEU or Waded suit you.

DEU is very powerful, but hard to use. Waded is easier to use, but prone to crashes and you can't do some of the more advanced effects. The map compiler for DEU is also superior to Waded, resulting in a higher frame rate when playing your map, and less visual defects. Figure 1 is a shot of the DOS version of DEU in action.

OK, first some vital terminology.

Vertex: A vertex is a point to which lines join up. A curved wall contains several straight lines joined to a series of vertices.

Linedef: A linedef is simply a line. They define the borders of sectors. A linedef can be a wall, a teleport trigger, a window etc. Linedefs can be single- or double-sided. A single-sided linedef is a wall, ie you can only ever see one side of it. A double-sided linedef allows you to move between two sectors, since it's possible to be on both sides of the line. Typically a double-sided linedef will have no texture defined to either side so no wall appears in the game.

Sector: Doom editing is all about sectors. Everywhere you go in Doom is a sector. A sector is a polygon made up of linedefs.

Texture: Textures are the vertical graphics in doom. Linedefs are given a texture which turns the linedef into a wall.


Figure 1. Changingthe texture for a linedef (a wall). Recognise the map?

Flats: Same as above but are for floors and ceilings. They are defined to sectors rather than linedefs. A sector must have the same ceiling and floor texture throughout.

Things: Players, monsters, ammo, power ups, decorations etc.

All linedefs, sectors, vectors and things are identified by unique numbers, which becomes important when you are fiddling with teleporters, lifts, doors and other special sectors.

A level from scratch

Everywhere you go in Doom is a sector. This includes doors, individual stairs, lifts, windows, etc. Sectors can exist individually, joined by a common line, or even inside another sector. A room with a column in the middle is often a sector with a hole in it. Before you read about creating a sector - and give up in disgust - take heart in the fact that most editors do all the steps involved in creating a sector automatically. The editor might create a complete square room and leave you to modify it to suit.

Creating a sector

The basic process to create a sector that will become a room, follows. Put in a vertex for every corner of the room. A square room would have four vertices. Join the vertices with linedefs that will become the walls. Ensure that side one of the linedef is always pointing into the room. Side one is usually indicated by a short perpendicular line extending out of the lindef. You should declare these lines to be one-sided, meaning there is nothing outside the room.

Now tricky part. You have to create a new sector using the linedefs you just created. You declare a new sector, then assign the sector tag of side one, for each of the linedefs for the room-sector, to be a border of the newly declared sector. You must be careful that you assign the correct side of the line to be the border of the sector. Once that is done you should check the sector by selecting it in the editor's sector mode, or running a check on all sectors if the editor has that function.

This is the point up to which most editors will actually do all the work for you. It is useful to describe the process since for complex shapes you will often have to do parts of the process manually. From here you edit each side of the linedefs individually to give them textures. Then edit the sector to select ceiling altitude and flats and floor altitude and flats. Having the floor higher than the ceiling is not recommended. You can also do things like change light levels, create sectors within sectors, convert sectors to teleporters, doors, lifts... basically all the effects you have seen in the game. Note you can never have a sector on top of another. That is you can never have more than one floor.

Now that you have a single room you add "things" to go in it. You must include a "start player 1" thing if you want to test the room using Doom. Monsters are things and are automatic once placed. Different things have a different radius and they must be entirely within a sector if they are to appear. To give you an idea of the Doom's scale, the player is about 64 units high. A typical room is 256 units square and 128 units high. The largest height differential a player can "climb" is 24 units.

Compiling your Wad

To play the room, save the Wad. If you are given the option to compile the Wad, you should always do so if you have changed the shape of the map. Compilation is the process of pre-calculation of what can be seen by the player in any part of the map. It enables Doom to run so blindingly fast.

I have been very vague in some aspects of how to create a room because the details are dependant on the editor. My advice is to pick an editor and play with it. Expect to be frustrated initially, but it gets easier and faster to create good levels, and nice effects, with practice. When you first play the Wad you will encounter the "Hall of Mirrors" effect. This indicates you have forgotten to assign a texture. Often upper and lower textures are neglected. Upper and lower textures define the texture that appears above or below where an ajoining sector connects to the current sector. For example if stairs look weird, you may have forgotten to declare a texture for the vertical "lower" parts of the staircase.

Playing your Wad

To load your newly created PWAD into Doom, Doom2 or Heretic, use the -FILE command line option. For example to use a Doom II PWAD called MYWAD.WAD, I would use the command line
DOOM2 -FILE MYWAD.WAD

Using this command does not permanently replace the level. It does nothing to the original WAD file. If Doom gives you an error the chances are that you have made a mistake with a sector somewhere. You should use your editor's check function to try and find it. A common mistake is having two lines on top of each other. This is hard to find without a check function.

That's all for now folks. Next time: Putting in teleporters, adding in sounds, graphics and demos. May all monsters cower in your presence.

Reprinted from the October 1995 issue of PC Update, the magazine of Melbourne PC User Group, Australia

[About Melbourne PC User Group]