Sidedef

From SRB2 Wiki
Jump to: navigation, search

A sidedef is a map component associated with the individual sides of linedefs. Sidedefs allow properties that affect only a single side of a linedef to be specified. Each linedef must have a front sidedef, which faces the sector the linedef belongs to (called the front sector), and may have a back sidedef, which faces the sector that the linedef is not in but touches directly (called the back sector). The back sidedef is only used when the back side of a linedef actually faces a sector.

Textures

A sidedef's textures are the images that are drawn by the game on the surface corresponding to the sidedef. The same texture is drawn across the entire sidedef from left to right, but the sidedef is split into three regions at different heights, each of which gets its own texture.

File:Tex-upperlower.png
Textures on a double-sided linedef.

On a two-sided linedef, the textures are rendered as follows:

  • The upper or above front texture is drawn from the back sector's ceiling height up to the front sector's ceiling height. If the latter is lower than the former, it is not rendered.
  • The middle or main front texture is drawn from the back sector's ceiling height down as far as its floor height (unless the linedef is unpegged, in which case the behavior is different). Unless the linedef's Solid Midtexture flag is set, the middle texture is intangible, which means that the player can pass through this texture into the sector.
  • The lower or below front texture is drawn from the back sector's floor height down to the front sector's floor height. If the latter is higher than the former, it is not rendered.
  • The upper or above back texture is drawn from the front sector's ceiling height up to the back sector's ceiling height. If the latter is lower than the former, it is not rendered.
  • The middle or main back texture is drawn from the front sector's ceiling height down as far as its floor height (unless the linedef is unpegged, in which case the behavior is different). Unless the linedef's Solid Midtexture flag is set, the middle texture is intangible, which means that the player can pass through this texture into the sector.
  • The lower or below back texture is drawn from the front sector's floor height down to the back sector's floor height. If the latter is higher than the former, it is not rendered.

On a single-sided linedef, only the middle/main texture is drawn, and this from the sector's floor to its ceiling.

Texture offsets

The texture offsets are used to set the origin from which the texture is tiled on the surface. This allows textures to be aligned across linedefs.

SRB2 Doom Builder's Sidedef Dialog. Click to enlarge.

SRB2 Doom Builder's sidedef dialog box has two different ways of applying texture offsets to a sidedef. Either way works the exact same way, but use is a matter of preference.

  • The first method is to input the X and Y coordinates into the blank boxes next to the "Texture Offset:" text. X value on the left, and Y value on the right. The offset can be previewed with the "Visual Offset" option. This method is the more precise of the two.
  • The second method is to use the "Visual Offset" dialog (shown below), along with the mouse. Simply click on the texture with the mouse, and drag it around until the desired effect is produced. If accuracy isn't a high priority, this method is the easier of the two.

Either way, all textures along the sidedef receive the same horizontal offset. For example, if GFZGRASS is used, then the GFZGRASS texture offset will match that of the texture below it.

Repeating middle textures

By default, the middle texture of a sidedef for a two-sided linedef will be drawn only once. However, if the Repeat Midtexture flag is checked on the linedef the sidedef belongs to, the middle texture is flood filled from the bottom to the top of the referenced sector, assuming the X offset is between 0 and 4095. Greater X offsets are used to specify how often the middle texture is stacked vertically on a sidedef instead of filling it entirely, specifically, for each number of repetitions, 4096 must be added to the X offset (for example, a value between 4096 and 8191 makes the texture stack twice, between 8192 and 12287 makes it stack three times, and so on).

Sector reference

The sector reference determines which sector the sidedef is facing into. All sidedefs facing into a polygon of linedefs must have the same sector reference, or visual glitches and crashes may occur: this configuration is often referred to as an unclosed sector. Map editors set sector references automatically, and so it is not normally necessary to set them manually; however, certain operation can cause the references to become inconsistent and hence cause sectors to become unclosed, in which case they must be corrected by hand.

  Map components [view]

ThingLinedefSidedefVertexNodeSectorRejectBlockmap