A sector is a map component that acts as a two-dimensional region of a map. The shape of sectors is defined by linedefs that enclose it. Sectors are used to create areas with different floor and ceiling textures, and different floor and ceiling heights. Every sector has a number, which is used to identify it.
A sector can be any closed region of the plane of a map, and is bounded by linedefs. The sidedefs of these linedefs determine which sector describes a given region, and hence several disjoint regions may in fact be part of the same sector.
This also creates the possibility of constructing a closed region which belongs to multiple sectors (by setting the sector references of sidedefs facing the same region to different values), but this is illegal and will cause crashes or visual glitches. Map editors often have bugs that can cause this situation to arise, which often confuses beginning map editors who have yet to learn exactly which actions lead to such problems. For a discussion of how to avoid this, or how to correct it when it occurs, see Sidedef.
The sectors of a map are stored in the
SECTORS lump as a list. Each sector has a 26-byte entry consisting of the following:
|0–1||Signed 16-bit integer||Floor height|
|2–3||Signed 16-bit integer||Ceiling height|
|4–11||8-character string||Floor flat|
|12–19||8-character string||Ceiling flat|
|20–21||Signed 16-bit integer||Brightness|
|22–23||Signed 16-bit integer||Special|
|24–25||Signed 16-bit integer||Tag|
Every sector has a number of properties associated with it that determine how it appears in-game. Their meanings are detailed below.
Floor and ceiling flats
These properties are used to select which flats are drawn on the floor and ceiling of the sector. For example, setting the floor flat to
GFZFLR02 would cause the floor of the sector to be drawn using the grassy texture used in Greenflower Zone. Additionally, the special flat
F_SKY1 causes the current sky to be drawn in place of a normal texture, using a somewhat different rendering process to achieve the illusion of an open space.
Floor and ceiling heights
The floor and ceiling heights, whose values can be anywhere from -32768 to 32767, set the levels of the top and bottom of the space within a sector that can be occupied by the player. In order to understand this, it is important to realize that every sector extends entirely to the top and bottom of the level, but with everywhere above the ceiling level and below that of the floor being solid. Thus the height of a sector is equal to the difference of the floor and ceiling heights. In order to create sectors with multiple floors and ceilings at different heights, floors-over-floors (FOFs) are required, but this is somewhat more complicated.
The brightness controls the level of light in a sector. 0 is complete darkness and 255 is maximum brightness. Note that in Software, there are actually only 32 levels of brightness, which correspond to the first 32 rows of the
- See also: Sector types
The sector special is a number that sets the special effect applied to a sector, such as Instant Kill or the Exit Sector. Up to four sector specials can be applied at once; however, only one from each group can be used at a time. To use multiple sector effects like this, add the sector special numbers together.
- See also: Tagging
This is a number chosen by the map designer that associates sector(s) with linedef(s) to achieve special effects. Linedefs and sectors whose tags match can affect one another, most commonly with the linedef's effect property engendering special behavior in the so-called "target" sector.