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

[Vanilla Level Editing] Lesson 8: Remote-Control Sectors

Recommended Posts

In the previous lesson, you had your first encounter with DOOM’s active sectors. You learned about the sector’s special characteristic, which imbues a sector with a particular behavior during play. You were also introduced to the ability of lines to initiate certain actions in sectors. In that room we concentrated on locally activated sectors: sectors which have their actions triggered from one of their own lines.

In this lesson we will turn our attention to remotely activated sectors. These sectors may have the triggers for their actions located at some distance from them. You have seen that the local, manually activated sector actions are, in fact, all doors of one kind or another. In this room you will discover more ways to make doors operate: you will be shown the use of wall-mounted switches and tripwires.

The WAD that we have been developing from room to room in this mission will gain some additional doors during the forthcoming Sorties. We will also begin the development of a future area of maze with the introduction of some fairly complex light switching arrangements. We start our exploration of these remotely controlled sectors, though, by examining in detail the remote activation mechanism itself.

Share this post


Link to post

TRIGGERS AND TAGS

As you have already seen, a locally activated sector is connected to its initiating line through that line’s left sidedef. It would be somewhat restrictive to force all activating lines to be connected to their target sectors in this way, though. DOOM therefore provides an additional way of connecting special lines to the sectors they affect. This mechanism is called tagging.

Share this post


Link to post

TAGGED ACTIONS

The tagging of lines and sectors is a simple process. As well as having a special attribute, each of a WAD’s lines and sectors also carries a tag number. Ordinarily, this tag number will be set to zero — meaning that the tag is not in use. Actions that utilize the tagging mechanism — all of those provided by the remotely activating special line-types — operate by matching the tag of the activating line to that of a target sector, whenever the line is triggered. All sectors that are found with a matching tag are subjected to the action that the line initiates.

The tag number itself is nothing more than an arbitrary identification number. Most map editors assign tag numbers automatically as needed; you should never need to know their actual value. All you should need to do is set an appropriate special line-type defining both the action that will occur and the method by which it will be triggered, and also indicate a target sector where you want the action specified by the line-type to be carried out.

Share this post


Link to post

MULTI-ACTION TRIGGERS

DOOM does not insist that lines or sectors possess unique tag numbers. Indeed, you may not wish them to: a single line can thus initiate its specified action in several sectors simultaneously, just by having these sectors share the same tag number. Similarly, a sector (or a group of sectors with the same tag) can be made to undergo different actions by using more than one activation line with a common tag number. It is therefore possible, for example, to have a line that opens several doors simultaneously; or to have a door that can be opened from a number of different switch lines; or, indeed, to have a sector that can behave as a door, say, if one line is used but as a crushing ceiling if activated from another.

Because a line only has one special attribute, it is not possible to have a single activation line trigger different actions. You could not, for example, have a tripwire that opened a door behind the player at the same time as it turned the lights out ahead. Furthermore, if you have sectors that share a common tag number, those sectors will remain linked for all actions applied to them through the tagging mechanism. It would not be possible, say, to have a line that caused a group of sectors to open as doors and to have a line elsewhere rigged to close just one of them.

The locally activating triggers explored in the last room remain unaware of such groupings, though, because they do not use the tagging system. It is possible, therefore, to have a number of doors, each of which could be opened as a basic door but which can also be operated as a group through the use of shared tag numbers.

Share this post


Link to post

THE ACTIVATION MECHANISM

Because it is possible to have more than one line trigger any particular sector, there exists the potential for activation conflicts. DOOM has a simple way of resolving conflicting requests made of the same sector. The rule, generally, is that if a sector is already involved in an activity, that action must be complete before the sector can participate in any other kind of activity. Trigger requests are not queued. If a particular target sector is not available to participate as a line is triggered, then that sector will be left out of the action.

Additionally, some actions lock out all further actions on a sector, while others can entrain additional, untagged sectors in their activity. Some actions require their participating sectors to be set up carefully for them to be effective. The linking together of sector actions to form complex arrangements of moving and changing sectors will be covered in more detail in Lesson 10, “Complex Moving Sectors.”

Share this post


Link to post

MISSING TAG VALUES

Although the tagging of active lines to their target sectors is often made simple by map editors, it is always possible to make slips. The most common mistakes and their consequences include:

  • Not setting a tag number for a remotely-activated line-type: The precise result of this depends upon the line-type involved. Some will simply not activate; others will locate all sectors with a tag value of zero (usually the majority of the sectors in the WAD) and apply the action to these. Needless to say, this can lead to some unexpected and often spectacular results when the line is activated. If you find that all of your ceiling and floor heights have suddenly changed, for example, as you move around your WAD, suspect the presence of a line with a special line-type and a tag value of zero.
  • No sector has a matching tag number: The outcome of this error again depends on the particular line-type. The usual result, though, is a crash to DOS when the line is activated. This error can easily come about if you have a special line tagged to a sector and then subsequently alter the sector’s tag number by tagging it to a different line.
Many editors will provide internal consistency checks to alert you to the presence of these errors.

Share this post


Link to post

TOO MANY ACTIVE SECTORS

Note that the number of sectors that DOOM can have in motion simultaneously is limited to 30, which should be ample for most WADs. If this number is exceeded, DOOM will crash.

Share this post


Link to post

TRIGGERS / RETRIGGERS

Walk-through triggers are activated as soon as the player steps over them. Consequently, they are only of use on two-sided lines. These lines can be either standard lines between sectors, or lines added within sectors. Note that players are deemed to have stepped over a line only when their center point makes a transition from one side of it to the other. This means that there will need to be a gap of at least a player’s radius (16 units) on each side of any walk-through line for it ever to be activated.

Walkthrough lines often act as invisible trip-wires used to spring surprises on the player. With just a few exceptions, these lines can be activated from either side. The retrigger actions will occur on each crossing of the line, while the trigger class of actions will only happen the first time the player crosses the line.

Share this post


Link to post

GUN-ACTIVATED ACTIONS

Impact-activated lines require the player to fire a gun (or aim a punch) at them. (Note that rockets and plasma fired at these lines have no effect. The fist and chainsaw will work on them, though!) Suitably armed monsters firing at these lines will also activate them. There are not enough of these types of action to warrant separate names to distinguish the one-off from the repeatable actions.

Share this post


Link to post

SWITCHES AND BUTTONS

The final category of remotely activated lines requires the player to press the spacebar while adjacent to and facing the line. Note that players cannot activate a switch or button that is not in front of them. In addition, these special lines can only be activated from their right. If a player attempts to operate a switch-line from its left side, nothing happens.

A player does not need to be pressed close up against these lines to activate them. If a player’s center point is within 31 units of a switch or button when the spacebar is pressed, the line will be activated, provided that there are no other intervening special lines (of any type). Note that this prohibits the stacking of several spacebar-activated lines close together in an attempt to have them all triggered at once when a player presses the spacebar in their proximity. In such cases, only the line closest to the player can be activated (and only then if the player is to its right). Similarly, any walk-through trigger placed to the right of a spacebar-activated trigger will need to be crossed before a player can operate the latter.

Share this post


Link to post

SWITCH-LINE TEXTURES

Some “solid” surface is often needed for a switch or button line, if only to constrain the player in the correct position to operate it. It is also usual to provide the player with some indication that there is a switch line waiting to be activated. This is normally achieved through the use of appropriate wall textures.

Share this post


Link to post

GENERAL TEXTURES

A number of textures are available to make switch-lines look like whatever they represent: a door face, a switch to be thrown, or a button to be pressed, for instance. The following shows some of them. Use these textures as necessary to encourage players to use the spacebar to perform whatever action is provided by the line.



You have already used some of these textures in your own WADs — not only various door textures but also a couple of the switch textures. These latter textures are interesting because of their special properties and capabilities. Their use will be examined in some detail.

Share this post


Link to post

SPECIAL SWITCH TEXTURES

The designers at id Software have provided a number of special wall textures to simulate wall-mounted switches and buttons. The names of these textures all begin with SW1. If you look at a full list of the wall-texture names, you will see that each SW1 texture has a matching SW2 partner. Together, each SW1/SW2 pair of textures provides the patterns for a switch or button in both untriggered (SW1) and triggered (SW2) states. The following shows one such pair of textures.



The two textures SW1LION and SW1GARG, which you have already used in your WAD, fall into the switch texture category. You may have discovered that when they are used on their own, these textures do not automatically provide you with any switching action. They do not change to their partner pattern, just by pressing the spacebar. Try playing your latest WAD again if you hadn’t noticed this. Walk the player over to each of the alcoves and observe that these textures are quite static, whatever you do to them. (If you haven’t been building this mission’s WADs, D2WAD15.WAD can be used here. The alcoves in question are in the passageway to the east of the player’s starting position.)

Used in conjunction with appropriate special line-types, however, these lines will animate automatically. DOOM will change a SW1 texture to its matching SW2 counterpart whenever the player activates a switch or button line. DOOM also knows whether to change the texture permanently (for a switch action) or just temporarily (for a button action).

Use of an SW1 texture on a special line also causes DOOM to emit the characteristic “clunk” as the line is activated. This sound is produced in addition to other sounds associated with the action.

Share this post


Link to post

USING THE SWITCH TEXTURES

The SW1/SW2 texture pairs may be used on any suitable upper, lower, or main texture slot, as dictated by the particular sector arrangements. Thought will need to be given to the alignment and pegging arrangements used, in order to keep the representation of the switch at the correct height— note that the precise switch position varies from texture to texture. You need to check this carefully when you use these textures.

Generally, lines that use these textures on the main slot will need to have their lower unpegged flag set to force the texture to take its alignment from the floor. If you cannot set a line’s lower unpegged flag for some reason, you will need to apply appropriate Y-offsets. This can occur where the switch itself is required to take part in some movement or other — on a door-face, for instance — or is located adjacent to floors that move.

You may need to position the switch line in an alcove or other recess, in order to limit the number of vertical and horizontal repetitions of the pattern — multiple images of the same switch look weird and will confuse the player into thinking that more than one switch is present.

If you want a single switch to appear in the middle of a long wall without using an alcove then, provided that the sector ceiling is sufficiently low for the texture not to repeat vertically, you can break the long wall into more than one line. The length of the line acting as the switch should be made the same as the width of the switch texture. Most of the SW1/SW2 texture pairs provide switch images superimposed on the standard wall textures to enable you to do just this. Use the standard wall texture on the adjacent wall sections, and a matching SW1 texture on the section carrying the switch action.

Share this post


Link to post

MORE DOORS

The previous section examined locally activated doors. This section looks at DOOM’s door mechanisms further and presents the remaining special linetypes provided for their implementation.

Share this post


Link to post

SETTING UP REMOTELY ACTIVATED DOORS

The procedure for setting up remotely activated doors is very similar to that employed for basic doors. Here are the essential steps:

  1. Create appropriate sectors.For doors to look good, make the sectors adjoining the door have ceilings no more than about 128 units from their floors; use recess sectors if necessary.
  2. Make sure that door lines bordering adjacent sectors have their left sides facing into the door sector. This step remains necessary even for remotely activated doors. Odd effects result from getting this wrong. You can find all of your ceilings (or even your floors) moving when you activate incorrectly made doors!
  3. Set the door sector’s ceiling height to the same as its floor so that the door starts in the closed position. Put appropriate door textures on the upper texture of the lines representing the faces of the door; check that the upper unpegged flag of each of these lines is clear. Use appropriate textures on the side walls of the door sector with the lower unpegged flag set.
  4. Choose an appropriate activating line for the door and set its special attribute to the required value (given shortly).
  5. Tag the activating line to the door sector.
The next WAD Sortie will lead you through this process in detail.

Share this post


Link to post

SHOOT-EM-UP DOORS

The only available impact-activated (or gun-activated) door does not close automatically, even though it is classed as a repeatable action (GR). If you want to have a door that the player must shoot at repeatedly in order to keep it open, you will have to tag an additional active line to this door to close it in some way between openings. A later Sortie shows you how this can be achieved.

Share this post


Link to post

WAD SORTIE 16: ADDING SOME MORE DOORS

It is time now to enhance your WAD with additional doors. Let’s start with a trip-wire activated door.

Share this post


Link to post

ADDING A TRIP-WIRE ACTIVATED DOOR

The dark and winding staircase leading out of the platform room would seem an ideal location for a tripwire activated door. This area is calling out for a door that opens as the stairs are descended, disgorging monsters into the stairway behind the player.

The following shows the sectors to add to implement a secret door off the stairway, with another room behind it.

Share this post


Link to post

THE NEW AREA

Notice how the new area has been divided into four sectors:

  • The door into the room: This door is to be opened by the player descending the stairs in the corridor outside it.
  • The central section of the room: This section will have its lighting set so that it appears to be illuminated through the door by the lights in the section of corridor outside it.
  • Two “wings” of the room: Either side of the illuminated central section are two darker sections. These are in the shadows cast by the sides of the doorway. They will be useful hiding places later for various goodies.

Share this post


Link to post

FIXING THE LIGHTS FOR THE NEW ROOM

Add the lines for these new sectors, using BROWN96 as the default wall texture. However, you have a decision to make.

At the moment, the stair sector that this new area will adjoin has a special characteristic in use: type 1. This blinks the lights off at random intervals. You need to decide what you want to do with this. Remember that the central sector of the new secret room is to appear as though it is illuminated by the lights in the wall facing its door. If you leave this blinking in effect, you will need to find a way to make the lights of the inner room and doorway flicker in synchronization with the corridor lights.

Special sector type 1 does not provide synchronized flickering. The lights blink randomly and independently in all sectors with the setting, so special sector type 1 cannot be used here — if it were, the result would look odd. Sector specials 12 and 13 each provide synchronized blinking of lights, but both of these effects are classed as blink-on, so if used, the sectors will be at the lower lighting level most of the time and will only blink to the higher level momentarily. You need to decide, then, which effect you would prefer — synchronized blink-on, with these areas in semi-darkness most of the time, or steady illumination.

When you have made up your mind, apply the appropriate code to the existing corridor sector’s special characteristic. You should find that the sector settings for the corridor are applied throughout all of your new sectors this way. The following table provides the remaining settings for the new sectors. Two sets of lighting figures are given in this table. The principal figure is for use in areas with the blink-on special setting in use; the figures in parentheses should be used if the area is set for static lighting.



Take special notice of the brightness levels used for these new sectors. The principal figures have been chosen carefully to keep the blink-on lighting effect working correctly throughout the new area. In this arrangement, the door and main room sectors both have neighbors with lower brightness settings. Had these been set to the same value, then the door sector would not have had a neighboring sector with a lower light level, and its light level would then drop to zero between blinks. This would look unnatural. When the values in the table are used, only the wings of the room have no neighbors with lower light levels, and it is acceptable for these areas to drop to total darkness.

Note also how the settings have been increased a little over the ideal static brightness settings to make allowance for the periods of illumination being short.

Share this post


Link to post

INSTALLING THE TRIP-WIRE

Now pick a suitable trip-line for the activation of this door; one of the stair risers around the corner from the door would seem to be a good choice. Enter Linedefs Mode and click with the right mouse button to select your chosen trip-line. Set this line’s special attribute to 2 — to cause a door to be opened as soon as a player walks over this line. Tell GZDB which sector is to be the door by switching to Sectors Mode, right clicking on the appropriate sector, and adding the same tag number. You will know it worked when, upon returning to the main window, hovering over the sector or linedef will show an arrow pointing from one to the other to indicate the relationship.



Once opened, this door will stay open for the rest of the game. In particular, it will enable whatever monsters you care to place in the room either to track the player (once they have been awakened) or to lie in wait against the player’s return.

Share this post


Link to post

BUILDING THE DOOR

Check that both the lines that represent the faces of the new door have their right sides facing out from the door sector. You will probably have to flip one of these. (Select it and press F, remember.) Then apply BROWN96 to the appropriate upper textures. This is to be a secret door, so there should be no hint of its presence through texture changes. Set the Secret on map flag for the outer face, to prevent the map from giving the game away, too.

Now consider the texture alignment of the corridor-side door face. Because the player will discover the existence of this door soon enough, this face should contain no clue to the door’s presence. You need to ensure, therefore, that its texture aligns precisely with its neighbors’. A casual consideration may lead you to think that no treatment is needed; it is easy to be misled into thinking that this wall section has not been changed substantially by the addition of the new sector. This would be wrong, though. The wall’s texture is no longer provided by a main texture, but by an upper.

Remember that (pegged) upper textures are painted from their lower edge up (currently the floor, in this case), while the adjacent main textures are painted from the ceiling down. Consequently, these textures will only align with each other if the corridor is precisely the same height as (or a whole multiple of) the texture pattern: 128 pixels. It isn’t. The door-face texture will therefore need alignment if it isn’t to be obvious to the player.

Don’t be tempted to just unpeg the upper texture. This would solve the texture alignment problem, but it would also spoil the effect of the door opening. You will need to use a Y-offset to adjust this texture alignment.

Luckily for us, aligning textures is no big deal - press Q to to into Visual Mode, and just use the arrow keys to move the texture to the same height as its neighbors.

Finally, check that the short through-wall sides of the door sector have their lower unpegged flags set, to prevent them from moving with the door. (The BROWN96 texture can be left on them, in my opinion.) Your new area should then be ready for a tryout. Put a couple of monsters in the new room if you want to see how they react to the player tripping the door. I’ll leave a full consideration of the populating of this room until a later Sortie.

Share this post


Link to post

REFINING THE DOOR ACTION

After trying this modification out, you may wish to use a different line for the trigger. To do this, you will first need to break the link between the current trigger and the door. Do that by selecting the trigger line in Linedefs Mode and resetting the tag and trigger to 0. The arrow between the line and the sector will disappear to show you that the link has been broken. (Don’t forget to reset the line’s special attribute back to 0; otherwise this line will continue to attempt to open a door — one that DOOM won’t be able to find.) You can then link another trigger to the door sector, just as you did your first.

When you’re happy with this area, I’ll show you how to add a differently triggered door.

Share this post


Link to post

ADDING BUTTON-ACTIVATED DOORS

As already observed, you have a couple of alcoves in your WAD with suitable SW1 textures on their walls, ready and waiting for the implementation of some switch-activated doors. Let’s start by hiding the marble corridor, which leads to the one-way staircase, behind another secret door.

Share this post


Link to post

CUTTING OFF THE MARBLE CORRIDOR

Add a new line in the marble corridor some 16 units north of its junction with the southeast passageway. The new sector’s lighting level should be 144. Both the floor and ceiling should be at a height of 0 and have DEM1_5 on them.

Share this post


Link to post

BUILDING THE NEW DOOR

Flip any of the new door’s face lines that are the wrong way around. (The new line is probably at fault here.) Then put MARBFAC3 on the new line’s essential upper texture. Use STONE2 on the upper part of the passageway line, keeping this texture’s mortar lines aligned with those of the adjacent walls by using an appropriate Y-offset.

This face of the door used to be the wall over the doorway. You will therefore need to change the line’s pegging to something more appropriate. There is also a redundant texture to remove. Set this line’s Secret on map flag, too, to hide the new door on the auto-map.

Put DOORTRAK on the through-wall side-lines of the new sector, and set their lower unpegged flags. Now tag the rear wall of the northern of the two SW1 alcoves to the new door sector by switching to Sector Mode and right-clicking in the door sector. Set the switch line’s special setting to 63 SR Door Open Wait Close (you will find it in the list of special attributes, in the Door category) to provide a repeatable open-and-close door action from this line.

Share this post


Link to post

ADDING ANOTHER TRIGGER

You have now created a door that the player can open from the alcove switch any number of times. There is currently no way to open the door from the other side, however. Any player who makes it through this door before it closes will become trapped when it does close. (Using this door as a trap makes the one-way stair rather obsolete, doesn’t it?)

You could set the special attribute of the inner face of this door to 1. That would allow the door to be opened from the marble-corridor side as a standard door. Rather than doing this, though, I suggest a different approach: put line-type 90 (WR Door: open and close) on the line forming the riser of the second step, tagging this to the door sector. In my opinion, this is a better solution than making a standard door, because a player may be tempted to try the door before proceeding up the stairs, just to see whether it can be opened from this side. A player who thinks that it can’t — as my proposed method will make it appear—will be relieved to discover that the door does, in fact, open as the stairs are climbed. The relief may be short-lived, however, if they fail to notice the stair-trap!

If, on the other hand, the player climbs the stairs without trying the door, the trigger on the step should at least make them jump, causing them to think that another door is opening somewhere. Of course, very fast players will not notice a thing, because they will have crossed the trigger before the door has even closed. They, of course, will have other things to worry about!

Alternatively, you may prefer to move the retrigger action to a stair riser beyond the stair-trap. This would provide hope for the player that there is a way back down the stairs. I think this makes the stair-trap less effective, though, as it now forces the player to climb the stairs, making the warning on the fourth step somewhat pointless.

Share this post


Link to post

CLOSING OFF THE HEXAGONAL ROOM

Complete the addition of button-activated doors with a new door to lock the player in the hexagonal room at the start by closing off the gap into the platform room. All you need are two new lines across the doorway through the southwest wall of the hexagonal room. (Ctrl-D is draw mode, remember.)



The following has the settings for the three sectors that you have made out of the old opening through the wall.



Change the side walls of the recess in the hexagonal room to STONE2 to match their neighbors, taking care to leave the offset that was applied several rooms ago. Put DOORTRAK on the side lines of the door sector and set their lower unpegged flags.

Share this post


Link to post

BUILDING THE NEW DOOR

Make sure that the two-sided door lines have their right sides facing out of the door sector. Use BIGDOOR6 on the line facing into the platform room but put STONE2 on the side of the door facing the hexagonal room. You may need to apply an X-offset to both of these textures to center them, as the gap is unlikely to be of a convenient length. Additionally, to have the STONE2 texture align properly with its neighboring walls, it will need a Y-offset.

This door will be opened from a switch — the one located on the rear wall of the second alcove in the southeast passageway. This is nicely out of sight of the door, and it may cause the player to wonder what it does. Put special line-type 63 (SR Door Open Wait Close) on the back wall of the appropriate alcove and tag it to the new door sector. This door will only stay open for five seconds. You should find that the player will have to run across the hexagonal room to get through it before it closes.

From the other side, the new door is to be capable of opening as a standard door, so set the special attribute of this face of the door to 1 (DR Door Open Wait Close). There is no need to tag the line to the sector, of course.

Finally, I don’t see any need to hide the fact that this is a door by setting any lines’ Secret on map flags. Having the player aware that there is a door but unable to find the switch is effective enough!

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  
×