Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Linguica

[Vanilla Level Editing] Lesson 7: Activating Sectors

Recommended Posts

So far, you have seen how sectors can be put to use in a multiplicity of ways simply by varying their basic size, elevation, lighting, and textural characteristics. Previous lessons have touched lightly upon the fact that sectors possess an additional attribute: a special characteristic. In this room, you will learn about that characteristic, and see how it can be used. You will also be introduced to the notion of sectors that change and move, and will learn about the simplest of the moving sectors, the door.

In the WAD Sorties from this lesson, the WAD which has been developing from room to room during this mission will be given some areas where a player should not linger, as well as some new spaces beyond a couple of doors.

Share this post


Link to post

SPECIAL SECTOR ACTIONS

A sector can be given special properties, or be made to act continuously in certain ways, by making use of its special characteristic — a numerical attribute of a sector that has been ignored so far in your own sector settings.

Share this post


Link to post

THE SPECIAL CHARACTERISTIC OF SECTORS

A sector’s special characteristic determines the particular special action that that sector carries out. The actions themselves are hard-coded into the DOOM engine and cannot be changed. Setting the special characteristic merely invokes them. The setting itself consists of a code number telling DOOM which of the available effects to employ. The effect is applied across the entire extent of the sector. Note that sectors only possess one special characteristic; such effects, therefore, cannot be used in combination within a single sector. When creating a new sector, most editors set its special characteristic to 0, by default, thus producing an ordinary sector, with no special behavior.

Share this post


Link to post

SPECIAL SECTOR TYPES

For the purposes of describing them, the available special actions of sectors can be divided into four categories, as follows:

  • Damaging effects
  • Lighting effects
  • Miscellaneous effects
  • Combined effects
These will each be examined in turn.

Share this post


Link to post

DAMAGING EFFECTS

Damaging special effects do harm to a player who enters the sector. There are three levels of damaging effects — high, medium, and low — with the actual amount of harm done being dependent on the skill level at which the game is being played.

The damage a damaging sector does is applied approximately once a second, for as long as the player is in contact with the sector’s floor. The damage values are applied to a player’s health score, unless armor is being worn, in which case the damage is divided between the health and armor according to the armor class (green armor absorbs 1/3 of damage done, and blue armor absorbs 1/2). Damaging sectors only affect players; monsters are completely immune to their effects.

Share this post


Link to post

LIGHTING EFFECTS

The special lighting effects consist of blinking, flickering, and oscillating light levels within the sector. All of these lighting changes are generated by reference to the brightness level of the sector and the brightness levels of immediately adjacent sectors. The value specified for the sector’s own brightness level determines the upper limit of the fluctuation, while its lower limit is taken from the lowest light level amongst all immediately adjacent sectors. If there are no adjacent sectors with a lower lighting setting, then the sector’s lighting will usually fluctuate between its specified setting and total darkness. The available lighting effects are as follows:

  • Blink off: Lighting is at the specified level for most of the time, but drops to the lower level momentarily.
  • Blink on: Lighting is at the lower level for most of the time, but takes on the specified setting momentarily.
  • Oscillate: Lighting moves smoothly from the specified level to the lower level and back again. If there is no adjacent sector with a lower light setting, this effect does nothing.
Additionally, some lighting effects are synchronized, so that all of the participating sectors adjust their lights together. Unsynchronized sectors change their lighting levels independently of each other.

Share this post


Link to post

MISCELLANEOUS EFFECTS

The miscellaneous effects provide some very special effects indeed. They are as follows:

  • Timed door close
  • Timed door open
  • Award secret credit
  • Kill player and end level / game
These particular effects will be looked at in more detail in later lessons.

Share this post


Link to post

COMBINED EFFECTS

There is currently only one combined effect: it combines the blink-on lighting effect with high damage.

Share this post


Link to post

WAD SORTIE 13: ADDING SOME SPECIAL SECTORS

In this Sortie, you will get to try out some of these special effects by adding a few surprises for the player. As usual, you should build onto your latest WAD.

Share this post


Link to post

ADDING BITE

Obtaining that suit of armor is a little too easy, isn’t it? Let’s make it a touch harder — or at least a touch more painful! Go into Sectors Mode, right-click the hexagonal room’s platform sector, and set its special value to 5, i.e. "Damage -5 or -10% health."

You could add a surprise to the outdoor pond, too, by setting its special value to 7, i.e., "Damage -2 or 5% Health." If you do this, however, you should probably change the floor texture to a slime texture like NUKAGE1 or SLIME01; it's generally considered bad form for normal blue water to be damaging to the player, since it's fairly uncommon and usually unexpected.

Share this post


Link to post

FLASHING AND FLICKERING LIGHTS

To try out the special lighting effects, add a new area to your WAD out from the southwest corner of the old southwest room (now the platform room). The following shows the new lines needed to add a staircase and passageway descending from this room.



Draw the new lines using BROWN96 as the middle texture. The precise shape of these new sectors is not important; you may wish to refine the shape after play-testing it. One wall has the texture LITE3 on it; you may want to make this wall the correct length to hold this texture. Also, the very end sector will need to sit precisely within the grid squares in order for its ceiling texture to be rendered correctly.

By now you should be confident enough to construct these sectors without further help. The following table gives all of the settings for the new sectors, working out in order from the platform room. Note how the floors form a progression downwards by 16 units, with most other things staying the same. The wall textures given are for the left and right walls, as seen by a player progressing through the new sectors in the same sequence as given in the table.



The end of the corridor should have PIPE2 on it also. Use STEPTOP on the essential lowers of all steps and BROWNHUG on the essential uppers of the long section of the passageway. The essential upper over the new doorway should have STONE3 on it and will need to be unpegged.

When you have the sector layout to your satisfaction, set the special characteristic of the sector that has the LITE3 texture on one of its walls to 1, and set the final sector’s special characteristic to 4.

Finally, save the WAD as D2WAD13.WAD and inspect your latest modifications.

Share this post


Link to post

TRIGGERED ACTIONS

Earlier in this room, passing reference was made to an interesting pair of special sector types: the two time-triggered doors. It is worth looking in some detail at the way these operate. They provide a useful introduction to the operation of doors in general.

Share this post


Link to post

TIME-LOCKED DOORS

Special sector type 10 provides a timed lock-out of an area. It operates by reducing the sector’s ceiling height to the level of its floor 30 seconds into the game, thus effectively closing the sector to access from players and monsters alike.

Special sector type 14 provides the opposite effect, a timed opening of an area. This action takes place five minutes after the level starts. At this time, this sector’s ceiling will rise from its specified height (usually the same as the sector’s floor) to a position just below the lowest adjacent ceiling, thus allowing the player to pass out through this sector (and allowing more monsters to pass in, of course!). Five seconds later, the sector will close again, this time for good.

As you can see, these two special sector actions are very simple in their operation, but very effective. In fact, this mechanism of moving a sector’s ceiling from one height to another is used a great deal in DOOM to achieve a number of useful WAD elements. It is, for instance, the mechanism by which all doors operate. The only difference between these two rather esoteric types of door and the more common types is the activation mechanism that they employ. The time-triggered doors are activated automatically at the appointed moment, whereas normal door types are triggered by the players (or occasionally by monsters) taking particular steps (often quite literally).

Let us consider these triggering actions in more detail and compare them with the actions taking place in special sectors.

Share this post


Link to post

TRIGGERED EVENTS VERSUS CONTINUOUS EVENTS

The actions of the majority of the special sector types may be viewed as continuous: sectors employing lighting effects have lights that fluctuate throughout the game, damaging sectors cause harm for as long as the player remains upon their floor, and so on.

By comparison, the movements of doors triggered by players and monsters (and other events that will be examined in later rooms) are not continuous. They require particular actions to be carried out at particular locations.

Furthermore, the locations where these actions are performed may be at some distance from the sectors which they affect. You are no doubt familiar with DOOM’s switches and know that they frequently operate well away from the doors that they open or the platforms they raise. For this reason, these triggered actions are not attached directly to sectors. Instead, they are attached to lines.

Share this post


Link to post

LINES AS TRIGGERS

You are familiar with the role of DOOM’s lines. You know that they provide the game engine with vital information about the disposition and appearances of the edges of sectors. They can play a secondary role, also: they can act as triggers. You may recall from lesson 4, “At the Sector’s Edge,” that in addition to its flags, each linedef carries a special-action attribute. This attribute determines the nature of the triggering action which the line may carry out. It is another code number, like the sector’s special characteristic. Usually a line will have this value set to 0, meaning that it carries out no special activation. Lines with non-zero settings of this attribute are usually termed lines of special type.

Once again, the actions triggered by these special codes are determined by the game engine. You can only utilize what is provided, not add to or alter any of them. Just as sectors cannot possess more than one special characteristic, so lines cannot initiate more than one trigger action — although, as you will see, they may initiate that action in more than one location.

It is possible to use lines for their triggering action without having them contribute to the provision of sector-edge information. In this way, trigger lines can be laid out across sectors — as tripwires, for example. The usual rules for placing lines still apply: they must run from vertex to vertex, and they should not cross other lines. They do not need to form continuous or closed shapes, though, provided that the sector that contains them is itself properly closed. Lines used in this way will need to be two-sided, with both of their sidedefs assigned to the enclosing sector. The use of such lines will be demonstrated in later rooms.

Share this post


Link to post

INTRODUCING SPECIAL LINES

There is a very wide range of special line-types — sufficient, in fact, to fill a further four lessons! They all operate from the same basic activation mechanisms, however.

Share this post


Link to post

TRIGGER TYPES

Each special line is triggered in a particular way, depending upon the value of its special attribute. There are four basic activation mechanisms used amongst the line-types:

  • Permanently active
  • Use key activated
  • Walkover activated
  • Gunshot activated
Additionally, each special action may be either repeatable or not. Repeatable actions may be performed any number of times; non-repeatable actions may be carried out once only and then never again during the level. Some actions that are classed as repeatable may trigger events that can only be repeated provided that some other action subsequently returns things to an appropriate position first. (You will see an example of this in the next room.)

Some special line actions can be activated by monsters, but there aren’t many of these; they can be very useful, however.

Share this post


Link to post

ACTIVATION MECHANISMS

The action that is triggered by a line’s special attribute is generally carried out on some associated sector. The process by which DOOM selects which sector to affect when a line is activated varies from action to action but falls into two basic categories:

  • Local actions
  • Remote actions
Local actions operate on the sector that owns the left sidedef of the active line. These actions all provide doors of some kind; their use will be examined shortly. Remote actions are more complicated. They will be the subject of later lessons.

Share this post


Link to post

THE ODD ONE OUT: HORIZONTALLY SCROLLING TEXTURES

There is one special line action that is completely different from all others. It requires no triggering and does not affect any sectors. In fact, it operates continuously and affects only its own line. It is special action 48 — the horizontally scrolling texture. Any lines having this action will automatically scroll their textures horizontally while the game is in progress. Note that because horizontal scrolling is implemented through a line’s special attribute, lines using it cannot act as any other type of trigger.

Share this post


Link to post

OPEN (AND CLOSE) SESAME!

The remainder of this lesson will concentrate on locally-activated special lines. In id Software’s parlance, these are all classed as manual door lines. The basic DOOM door is activated through the first of these manual door lines: special line type 1.

Share this post


Link to post

THE BASIC DOOR

Special line-type 1 provides a repeatable, space- and monster-activated, local-action effect. It operates as follows: whenever a player is standing by this line and presses the spacebar, the game engine will raise the ceiling of the sector on the line’s left side to a position just below that sector’s lowest adjacent ceiling, thus simulating the opening of a door. This action is accompanied by the sound of a door opening. The ceiling stays in this position for five seconds and then lowers to the sector’s floor again, thus effectively closing the door.

This action can be retriggered any number of times; and the current motion or state of the door can be reversed with a further press of the spacebar. An enemy who simply approaches this line will also cause the door to open.

The figure below shows how the door action is provided by the movement of a single sector’s ceiling. The upper view is of the cross-section of a WAD with the player positioned close to a sector that has its ceiling set to the same height as its floor. Beneath is another view showing how this sector’s ceiling could rise to provide an open door. Alongside these views is a sample map that might be used to implement this area. The arrows indicate which lines carry the appropriate special attributes necessary to permit the door to be opened from both sides.

Share this post


Link to post

MAKING SURE A DOOR WORKS CORRECTLY

In order to operate correctly as a door, the participating sector needs to be set up properly, of course. Firstly, notice which way the door sector’s activating lines face in the figure. A manual door line will always move the ceiling of the sector on its left side. If you have this line facing the wrong way, the ceiling of the sector in which the player is standing could be the one that is moved — usually with catastrophic effect! Make sure, then, that both of the lines that form the rising face of the door have their right sides facing out from the door sector itself.



Secondly, the sector needs to have its ceiling level set at an appropriate height. DOOM will assume that the first activation of a manual door line is to open the door; it will therefore always take the ceiling up. You should make sure, then, that all of your door sectors are created with their ceilings at the lower positions — usually at the same level as their floors. It doesn’t matter to DOOM if you don’t set all of your doors like this at the start, though. Even if a door is not completely closed at the beginning, the game engine will still open it properly when it is activated, and all doors close completely to the floor afterwards, irrespective of their starting position.

Players usually expect to be able to pass through doors that they can open. Don’t forget to allow for this, both in changes of floor height through your doors and in the final open height of doorways. The limit of the upward motion of a door sector’s ceiling is determined by the height of the lowest ceiling adjacent to the door sector—the rising ceiling stops 4 pixels below this height.

For a player to be able to pass through the door after it has opened, you must allow for a minimum gap of 56 units between the door sector’s floor height and the final resting height of its ceiling.

Share this post


Link to post

OTHER THINGS TO LOOK OUT FOR

The actual size and shape of the door sector is largely immaterial. The doors of most WADs tend to be a standard 64 or 128 pixels wide and 16 pixels deep, to take advantage of the standard door textures, but they do not need to be. Sectors of any shape will function as doors. All you need are appropriate lines accessible to the player with which to activate them.

Don’t forget also that most doors will need to be capable of being opened from both sides. Sectors that make up doors will therefore need two manual door triggers, as you have seen in the figure. You can, of course, omit either of these triggering special attributes and make your doors capable of being opened from only the one side, if that is what you want.

Share this post


Link to post

APPLYING TEXTURES TO DOORS

The designers of DOOM have provided a large number of textures specifically for doors. The names of door textures generally start with DOOR or BIGDOOR. As already noted, the majority of these are 64 or 128 pixels wide by 128 pixels high. A few are somewhat shorter than the standard 128-pixel height, however, and will produce the tutti-frutti effect if used in areas that are too large for them.

You should already have worked out that the door texture itself needs to be applied to the line’s upper texture—the main texture will normally be left transparent, to provide the doorway once the sector opens. If you place a solid texture on the main texture slot of a door line, the door will seem to rise, but no opening will appear beneath it. The player will still be able to step through it, though. If you omit the texture from the door’s upper slot, the result will usually be HOM.

In its closed position, of course, the line’s main texture will occupy no space and therefore not appear.

Share this post


Link to post

USING DOOR RECESSES

Although most door textures will tile correctly vertically, doors generally look odd if allowed to repeat very far up a wall. The following shows the effect. This door has been implemented using the arrangement of sectors shown earlier. Notice how the door looks wrong, running right up to the ceiling like this.



To avoid this unsightly implementation, doors out of tall rooms usually require additional thin sectors, 16 units or so deep, separating them from the main room sector. Each thin sector should have a ceiling-height 128 units above their floor, to provide a recess in which the door then appears. The following shows the appropriate arrangement of sectors.



You can see the improved appearance of the door brought about by this sector arrangement.

Share this post


Link to post

PEGGING CONSIDERATIONS

The changes in ceiling height that simulate a door opening do not occur instantaneously, of course. For the action to look like a door opening, the textures associated with the door sector will need to behave in an appropriate manner. It is the job of the texture pegs to ensure that this happens.

Consider first the face of the door, as viewed by a player opening it. Remember that the appearance of this face is provided by the line’s upper texture. You will recall that the starting location for the painting of an upper texture is determined by the state of the line’s upper unpegged flag. The pattern is either painted from the lower edge of the texture upwards (when pegged), or from the ceiling downwards (when unpegged).

DOOM opens doors by moving a sector’s ceiling upwards. A player viewing this action from a nearby sector will observe the shrinking of the upper texture (the face of the door) and the growth of the main texture (the opening) below it. In order for this action to look natural, the shrinking upper texture must have its pattern rise as if being pushed into the ceiling.

To achieve this, the upper texture of the door face needs to remain pegged to its lower edge. If the upper texture were to be unpegged, the effect would be to cause the door face to remain stationary, with its pattern anchored at the ceiling adjacent to the door. Rather than appearing to move up into the ceiling, the door itself would look as though it was being eaten away by a gap rising from the floor. This effect looks unnatural, although it can be used to interesting effect at times. Make sure, therefore, that you clear the upper unpegged flag of all lines that represent door faces.

Share this post


Link to post

FURTHER PEGGING CONSIDERATIONS AROUND DOORS

Finally in this examination of the construction of simple doors, consider the sides of the sector making up the door. These will usually be single-sided lines forming the “wall” through which the doorway passes. They will therefore need only main textures. As the door opens, the height of these texture spaces will increase.

You will recall from Lesson 5, “The Low-Down on Textures,” that single-sided lines’ main textures are usually painted from their sector’s ceiling down. The implication for these side walls of the doorway, then, is that these textures will move with their sector’s ceiling as the door opens. This would look unrealistic. The side walls should stay static as the door opens and closes. This can be achieved by setting their lower unpegged flag — you will recall that this will cause these textures to be painted from the (static) floor up.

Share this post


Link to post

SUMMARY OF STEPS INVOLVED IN MAKING A BASIC DOOR

In summary, then, these are the steps involved in producing a basic spacebar-operated door:

  1. Create appropriate sectors. Any shape will do for the door,but it will need two adjacent sectors for the doorway to connect between. Unless you particularly want a tall door, make sure that the sectors adjoining the door have ceilings no more than about 128 units from their floors; use recess sectors as necessary.
  2. Make sure that the lines bordering adjacent sectors have their right sides facing out from the door sector.
  3. Set the sector’s ceiling height to the same as its floor.
  4. Put appropriate door textures on the upper texture slots of the lines representing the faces of the door; clear their upper unpegged flag.
  5. Put appropriate textures on the side walls of the door sector; set their lower unpegged flag.
  6. Set the special attribute of each door face that you want a player to be able to activate to 1.
The next Sortie lets you try this out for yourself.

Share this post


Link to post

WAD SORTIE 14: ADDING A DOOR

OK—so much for the theory. Let’s see how it is done in practice. Load up GZDB with your latest WAD and I’ll lead you through the addition of a basic spacebar-operated door.

Share this post


Link to post

ADDING A DOOR

The new door will be placed across the opening into the stairway that you added to the southwest corner of the platform room in the last Sortie.

Start by adding two new lines across the opening into the stairway. Place the first line 16 units south of the line currently dividing the platform room from the corridor. Add the second 16 units south of the first. The area between these two lines is to be the new door sector. Apply Make Sector as necessary, and then check that both of the new lines have their right sides facing out from the new door sector. If either of the lines has its tick mark pointing into the sector, select the offending line and press F to flip it over.

The alcove side-wall textures need to be changed to STONE3 to match the rest of the platform room. Remember that this texture has a 32-pixel vertical pattern repeat. The difference in ceiling height between the alcove and the main room is 184 – 120 = 64 units, so no adjustment is needed to keep these textures aligned with their neighbors.

To create the door, use BIGDOOR6 as the texture facing into the room (on the upper texture, remember) and BIGDOOR7 on the staircase side. Make sure that both of these textures are pegged. Set the special value to 1 for both of the lines with these textures, so that the door can be opened from either side.



Put DOORTRAK on the side-walls of the door sector, with the lower unpegged flag set so that the textures don’t move up and down with the door. Finally, save the WAD as D2WAD14.WAD and try it out.

Does it work properly? If not, check the way the door lines face, and that you have used the correct value for the lines’ special attributes; and then try again.

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  
×