Sector

From SRB2 Wiki
Jump to navigation Jump to search
A section of a map with a sector highlighted.

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.

Sector properties

Zone Builder's sector properties window. Click to enlarge.

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:

Colormap # Brightness
0 248–255
1 240–247
2 232–239
3 224–231
4 216–223
5 208–215
6 200–207
7 192–199
Colormap # Brightness
8 184–191
9 176–183
10 168–175
11 160–167
12 152–159
13 144–151
14 136–143
15 128–135
Colormap # Brightness
16 120–127
17 112–119
18 104–111
19 96–103
20 88–95
21 80–87
22 72–79
23 64–71
Colormap # Brightness
24 56–63
25 48–55
26 40–47
27 32–39
28 24–31
29 16–23
30 8–15
31 0–7


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.

Binary-only sector properties

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.

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 properties

Texture offsets and rotation

Binary equivalent: Linedef type 7

Floor and ceiling textures can be freely offset and rotated, independently of each other and without using linedefs. While Linedef type 7 is still available in UDMF, its effects are not shown in the editor, so it is generally not recommended to use.

Texture scale

NOTE: Currently only exists in 2.2.14 nightly.
Binary equivalent: none

Floor and ceiling textures can also be scaled independently in both directions. Values above 1.0 will make the texture appear smaller, while values below 1.0 make it appear bigger. For example, a scale of 2.0 will display the texture at half its original size, while a scale of 0.5 will display it at twice its original size.

Brightness

Binary equivalent: Linedef type 600 / Linedef type 601

In addition to sector brightness, the light level of floors and ceilings can also be changed individually. By default, this value is relative to the sector brightness, but it can also be set directly if the Absolute flag is checked. Note that this doesn't affect objects, even if they're touching the surface.

Equation-based slopes

In addition to line slopes, thing slopes and vertex slopes, slopes can also be set through sector properties in UDMF. The name comes from the way these slopes are calculated in-game, with their properties obtained from an equation taking 4 numeric values, but editors such as Ultimate Zone Builder offer multiple ways to set those values in more intuitive ways.

Friction

Binary equivalent: Linedef type 540

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.

Gravity

Binary equivalent: Linedef type 1

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.

Colormap

Binary equivalent: Linedef type 606

Light color and alpha

Fade color and alpha

Fade start and end

Colormap flags

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

Editor name Internal name Description
Space Countdown SSF_OUTERSPACE
Ramp Sector (double step-up/down) SSF_DOUBLESTEPUP
Non-Ramp Sector (no step-down) SSF_NOSTEPDOWN
n/a SSF_WINDCURRENT Not available in the editor. This flag is set automatically if a sector has Linedef type 541 applied to it.
n/a SSF_CONVEYOR Not available in the editor. This flag is set automatically if a sector has Linedef type 510 applied to it.
Speed Pad SSF_SPEEDPAD This flag should only be used in combination with Linedef type 4.
Star Post Activator SSF_STARPOSTACTIVATOR
Exit SSF_EXIT
Special Stage Pit SSF_SPECIALSTAGEPIT
Return Flag SSF_RETURNFLAG
Red Team Base SSF_REDTEAMBASE
Blue Team Base SSF_BLUETEAMBASE
Fan Sector SSF_FAN
Super Sonic Transform SSF_SUPERTRANSFORM
Force Spin SSF_FORCESPIN
Zoom Tube Start SSF_ZOOMTUBESTART This flag should only be used in combination with Linedef type 3.
Zoom Tube End SSF_ZOOMTUBEEND This flag should only be used in combination with Linedef type 3.
Circuit Finish Line SSF_FINISHLINE
Rope Hang SSF_ROPEHANG This flag should only be used in combination with Linedef type 11.
Flip Gravity on Jump SSF_JUMPFLIP
Make Reverse Gravity Temporary SSF_GRAVITYOVERRIDE
Disable Floor Slope Physics SSF_NOPHYSICSFLOOR
Currently only exists in 2.2.14 nightly.
Disable Ceiling Slope Physics SSF_NOPHYSICSCEILING
Currently only exists in 2.2.14 nightly.

Other flags

Trigger conditions

Trigger Condition Description
No Trigger on Floor Touch
Trigger on Ceiling Touch
Trigger on Edge Touch
Trigger on Head Bump
Linedef Trigger Requires Plane Touch
Non-Pushables Can Trigger Linedef

Technical specifications

Binary map format

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

UDMF

  Map components [view]

ThingLinedefSidedefVertexNodeSectorRejectBlockmap