Sign in to follow this  
Followers 0

[Vanilla Level Editing] Lesson 4: At The Sector's Edge

LESSON 4: AT THE SECTOR'S EDGE

In your last editing Sortie, you successfully broke out of the single room of your first WAD (although you did so without any real explanation of how it was achieved or of exactly where your old wall went). The mission was not a complete success, however, in its attempt to add another room to your growing WAD. You discovered that DOOM’s walls don’t automatically look right on their own.

This lesson will provide you with some more explanations of what you have been doing with your editor and how much it has been doing by itself. A further Sortie will attempt to correct some of the problems which earlier Sorties introduced to your developing WAD.

The briefing starts with a look at how lines really work.

Share this post


Link to post

A CLOSER LOOK AT LINES

So far, you have had no detailed information about what lines do in DOOM WADs. You have been told that they always run between vertices, that they consist of a linedef with a couple of sidedefs attached, and that they define the extent of sectors. You have not been given any real details of what these structures are, what they do, or how they do it. It may have been apparent to you that your current lines are providing DOOM with the walls of your rooms. Yet you have been told that your lines are not the walls themselves. And you broke out of the walls of your first room without deleting (or even apparently changing) any of your original lines. You are probably wondering, therefore, how all of this fits together.

Start up GZDB with your latest WAD, and I’ll show you.

Share this post


Link to post

WHAT LINES REALLY DO

The principal role of the lines in DOOM WADs is really very simple. It is to tell the game engine about the edge of a sector. Remember that the sector is DOOM’s basic division of space. You have seen how, in essence, each sector has a floor, a ceiling, and a light level. At the edge of each sector, something must happen to those three items. Lines tell DOOM precisely what that is.

Share this post


Link to post

THE LINEDEF STRUCTURE

You know already that a linedef runs between two vertices. This determines both where the line lies on the map and also its handedness. In addition, each linedef provides a set of attributes that tell the game engine how the line should be treated during play.

Most linedef attributes are single-bit (on/off) flags that determine a line’s main characteristics. These on/off characteristics are as follows:

  • 2-sided / see-through / shoot-through
  • Impassable
  • Secret on map
  • Blocks sound
  • Not on map
  • On map from start
  • Blocks monsters
  • Upper unpegged
  • Lower unpegged

Share this post


Link to post

THE LINEDEF SPECIAL ACTION CHARACTERISTIC

In addition to the above simple attributes, each linedef also possesses a special action characteristic, which enables it to trigger particular actions during play. This characteristic will be the subject of several later lessons, but you can ignore it for now.

Share this post


Link to post

LINE FLAGS

The simple attributes of linedefs (which I shall term line flags from now on) warrant further inspection.

2-SIDED / SEE-THROUGH / SHOOT-THROUGH

The 2-sided / see-through / shoot-through flag (or just 2-sided flag, as it is more conveniently termed) serves a large number of purposes, as you can tell from its name. It is used principally to inform the game engine whether or not there are sectors on both sides of a line (although it does not need to reflect the true state of affairs here). This information is used by the graphic engine to decide whether there is anything more to draw beyond this line. It is also used to ascertain whether monsters can see through the line, and to determine the fate of bullets and shotgun pellets (but not rockets or plasma) that reach the line.

There are other ramifications for lines flagged as 2-sided, as you will see shortly. For now, you should leave the manipulation of this particular flag strictly to your editor.

IMPASSABLE

A line’s impassable flag determines whether players or monsters can cross it: they will never be able to cross a line that has this flag set. If there is no sector beyond a line, this flag is redundant and DOOM will ignore it, whatever its setting. Note that this flag has no effect on the passage of bullets or projectiles.

SECRET ON MAP

Lines with the Secret on Map flag set appear as standard red lines on the DOOM auto-map during play. This is used to hide secret doors and such-like from the players prior to their discovery. Secret areas are the subject of Lesson 11, “Let’s Get the Hell Out of Here!” of this mission.

BLOCKS SOUND

Setting a line’s Blocks Sounds flag limits the transmission of sound from sector to sector, thus preventing any non-deaf monsters from waking and hunting the player as soon as the first shot is fired. Such lines do not stop sound dead, though — you will learn more about sound propagation in Lesson 12, “Populating Your DOOM World,” of this mission.

NOT ON MAP

Lines with their Not on Map flag set do not appear on DOOM’s automap at all, even if the player acquires the computer map powerup. This flag enables you to hide any lines from the player that you feel may cause confusion. It also permits the hiding of special action lines, so that no clues to their presence can be gleaned from the map.

ON MAP FROM START

Lines with their On Map from Start flag set will appear on DOOM’s automap as soon as the level starts, even though they may not yet have been “seen” by the player. You can use this flag to give the player clues about secret locations by hinting at additional map areas. It should rarely be needed in a well-designed WAD.

BLOCKS MONSTERS

The Blocks Monsters flag enables a line to block the movements of monsters without impeding the player. You will have occasion to use this flag in later lessons.

UPPER / LOWER UNPEGGED

A line’s two unpegged flags contribute to the way in which patterns are painted on the vertical plane that the line represents. The purpose and use of these two flags is covered in detail in Lesson 5, “The Low-Down on Textures.” Before you learn the use of these flags, though, you need to know how the walls get painted in the first place.

Share this post


Link to post

PAINTING THE WALLS

You have now seen how linedefs tell the DOOM engine how each line contributes to the operation of the game. On its own though, a linedef says little about the way lines look. For that, DOOM needs to consult the sidedef.

Share this post


Link to post

THE ROLE OF THE SIDEDEF

To understand fully the role of sidedefs, you have to appreciate that each sidedef belongs to a sector as well as to a linedef. Lines will therefore need as many sidedefs as they have sectors bordering them. It is the sidedef that truly connects each sector to its surrounding linedefs and which is responsible for informing the game engine about the view of that line from its particular sector. The graphical engine consults the appropriate sidedef whenever it needs to render a sector’s boundary on the screen; the connection of the sidedefs through their linedefs then provides the links out to adjacent sectors and the data required to render fully all of the surfaces in the player’s field of view at any moment.

This interconnection and mutual ownership of data structures may sound complex, but it provides the DOOM engine with a quick and convenient way of obtaining the information it needs in order to display its world.

Share this post


Link to post

THE SIDEDEF STRUCTURE

Sidedefs provide details of the view of their particular sector edge by supplying texture names to the DOOM engine, in a similar manner to the way that the sector structure supplies texture names for its floor and ceiling. Because of the added complication brought about by the potential vertical displacement of adjacent sectors, sidedefs need to provide a little more information than just a single texture name. Each sidedef may be called upon to supply up to three texture names, depending upon the precise disposition of the floors and ceilings of adjacent sectors. Each sidedef therefore consists of three texture slots, each of which holds one texture name.

A sidedef’s three textures are as follows:

  • The normal (or main) texture
  • The upper texture
  • The lower texture
Additionally, each sidedef supplies a horizontal (X) and vertical (Y) displacement value that allows for the precise alignment of the specified textures at the time of painting. (Our discussion of the intricate details of texture alignment is deferred until the next lesson.)

Share this post


Link to post

A SIDEDEF’S THREE TEXTURES

Between them, a sidedef’s three textures can supply all of the information that is ever needed to render successfully any DOOM wall surface. This is illustrated in Figure 4.2, which shows all possible vertical arrangements of two adjacent sectors.

In all cases, a dashed line shows the two-sided line lying on the boundary between the two sectors. Letters indicate which texture slot provides the appropriate pattern for all visible wall surfaces. Remember that each sidedef supplies the engine with the details of what is seen when viewed from within its particular sector.

Share this post


Link to post

THE NORMAL (OR MAIN) TEXTURE

A single-sided line can have nothing beyond it. DOOM knows, therefore, that when rendering any visible portion of such a line, it will need to apply paint between the current sector’s ceiling and its floor in order to completely block off any further view. It obtains the name of the pattern to use as this paint from the line’s normal-texture slot.

The outer walls of the sectors in the figure (with letter Ns adjacent to them) consist of lines of this type.

A line with a sector on each side of it needs to have the relative heights of the floors and ceilings of these sectors taken into consideration before anything can be painted. In these cases, the normal texture is only applied to the gap between the lower of the two ceilings and the higher of the two floors. Again, the figure shows these areas with a letter N, this time on the dashed lines between the sectors. Note that one such letter occurs on each side of these lines. Each provides the view of that space from its own particular side.

After dealing with the normal texture, there may still be other portions of the wall to be painted, as will happen when a sector’s floor is lower, or its ceiling higher, than its neighbor’s. The other two texture slots are used to provide the paint for these additional areas.

UPPER TEXTURE

The upper texture is used to paint the wall area between a sector’s ceiling and any lower adjacent ceiling. The figure marks these areas with the letter U.

LOWER TEXTURE

The lower texture is used to paint the wall area between a sector’s floor and any higher adjacent floor. The figure marks these areas with the letter L.

Share this post


Link to post

MISSING OUT THE PAINT

In some cases, you will want a line to be completely transparent — as with most of the normal textures on the two-sided lines shown in the figure. Most lines between adjacent sectors are like this, in fact, to enable a player to see from one sector to the next. DOOM uses a null or transparent texture setting to achieve this. This special value is designated by means of a dash character (–) in the appropriate texture slot.

This special texture (which is really a lack of texture, of course) causes the engine to paint whatever is in view beyond the line, rather than painting some pattern in the line’s vertical plane. It may therefore only be used in a location where there is another sector to be seen through it; otherwise you are inviting a view of the void — an action you will always regret. An inspection of the figure should indicate which locations these are.

Share this post


Link to post

PUTTING PAINT IN THE RIGHT PLACES

As you can undoubtedly appreciate, with a WAD’s potential for complex geometric arrangements, it is vital that the graphical engine be supplied with correct and complete information if it is to perform its task of rendering the DOOM world correctly on the screen. It is important that you learn to recognize the areas where texture information is crucial, if you are to avoid problems with the way your WADs appear.

Share this post


Link to post

ESSENTIAL TEXTURES

The biggest cause of serious problems in the on-screen rendering of DOOM WADs is the omission of essential textures. By this, I mean the use of the transparent texture in an area of wall that has nothing to see beyond it. You should regard the following as places where a texture is essential:

  • The main texture of any single-sided line
  • Any upper texture where the current sector’s ceiling is higher than its neighbor’s
  • Any lower texture where the current sector’s floor is lower than its neighbor’s
Again, look back to the figure if you can’t immediately see why trying to look through these areas is not a good idea.

Discussion of the full consequences of omitting essential textures is deferred until the next lesson. For now, just note where the presence of a texture is crucial and try to ensure that you don’t omit textures from these locations.

Share this post


Link to post

WAD SORTIE 5: FIXING THE MESS

Now that you understand something of the way in which lines work, you should take a more detailed look at your WAD to see how WADED has handled line settings so far (that is, when left to its own devices). The causes of the problems might even become apparent.

Share this post


Link to post

LOOKING AT THE LINES

With D2WAD4A.WAD loaded and Linedefs Mode selected, try clicking a few of your lines in turn. Notice how just about all of your lines are flagged as impassable, have no left sidedef (shown by the left-textures column being entirely empty), and have STONE2 as the right main-texture, with the transparent texture (–) in the right upper- and lower-texture slots. In other words, all of your lines represent impassable surfaces, painted with the STONE2 texture from ceiling to floor. I hope this sounds reasonable!

If you inspect the line that separates the main hexagon from the passage in the southeast corner, however, you will see that this is different from most of your other lines. This line is flagged as two-sided, having right and left sidedefs, with the transparent (–) texture assigned to all slots. This is, therefore, a line through which the player can both see and walk — it is an opening in the “wall” of impassable lines around it. This is the line that GZDB changed when you added the southeastern passage to the family of sectors in your WAD. GZDB made this hole in the wall for you by switching two flags (impassable and two-sided) and removing the paint from the right normal.

You may have already noticed that GZDB gave you a visual clue to the action it took — look carefully at this particular line on your map and you will see that it is displayed less prominently than your other lines. GZDB always uses this dimmer color and thinner linestroke to distinguish two-sided lines from single-sided ones on your map, so that you can always tell at a glance which is which.

Share this post


Link to post

THE OFFENDING LINE

Turn your attention to the equivalent line in the southwest wall of your hexagon — the one that connects the hexagon to the new room off to the southwest. You can spot now, I hope, that this is two-sided, even before you click it. When you do click it, observe that its settings are identical to its counterpart in the southeast wall. But notice that here GZDB marks the Back Sidedef upper-texture-slot with a warning sign. This is a warning that there is a texture missing from this line.



Remember that you made the ceiling of the new room quite a bit higher than the ceiling of the hexagonal room? When viewed from inside the new room, there will be a step down along this line from the level of its ceiling to the level of the adjacent ceiling. DOOM will need to be told what to paint on the vertical surface of this downward step. (It will, of course, have no such requirement when viewing the southwest room from within the hexagonal room. From there, the step up on the other side of the line is hidden by the hexagonal room’s lower ceiling. Hence the need for two sidedefs in these situations. Again, look back to the previous figure if you’re having difficulty visualizing this.)

It would be sensible, I suppose, to fill this missing texture with the same texture as used for the neighboring walls. I’m getting tired of STONE2, however, as I’m sure you are, so I suggest you look for an alternative. It would be nice to use a new texture for the whole of the new room, wouldn’t it? Let’s see what we can find.

Share this post


Link to post

CHOOSING A WALL TEXTURE

While viewing lines in GZDB, the list of available wall textures operates in exactly the same way as the Floor/Ceiling texture list box that appears when you are viewing sectors. When you right click on a linedef, notice how STONE2 is the currently selected texture. Using the right mouse button, click an entry in the list box to preview it on the screen, just as you did with the floor textures. The preview of a wall texture is similar to that of a floor tile, but the graphic is generally bigger and there is a little more information displayed. The next room will examine wall textures in more detail, so I won’t dwell on the subject here.

Take a look at the texture called STONE3. This would seem like a good texture to introduce into the new room — it is related to the texture of its neighbor’s walls but different.

Share this post


Link to post

CHANGING LINES EN-MASSE

Now that you have a new texture for the new room, it needs to be applied to all of the lines that make up this southwestern sector. Selecting each of these lines in turn and changing the entry in all of their right normal texture slots sounds rather tedious, though, doesn’t it? Fortunately, GZDB provides several different shortcuts for selecting multiple lines.

  • The first, and most obvious, way is to right click on each line in turn. It will turn red showing it has been selected. When you click on the next line, it will also turn red, and so forth. If you click on a line a second time, it will turn back to white, showing it has been deselected. This method can grow tedious with a large number of lines, however.
  • While in linedefs mode, you can right-click-and-drag to draw a box that will select every linedef within it. Since this will often select additional linedefs you don't care about, you can click on individual linedefs to deselect them. If you hold down shift while clicking and dragging, you can even select multiple groups.
  • Additionally, you can switch to sectors mode and select sectors, then switch back to linedefs mode, and all the associated linedefs will be selected.
Using one of these methods, select all nine lines that you added to form the new room in the southwest corner of your map. Do not include the two-sided line linking this room with your hexagon. Make sure that no other lines are included in your selection before going on; click any that are, to deselect them.

When you have all nine lines selected, right click on one to enter the Edit Linedefs window, and edit the middle texture on the first side to STONE3.

When you are sure that you have the correct nine lines selected and STONE3 in the appropriate texture field, click OK twice, and GZDB will make the changes you have requested. You will see that all the lines are still selected, however; press C to Clear the selection.

Share this post


Link to post

FIXING THE PROBLEMS (MAYBE)

Now select the line that runs across the entrance to your newly painted room. Apply STONE3 to the missing upper texture field on the back side of the linedef. Right, that’s one problem solved.

One of my other complaints about this room is the poor ceiling texture. I didn’t like the way the lights disappeared into the walls. You can rectify this by applying a new ceiling texture. Go back into sectors mode; right click in the southwest sector to access its attributes; change the ceiling to TLITE6_6 and apply it.

When you’ve done that, save the file as D2WAD5.WAD (there should be no need to build the nodes) and try the WAD out. Is that opening into the new room any better now?



Never mind. Soldier on. Let’s look at the problem more closely.

Share this post


Link to post

RE-EXAMINING THE PROBLEM

What is it that looks odd about your gap through the wall now? Well, there is still a problem with the matching of the mortar-lines. There remains a discontinuity where the lines on the hexagonal room’s walls meet those coming through the gap. You didn’t expect these to change with the latest modification, though, did you? The vertical step down from the higher level of the southwest room’s ceiling to that of its neighbor does appear in the view now. The mortar lines on this wall section (as it now appears) don’t align too well with its neighbors’, however. And it looks to be in a rather odd place — wouldn’t you expect that step down to occur in a plane flush with the inner surface of the southwestern room’s walls? Maybe it is time to return briefly to the drawing board and rethink this area of the WAD.

First, ask yourself what it is that makes this opening different from the opening at the other side of the hexagonal room. You experienced no difficulties there, so why are there problems here? The answer, of course, lies in the change of ceiling height across the opening. The southeastern opening uses the same floor and ceiling heights as the main room. In fact, it uses the same floor and ceiling textures as well as the same lighting level. There was no necessity to create a new sector there at all—you could have merely extended the hexagonal room sector around the new shape.

Don’t worry, though. It was expedient to develop the WAD the way you did, and there is nothing much wasted as a result. You could recombine the lines into one sector, but there is little to be gained by so doing. As it is, it is always possible to change either one independently of the other should you ever want to. I’d leave it as it is.

So, having identified the problem as the change in ceiling height, let’s examine the solution afresh.

Share this post


Link to post

RETHINKING THE SOLUTION

Consider what is really wanted here: a hexagonal room connecting to another room, through an opening in the wall. Now, how many sectors is this? The WAD currently implements this in two sectors. Would it not be better as three? Consider the following:

  • Hexagon room
  • The southwest room
  • The passageway in the wall
This way, each area can have its own ceiling height, with the interconnecting passageway handled independently of the two rooms.

Your WAD is suffering from a case of insufficient sectors! This is quite a common fault in the WADs of beginners. It generally demonstrates that the novice has yet to grasp fully the correct use of sectors.

Now return to your WAD, wiser than you were. You need to change the way the two rooms interconnect.

Share this post


Link to post

REBUILDING THE INTERCONNECTION

Reload GZDB with D2WAD5.WAD. Enter Draw Lines mode and amend the interconnecting gap between the hexagonal room and its southwestern neighbor. This gap currently has a single line between the two rooms, marking the line of the hexagonal room’s southwest wall. There are two vertices that, if connected to each other by a line, would provide another line, parallel to the first, and fulfill a similar role in completing the line of the southwestern room’s northeast wall. Add this missing line. After drawing the line, you can right click or press Enter. You will find that GZDB automatically splits the old sector in two along this line.

You should now go into sectors mode and inspect the new interconnecting sector. Notice that it has inherited the settings from the sector to the southwest. Go into its properties and change the ceiling height to 120 to match the hexagonal sector.

Then go back into linedefs mode and inspect the textures of the new line. Notice that GZDB hasn't supplied a texture for the now-essential upper texture. Change it to STONE3 to match its neighboring lines, then save the WAD as D2WAD5A.WAD and try it out.



Examine the “improved” doorway. It does look a little better when viewed from the southwest, doesn’t it? The lintel is now flush with the walls, which improves its appearance somewhat, but the mortar lines still don’t match up. If you look closely and compare the current WAD’s view through the gap with the earlier view, you will see that the mortar alignment problem through the gap has changed but not noticeably for the better.

Share this post


Link to post

MODIFYING THE INTERCONNECTION

Try one more modification. Reload D2WAD5A.WAD, go into sectors mode, and select the small interconnecting sector you just made. Reduce the ceiling height to 104. Doing this will create another essential texture — can you work out where it is?

To see the missing essential, take a look at the boundary between the interconnecting sector and the hexagonal room. The left upper-texture is still set for STONE3. This is unnecessary now, and you can delete it if you wish. Note that the procedure to delete a texture is to replace it by the "-" texture, not by deleting the name entirely.

Also note that the right upper-texture is now marked as essential by GZDB (although it hasn’t bothered to supply it!). You should be able to work out for yourself why this texture is essential.

Apply STONE2 to this slot. Save as D2WAD5B.WAD — no node-building should be necessary. Quit, then try the WAD.

You should find that this has produced an opening that looks (structurally) better from both sides — although it has now completely messed up all of the mortar-line alignments around the opening!

It would seem that there are still some things to learn here.

Share this post


Link to post

EXIT: MOPPING UP AND MOVING ON

In this lesson, you learned a lot about the way lines work in DOOM. You learned how they can be made to produce both walls and the openings in them. You found out how and where paint can be applied, and you have learned to recognize where it is needed. You saw how to access some more features of WADED, and you have moved away from the ubiquitous gray stone of your first WAD.

Your latest Sortie made some progress towards correcting the faults around your WAD’s doorway. What you need now is the low-down on how textures are applied to the walls, so that we can mount a full-scale rescue attempt on this area of your WAD. You will find everything you need in the next lesson.

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