Sector
A sector is a two-dimensional region of a map. The most important properties of a sector are the floor and ceiling heights and the flats displayed on the floor and ceiling.
The shape of a sector is not defined directly, but indirectly by the linedefs that surround it. Usually, a sector is a region in the 2D plane that is surrounded by a closed loop of linedefs. Sometimes, multiple closed regions which have the same properties are merged together into a single sector. Each sidedef stores a reference to the sector towards which it faces. If these references are inconsistent with the actual geometry, this results in an unclosed sector, which may produce visual glitches or even crashes.
Specification
In the binary map format, 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:
Bytes | Data type | Description |
---|---|---|
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 |
Sector properties
Every sector has a number of properties that determine its appearance and behavior in-game. Their meanings are detailed below.
Floor and ceiling heights
These define the vertical area of the sector that is accessible. Everything below the floor and above the ceiling is solid and inaccessible. The possible heights range from -32768 and 32767. The overall height of a sector is equal to the difference between the floor and ceiling heights. In order to create multiple floors and ceilings at different heights within a sector, floors-over-floors (FOFs) are required.
Floor and ceiling flats
The flats are the graphics that are drawn on the floor and ceiling of the sector. For example, GFZFLR02
is the grassy texture used in Greenflower Zone. 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.
Brightness
The brightness controls the level of light in a sector. 0 is complete darkness and 255 is maximum brightness. Note that in the Software renderer, there are actually only 32 levels of brightness, which correspond to the first 32 rows of the COLORMAP
lump:
|
|
|
|
Special
- 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. There are four groups of sector specials; up to one effect from each group can be applied at the same time. To use multiple sector effects like this, add the sector special numbers together. This property only exists in the binary map format. In UDMF, it is replaced by several new properties.
Tag
- See also: Tagging
This is a number chosen by the map designer that identifies the sector for the purpose of applying special effects to it, such as linedef executors. In the binary format, only one tag can be supplied, although more can be added indirectly with linedef types 96–99. In UDMF, multiple tags can be supplied directly.
UDMF-only sector properties
This article or section is incomplete. It doesn't have all of the necessary core information on this topic. Please help the SRB2 Wiki by finishing this article. |
These additional properties can be set directly in UDMF maps, but not in the original binary map format. However, many of them can be set indirectly in binary maps using special workarounds.
Floor and ceiling offsets and rotation
Equation-based slopes
Friction
This controls how strongly the player's momentum is reduced when running along the sector's floor or ceiling. It is a floating-point value between 0 and 1; the default is 0.90625. Lower values produce extra friction, creating sludgy surfaces. Higher values reduce friction, creating slippery surfaces. In binary maps, it can be set via linedef type 540.
Gravity
This determines the gravity in the sector, as a factor of the map's global gravity. The default value is 1.0, which is equal to the global gravity. Negative values are possible, but this alone will not flip players; this additionally requires the Flip Objects in Reverse Gravity flag. The gravity can be changed at runtime with linedef type 469. In binary maps, the sector's gravity can be modified with linedef type 1.
Floor and ceiling brightness
Colormap
Damage
Editor name | Internal name | Description |
---|---|---|
None | SD_NONE
|
|
Generic | SD_GENERIC
|
|
Water | SD_WATER
|
|
Fire | SD_FIRE
|
|
Lava | SD_LAVA
|
|
Electric | SD_ELECTRIC
|
|
Spike | SD_SPIKE
|
|
DeathPitTilt | SD_DEATHPITTILT
|
|
DeathPitNoTilt | SD_DEATHPITNOTILT
|
|
Instakill | SD_INSTAKILL
|
|
SpecialStage | SD_SPECIALSTAGE
|
Linedef executor trigger
Special effect flags
Other flags
Trigger conditions
Trigger Condition | Description |
---|---|
No Trigger on Floor Touch | |
Trigger on Ceiling Touch | |
Trigger on Edge Couch | |
Trigger on Head Bump | |
Lindef Trigger Requires Plane Touch | |
Non-Pushables Can Trigger Linedef |
Map components | [view] | |
Thing • Linedef • Sidedef • Vertex • Node • Sector • Reject • Blockmap |