Sector

From DoomWiki.org

A sector is an area referenced by sidedefs on the linedefs. Sectors should be closed areas, meaning that all the sidedefs that reference a particular sector should make up a closed shape. Unclosed sectors can be used for a few special effects, but under some circumstances they can lead to undesirable results (including crashes).

A sector does not have to be a single polygon. For instance, two squares can be separate and non-contiguous, but still be part of the same sector.

A sector entry specifies the following:

Ceiling flat - Name of the flat (texture) used on the ceiling of the sector.

Floor flat - Name of the flat used on the floor.

Ceiling height - Height of the ceiling.

Floor height - Height of the floor.

Lighting - How bright the sector is.

Sector tag - A number that makes the sector a target of the action specified by any linedef with the same tag number. Used, for example, to alter the sector's ceiling and/or floor height, lighting level or flats.

Sector type - Special properties of the sector. This is used to give the sector a damaging floor (for things like lava and slime), have the sector's light level change constantly, enable wind or currents or even push the player in a certain direction. See below.

Sector structure[edit]

Doom level format

Each sector is 26 bytes large. Sectors are stored in WAD files in the following format:

Offset Size (bytes) Description
0 2 Floor height
2 2 Ceiling height
4 8 Name of floor texture
12 8 Name of ceiling texture
20 2 Light level
22 2 Type
24 2 Tag number

At level load time, several additional variables are generated for each sector and stored in the internal sector data structure. These include:

linecount - the total number of linedefs associated with the sector.

lines - a list of every linedef associated with the sector.

blockbox - the coordinates defining a rectangular bounding box enclosing the sector, with the bounding box enlarged so that the edges line up with the blockmap.

soundorg - the coordinates for any sound emitted by the sector; automatically set to the center of a precise bounding box surrounding the sector.

Sector types[edit]

The type field of the sector structure is used to specify lighting, damage, and a few other special effects.

  • There are linedef types that can change the sector type field during gameplay, either to zero or to a copy of another sector's type field. This is how, for example, a safe bridge rises out of a pool of nukage.
  • Damage is halved at skill level 1.
  • Damage is split between health and armor (if any).

Doom[edit]

In Doom, the sector type values are mutually exclusive.

Type Class Effect
0 Normal
1 Light Blink random
2 Light Blink 0.5 second
3 Light Blink 1.0 second
4 Both 20% damage per second plus light blink 0.5 second
5 Damage 10% damage per second
7 Damage 5% damage per second
8 Light Oscillates
9 Secret Player entering this sector gets credit for finding a secret
10 Door 30 seconds after level start, ceiling closes like a door
11 End 20% damage per second. When player dies, level ends
12 Light Blink 0.5 second, synchronized
13 Light Blink 1.0 second, synchronized
14 Door 300 seconds after level start, ceiling opens like a door
16 Damage 20% damage per second
17 Light Flickers randomly

Boom[edit]

Boom (and compatible source ports) support the Doom sector types above, and also provide "generalized" sector types. The latter are based on bit fields, which allows several sector type properties to be independently specified for a sector. Texture change linedef types can be used to switch some or all of these properties dynamically, outside lighting.

Bits 0 through 4 specify the lighting type in the sector, and the same codes that Doom uses are employed (0, 1, 2, 3, 4, 8, 12, 13 and 17 from above).

Flag Bits Effect
32 5 5% damage per second
64 6 10% damage per second
96 5+6 20% damage per second
128 7 Secret sector
256 8 Enable friction effects
512 9 Enable pusher/puller effects

Heretic[edit]

Heretic uses a greater variety of sector types, notably to control its own friction and wind effects. Like in Doom, the values are mutually exclusive.

Type Class Effect
0 Normal
1 Light Blink random
2 Light Blink 0.5 second
3 Light Blink 1.0 second
4 Combo 5% lava damage per second plus scroll east 28 and light blink 0.5 second
5 Damage 5% lava damage per second
7 Damage 4% sludge damage per second
8 Light Oscillates
9 Secret Player entering this sector gets credit for finding a secret
10 Door 30 seconds after level start, ceiling closes like a door
11 No-op Does nothing
12 Light Blink 0.5 second, synchronized
13 Light Blink 1.0 second, synchronized
14 Door 300 seconds after level start, ceiling opens like a door
15 Friction Low friction
16 Damage 8% lava damage per second
20 Scroller Scroll east 5
21 Scroller Scroll east 10
22 Scroller Scroll east 25
23 Scroller Scroll east 30
24 Scroller Scroll east 35
25 Scroller Scroll north 5
26 Scroller Scroll north 10
27 Scroller Scroll north 25
28 Scroller Scroll north 30
29 Scroller Scroll north 35
30 Scroller Scroll south 5
31 Scroller Scroll south 10
32 Scroller Scroll south 25
33 Scroller Scroll south 30
34 Scroller Scroll south 35
35 Scroller Scroll west 5
36 Scroller Scroll west 10
37 Scroller Scroll west 25
38 Scroller Scroll west 30
39 Scroller Scroll west 35
40 Wind Push east 5
41 Wind Push east 10
42 Wind Push east 25
43 Wind Push north 5
44 Wind Push north 10
45 Wind Push north 25
46 Wind Push south 5
47 Wind Push south 10
48 Wind Push south 25
49 Wind Push west 5
50 Wind Push west 10
51 Wind Push west 25

Hexen[edit]

Like Heretic, Hexen uses a large number of mutually-exclusive sector types.

Type Class Effect
0 Normal
1 Light Phased light (use lightlevel between 0 and 63 for the starting phase)
2 Light Phased light sequence start (use types 3 and 4 in neighboring sectors)
3 Light Light sequence step (to be used alternatively with type 4 for a light sequence)
4 Light Light sequence step (to be used alternatively with type 3 for a light sequence)
9 Secret Player entering this sector gets credit for finding a secret
26 Stairs Mark sector to be used for building normal stairs
27 Stairs Mark sector to be used for building synchronized stairs
40 Wind Push east 5
41 Wind Push east 10
42 Wind Push east 25
43 Wind Push north 5
44 Wind Push north 10
45 Wind Push north 25
46 Wind Push south 5
47 Wind Push south 10
48 Wind Push south 25
49 Wind Push west 5
50 Wind Push west 10
51 Wind Push west 25
198 Lightning Light level increases by up to 64 units during a lightning flash
199 Lightning Light level increases by up to 32 units during a lightning flash
200 Sky Use the secondary sky texture if the level doesn't use a double sky
201 Scroller Scroll north 5
202 Scroller Scroll north 10
203 Scroller Scroll north 25
204 Scroller Scroll east 5
205 Scroller Scroll east 10
206 Scroller Scroll east 25
207 Scroller Scroll south 5
208 Scroller Scroll south 10
209 Scroller Scroll south 25
210 Scroller Scroll west 5
211 Scroller Scroll west 10
212 Scroller Scroll west 25
213 Scroller Scroll northwest 5
214 Scroller Scroll northwest 10
215 Scroller Scroll northwest 25
216 Scroller Scroll northeast 5
217 Scroller Scroll northeast 10
218 Scroller Scroll northeast 25
219 Scroller Scroll southeast 5
220 Scroller Scroll southeast 10
221 Scroller Scroll southeast 25
222 Scroller Scroll southwest 5
223 Scroller Scroll southwest 10
224 Scroller Scroll southwest 25

Strife[edit]

In Strife, the sector type values are also mutually exclusive.

Type Class Effect
0 Normal
1 Light Blink random
2 Light Blink 0.5 second
3 Light Blink 1.0 second
4 Both 5% damage every 32 tics plus light blink 0.5 second
5 Damage +2 increase to nukagecount
7 Damage 5% damage every 32 tics
8 Light Oscillates
9 Secret Player entering this sector gets credit for finding a secret
10 Door 30 seconds after level start, ceiling closes like a door
11 End 20% damage per second. When player dies, level ends
12 Light Blink 0.5 second, synchronized
13 Light Blink 1.0 second, synchronized
14 Door 300 seconds after level start, ceiling opens like a door
15 Damage Instant death: 999% damage every tic
16 Damage +4 to nukagecount
17 Light Flickers randomly
18 Scroller Water current, angle and strength depend on sector tag value

ZDoom[edit]

ZDoom and compatible source ports provide a superset of all sector types based on the Hexen types, including both mutually-exclusive types and generalized flags. The following table is used for maps in the Hexen map format or in UDMF with the ZDoom namespace.

Type Class Effect
0 Normal
1 Light Phased light (use lightlevel between 0 and 63 for the starting phase)
2 Light Phased light sequence start (use types 3 and 4 in neighboring sectors)
3 Light Light sequence step (to be used alternatively with type 4 for a light sequence)
4 Light Light sequence step (to be used alternatively with type 3 for a light sequence)
9 Secret Player entering this sector gets credit for finding a secret
26 Stairs Mark sector to be used for building normal stairs
27 Stairs Mark sector to be used for building synchronized stairs
40 Wind Push east 5
41 Wind Push east 10
42 Wind Push east 25
43 Wind Push north 5
44 Wind Push north 10
45 Wind Push north 25
46 Wind Push south 5
47 Wind Push south 10
48 Wind Push south 25
49 Wind Push west 5
50 Wind Push west 10
51 Wind Push west 25
65 Light Blink random
66 Light Blink 0.5 second
67 Light Blink 1.0 second
68 Both 20% damage per second plus light blink 0.5 second
69 Damage 10% damage per second
71 Damage 5% damage per second
72 Light Oscillates
74 Door 30 seconds after level start, ceiling closes like a door
75 End 20% damage per second. When player dies, level ends
76 Light Blink 0.5 second, synchronized
77 Light Blink 1.0 second, synchronized
78 Door 300 seconds after level start, ceiling opens like a door
79 Friction Low friction
80 Damage 20% damage per second
81 Light Flickers randomly
82 Damage 5% lava damage per second
83 Damage 8% lava damage per second
84 Combo 5% lava damage per second plus scroll east and light blink 0.5 second
85 Damage 4% sludge damage per second
87 Fog Sector uses outside fog even if the ceiling texture isn't the sky texture
105 Damage +2 increase to nukagecount
115 Damage Instant death: 999% damage every tic
116 Damage +4 to nukagecount
118 Scroller Water current, angle and strength depend on sector tag value
195 Automap Hidden: sector texture is not shown on the textured automap
196 Healing Restores 1 hit point every 32 tics
197 Lightning Light level increases as much as outdoor sectors do during a lightning flash
198 Lightning Light level increases by up to 64 units during a lightning flash
199 Lightning Light level increases by up to 32 units during a lightning flash
200 Sky Use the secondary sky texture if the level doesn't use a double sky
201 Scroller Scroll north 5
202 Scroller Scroll north 10
203 Scroller Scroll north 25
204 Scroller Scroll east 5
205 Scroller Scroll east 10
206 Scroller Scroll east 25
207 Scroller Scroll south 5
208 Scroller Scroll south 10
209 Scroller Scroll south 25
210 Scroller Scroll west 5
211 Scroller Scroll west 10
212 Scroller Scroll west 25
213 Scroller Scroll northwest 5
214 Scroller Scroll northwest 10
215 Scroller Scroll northwest 25
216 Scroller Scroll northeast 5
217 Scroller Scroll northeast 10
218 Scroller Scroll northeast 25
219 Scroller Scroll southeast 5
220 Scroller Scroll southeast 10
221 Scroller Scroll southeast 25
222 Scroller Scroll southwest 5
223 Scroller Scroll southwest 10
224 Scroller Scroll southwest 25
225 Scroller Scroll east 5
226 Scroller Scroll east 10
227 Scroller Scroll east 25
228 Scroller Scroll east 30
229 Scroller Scroll east 35
230 Scroller Scroll north 5
231 Scroller Scroll north 10
232 Scroller Scroll north 25
233 Scroller Scroll north 30
234 Scroller Scroll north 35
235 Scroller Scroll south 5
236 Scroller Scroll south 10
237 Scroller Scroll south 25
238 Scroller Scroll south 30
239 Scroller Scroll south 35
240 Scroller Scroll west 5
241 Scroller Scroll west 10
242 Scroller Scroll west 25
243 Scroller Scroll west 30
244 Scroller Scroll west 35
Flag Bits Effect
256 8 5% damage per second
512 9 10% damage per second
768 8+9 20% damage per second
1024 10 Secret sector
2048 11 Enable friction effects
4096 12 Enable pusher/puller effects

Sources[edit]