Sign in to follow this  
Followers 0

[Vanilla Level Editing] Lesson 3: Measuring and Mapping Doom

LESSON 3: MEASURING AND MAPPING DOOM

From the previous room, you know that DOOM’s map area is divided into sectors and void space. This room’s briefing will discuss sectors in more detail, explaining their true role, showing you why they are needed and how you should use them. It provides some useful rules for the layout of your maps.

Continuing previous WAD Sorties, you will also begin a tentative expansion of your embryonic WAD by adding a new passageway as well as another room. You will also discover that there are pitfalls along the way.

The briefing starts with an exploration of the nature of DOOM-space itself, showing you just what is and is not possible within it. Take note that vital information is contained here about the limitations that the DOOM engine imposes on your design. Ignore it at your peril!

Share this post


Link to post

UNDERSTANDING DOOM-SPACE

The lines of your first WAD were laid out in a fairly arbitrary manner in the blank space of GZDB’s map-editing window. You drew them with little regard for position. The lengths you used were largely arbitrary, too. Before you can decide how to draw any of your own lines, you need to know how DOOM-space is measured and how big it is. And you need to know something of its limitations.

Share this post


Link to post

DOOM METRICS

The basic unit of measurement in DOOM is essentially the texel. Understand that this is not a screen pixel, but the smallest picture element of a DOOM engine graphic. The sizes of all DOOM elements are expressed in terms of the number of such texels, or blocks of color, that it will take to paint them. This measurement system is used throughout the entire WAD world. Map coordinates follow exactly this scheme, so a wall that is, say, 128 units long will have exactly 128 blocks of color along its length.

Deciding how texel measurements convert to real-world units is a little tricky. It seems that the folks at id Software have distorted their game world somewhat, making exact comparisons with the real world difficult. The common rule of thumb is that 16 horizontal units in Doom correspond to 1 foot in the real world, and 10 vertical units being 1 foot. Vertical scaling is generally more difficult to judge, though, as it seems to vary with the distance of objects from the viewer and is distorted by the different zoom levels that the player can select. Although you will need to have some idea of DOOM’s scaling if you are trying to reproduce some real-world setting in your WAD, you will find that, in practice, you rarely need to know the equivalent real-world sizes of DOOM objects. As you progress, you will quickly learn to start gauging DOOM-space for yourself. (There will be more to say about the implementation of real-world settings shortly.)

All Things in DOOM (including the player) have specific heights and widths. This limits the space into which they can fit. The full details of these limitations and the consequences of ignoring them are the subject of Lesson 6, "Putting Sectors to Work".

Share this post


Link to post

THE EXTENT OF DOOM-SPACE

Map coordinates can range from –32768 to +32767. Therefore, in theory at least, DOOM maps could be quite large — this range gives the gaming space a theoretical maximum area equivalent to something in excess of 1 kilometer square. In practice, however, other engine limits will be encountered long before this space is filled. This should give you some idea, though, of the space available for you to build in.

Don’t get too carried away with the vastness of DOOM-space and start building huge open areas. They are not only boring to play, they also have a tendency to be rendered poorly onscreen, owing to limitations in the game engine. As a rough guide, aim to keep walls shorter than a couple of thousand units long - Lesson 14, "The Anomalies," will show you why!

Share this post


Link to post

2-D OR 3-D?

A common misconception amongst DOOM players is that their gaming world is fully three-dimensional. As a designer, it is essential that you understand the fallacy of this notion. DOOM-space is what is usually referred to as 2.5D (as in, two and a half dimensional). The map consists of a series of items (lines, vertices, and Things) placed into a two-dimensional playing grid. Particular areas within that grid are then notified to the engine as being at specific elevations.

You have already seen how lines are arranged to create special divisions of DOOM-space called sectors. These line and sector structures hold the information about the division of the playing grid and the various elevations of its parts. This is why areas not defined as sectors are deemed void by the game engine — there is simply no information whatsoever about them in the WAD.

Share this post


Link to post

PRACTICAL CONSEQUENCES

The main consequence of this pseudo-3-D nature of DOOM-space is its inability to permit any location on the map to possess more than one vertical elevation. What this means for the designer is that no sector (or part thereof) can ever overlap any other sector. This imposes a severe limitation on permitted designs. Rooms atop one another are not possible, for example. Corridors or passageways that cross at different levels are out. So too are archways through which players can pass while enemies lurk over their heads.

This particular spatial restriction is often the one that is hardest for designers to come to terms with when planning their WADs. It can be difficult to limit one’s imagined geography in this way. And of course, many real-world environments are immediately prohibited. Gone is any chance of implementing your favorite office or apartment block, for instance.

Fortunately, there are some simple rules of layout which, provided you follow them, should keep you out of trouble. It is worth looking at these rules in some detail.

Share this post


Link to post

CORRECT LINE LAYOUTS

Perhaps the single most important key to trouble-free DOOM maps is the correct laying out of lines. This really boils down to a full understanding of the role of sectors and hence to the correct employment of them in your design. Spelling out the guiding rules for line layout first, however, should make the whole issue of the correct use of sectors more obvious.

Share this post


Link to post

NEVER CROSS LINES

The first guiding principle in laying out your maps is that no lines must ever cross. If they meet, all lines must be connected by means of a vertex. This rule ensures that all division of space on the map occurs unambiguously and that unique floor and ceiling heights can be assigned to each location through the use of appropriate sectors.

Following are some examples to illustrate this rule. The following image shows some line layouts that are not permitted. The errors are all caused by illegal line crossings. These attempted line crossings are surefire indicators of the designer trying to overlap sectors at differing heights.



Instead, here are the correct way to lay out these areas. Note that the connections break up the space in a way that discourages you from thinking of areas that physically overlap. Areas that previously might have been thought of as two sectors are now clearly seen to be three or even five.

Share this post


Link to post

THINK OF WALLS AS VOIDS

The second guiding rule for correct line layout requires you to remember the simple fact that the lines of your maps have no thickness. This means that a line is not a wall. It can be the surface of a wall, but never the wall itself. The wall is never really part of the map; what the player may perceive as a wall is formed by the void behind the lines. It often helps to think of lines as paint, or as wallpaper, hung to hide the void beyond.

Figure 3.4 shows how this rule is applied to create two adjacent rooms off a single corridor. Notice how all of the walls have had to be drawn explicitly using two lines, not just one.

Share this post


Link to post

AVOID UNCONNECTED LINES

The final guideline for trouble-free maps is to avoid lines that are not connected at both ends to other lines. Although such lines are not illegal in DOOM, they are rarely used, and until you fully understand their use, you should avoid them. This will remove any risk of your sectors failing to close and will also help to reinforce the previous guideline.

Share this post


Link to post

ROOMS VERSUS SECTORS

You may feel that I have been using the word “room” interchangeably with the term “sector,” and consequently you may be wondering how these two ideas relate to each other. You may even be equating them with each other in your mind.

So far, I have used the word “room” rather loosely. This is because a room (as I use it in these lessons) is a perceptual construct within a WAD design. It is important to appreciate that a room really only exists in the mind of the players who are guiding their game-world alter egos through the virtual environment of a WAD (and hopefully, in the mind of the designer who planned it!). It has no matching data construct in the hard, numerical world of the DOOM WAD-file.

The sector, on the other hand, is a rigidly defined data structure, designed to inform the DOOM engine about the disposition of virtual floors and ceilings within its map space.

In planning and designing your DOOM battleground, you are free to think in terms of rooms, corridors, stairways, caves, ledges and whatever other spatial entities are appropriate to the environment you are modeling. When it comes to implementing the WAD that holds your design, you must break your map up into sectors for the purpose of informing DOOM how your world should be arranged. You will need a new sector each time you need to change any of the following: ceiling height or texture, floor height or texture, brightness level, or special sector characteristics. The proper use of sectors to provide playing spaces will become more apparent as you progress deeper into this set of tutorials.

Share this post


Link to post

WAD SORTIE 4: BREAKING THROUGH THE WALLS

With the lessons of this briefing in mind, you can now begin the expansion of your embryonic WAD. To demonstrate the need for walls to have thickness, I will lead you through the addition of some territory beyond the confines of your initial hexagonal room, starting with a short passageway. The opening into the passageway will be narrower than the passageway itself, so as to create some apparent walls to the hexagonal room.

You should load up GZDB with D2WAD3.WAD as a starting point.

Share this post


Link to post

SYNCHRONIZING WADS

Before you start, you will need to check that the shape of your room is a close approximation to mine. Look at the figure and compare it with your own map. The important feature to have the same is the line that marks the southeast wall of the hexagonal room. Mine is about 500 units long and runs at an angle of 230. It doesn’t matter too much if yours is a little different; if it looks similar on your screen to the one in the figure, you should be okay. Use your knowledge from earlier Sorties to adjust the vertex positions if you need to change the layout of your lines to match mine.



Before you start drawing the new section, you may find it helpful to zoom around and scroll the view of your map so that the line of that crucial southeastern wall of the main hexagon is toward the left of the screen, leaving yourself some space in which to work to the right.

Share this post


Link to post

DRAWING THE NEW PASSAGE

To begin the new part of the map, move your mouse pointer to the center of the southeastern line of your main hexagon. This is where the new passage will join the main room.

You may remember that in a previous lesson, we drew a new sector while in Vertices Mode. Now, however, we have a problem - if we right-click on an existing linedef, we will instead place a new vertice at that point, instead of starting the procedure for drawing a new sector. Instead, we'll be using the recommended method for drawing new sectors, conveniently named "Draw Lines Mode". You can enter Draw Lines Mode by pressing Control-D, or by clicking the corresponding icon near the top left of the screen.

In this mode, when the mouse pointer is sufficiently close to the existing line, a box will appear on top of the line showing where a new vertice will be inserted. When this happens, click once with the left mouse button to create a new vertex, connected to the existing line and splitting it into two halves. When you move the mouse, you will find you are in the process of drawing a third line from this new vertex.

You can make diagonal lines easier to place in GZDB by reducing the Grid size while drawing. The default setting is 32 units, which is pretty coarse. The Grid can be changed by clicking on the icon near the bottom of the screen towards the right hand side.

Add the lines matching the following image — once again, measurements and angles are approximate but note that the first line should be perpendicular to the one you have just split and the second one should be parallel to it.

These additions should leave you with just one line to draw to complete the new shape.



The final new line needs to connect back with the original southeastern wall of the hexagon. Aim to do this about halfway along the line that runs southwest from the new shape’s starting point. Your final line must connect with the original hexagon wall, so make sure that the vertice appears to be directly on top of the existing wall before you click.

Now that you have connected back to the existing wall, you can close the sector by clicking again on the first point, or more easily, you can simply press Enter at this stage and finish the sector.

Share this post


Link to post

ADMIRING YOUR NEW WALLS

Press the Home key to center your map in the map-editing area, and then save the WAD as D2WAD4.WAD. Then you can Test Map to try out your extended WAD. Take the player over toward your new passage and look carefully at the entrance to it. Admire those nice, thick walls.

Share this post


Link to post

ADDING ANOTHER ROOM

Now that you have seen how simple it is to extend your map by adding new sectors, you are no doubt eager to add some more. You should be confident enough to add another room without too much help from me, so return to GZDB with D2WAD4.WAD as your starting point.

The following image shows the basic shape of a new room, this time connected to the original hexagon’s southwest wall. As before, begin your new drawing at one of the points of connection with the existing hexagon, working around the shape to the other point of connection. I won’t give you specific details of the new room, except to say that its long, southern wall should be made about 1,100 units long. You can copy the rest of the shape from the figure.



To add a little variety, make this new room a bit brighter than the first. Go into Sectors Mode and then right-click anywhere in the new sector. Increase the Lighting level to 224. Raise the ceiling height to 160, as well, and change its texture to CEIL3_6. Then save the WAD as D2WAD4A.WAD and take a look at it.

Share this post


Link to post

EXAMINING THE NEW ROOM

Take the player into the new room and have a good look around. Everything may seem OK at first, but if you look closely you may see that, in fact, we didn’t do too well this time.

First of all, take a close look at the ceiling. I deliberately chose a pattern that has lights in it to explain the increased light level in this room. It doesn’t look too good where it meets a diagonal wall, does it? (Yours may not be as bad as mine; it depends on the exact location of your walls.)

And what about the opening between the two rooms? That hasn’t worked very well this time, has it? The floor appears fine, but the ceiling is definitely odd. Do you remember that we set the ceiling of the new room higher than the old? There seems to be some visual confusion over this in the opening, doesn’t there?

Finally, take a close look at the walls as you move through the opening. Notice how the mortar lines of one room don’t meet up properly with those from the other. What on earth can have gone wrong?

Share this post


Link to post

EXIT: MOPPING UP AND MOVING ON

It looks like there is some real mopping up to do here. You have learned some salutary lessons about the limitations of DOOM-space, learned a lot about the laying out of lines, and seen how easy it is to extend a WAD by adding new sectors. You have also seen how easy it is to make a mess of things.

Take heart, though, for the next room will lead you some way toward a solution to the present problem. It will reveal more about lines and shine some light on the mystery of how walls are painted.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0