Doom Wiki
Register
(+ cat)
m (clean up)
 
(11 intermediate revisions by 7 users not shown)
Line 1: Line 1:
A '''sidedef''' contains the [[wall texture]] data for each [[linedef]] (though sidedefs do not reference linedefs directly, indeed it is the other way around). Each sidedef contains texture data, offsets for the textures and the number of the sector it references (this is how sectors get their 'shape').
+
A '''sidedef''' contains the [[wall texture]] data for each [[linedef]] (though sidedefs do not reference linedefs directly, indeed it is the other way around). Each sidedef contains texture data, offsets for the textures and the number of the sector it references (this is how sectors get their 'shape').
   
'''Upper texture''' - This contains the name of a texture that will be displayed on the border between a sector and its neighboring ceiling of a different height. If the linedef that contains this sidedef is one sided this field is meaningless.
+
'''Upper texture''' - This contains the name of a texture that will be displayed on the border between a sector and its neighboring ceiling of a different height. If the linedef that contains this sidedef is one sided this field is meaningless.
   
'''Middle texture''' - On one sided linedefs this will be the only texture displayed; as the main wall texture. On two sided linedefs this will be displayed as a 'floating' texture which the player is able to walk through. Middle floating textures can be used to achieve a variety of faux 3D effects such as 3D bridges. Note that middle floating textures will only tile horizontally and not vertically, where they only repeat once.
+
'''Middle texture''' - On one sided linedefs this will be the only texture displayed; as the main wall texture. On two sided linedefs this will be displayed as [[False walls|a 'floating' texture which the player is able to walk through]]. Middle floating textures can be used to achieve a variety of faux 3D effects such as 3D bridges. Note that middle floating textures will only tile horizontally and not vertically, where they only repeat once.
   
 
'''Lower texture''' - This performs a similar function to the upper texture; the lower texture is displayed on the border between a sector and its neighboring floor of a different height.
 
'''Lower texture''' - This performs a similar function to the upper texture; the lower texture is displayed on the border between a sector and its neighboring floor of a different height.
Line 14: Line 14:
   
 
==Sidedef Structure==
 
==Sidedef Structure==
{{Doom level format}}
 
Sidedefs are stored in WAD files in the following format:
 
   
 
Each Sidedef is 30 bytes large. Sidedefs are stored in WAD files in the following format:
<table {{prettytable}}>
 
  +
{| class="WikiaTable"
<tr align=center>
+
|- align="center"
<th>Offset</th><th>Size (bytes)</th><th>Description</th>
 
  +
! Offset
</tr>
 
  +
! Size (bytes)
<tr align=center>
 
  +
! Description
<td>0</td><td>2</td><td align=left>''x'' offset</td>
 
 
|- align="center"
</tr>
 
  +
| 0
<tr align=center>
 
  +
| 2
<td>2</td><td>2</td><td align=left>''y'' offset</td>
 
 
| align="left" | ''x'' offset
</tr>
 
<tr align=center>
+
|- align="center"
  +
| 2
<td>4</td><td>8</td><td align=left>Name of upper texture</td>
 
  +
| 2
</tr>
 
<tr align=center>
+
| align="left" | ''y'' offset
 
|- align="center"
<td>12</td><td>8</td><td align=left>Name of lower texture</td>
 
  +
| 4
</tr>
 
  +
| 8
<tr align=center>
 
<td>20</td><td>8</td><td align=left>Name of middle texture</td>
+
| align="left" | Name of upper texture
 
|- align="center"
</tr>
 
  +
| 12
<tr align=center>
 
  +
| 8
<td>28</td><td>2</td><td align=left>[[Sector]] number this sidedef 'faces'</td>
 
 
| align="left" | Name of lower texture
</tr>
 
 
|- align="center"
</table>
 
  +
| 20
  +
| 8
  +
| align="left" | Name of middle texture
  +
|- align="center"
  +
| 28
  +
| 2
 
| align="left" | [[Sector]] number this sidedef 'faces'
  +
|}
   
 
Sidedefs are exactly the same in ZDoom/Hexen format as they are in the original Doom format.
 
Sidedefs are exactly the same in ZDoom/Hexen format as they are in the original Doom format.
  +
  +
==Sidedef compression==
  +
  +
Linedefs reference two sidedefs: one for the left side, and one for the right side, by their order into the SIDEDEFS lump. Naive map authoring tools will generate a unique sidedef for every linedef side in the game (so one per one-sided linedef, two per two-sided).
  +
  +
Wad compression tools can reduce the number of sidedef entries by making multiple linedefs reference the same sidedef, when the linedefs have the same texture, offsets, and sector.
  +
  +
The index used by the linedef entry is an unsigned 16-bit integer, which restricts the number of sidedefs that can occur to 65535 (sidedefs 0–65534) per level. The value "65535" / (uint16_t)-1 is reserved to denote "no sidedef". For huge maps, this figure can be surpassed by sharing sidedefs between linedefs.
   
 
==See also==
 
==See also==
Line 48: Line 62:
 
*[[Tutti-frutti effect]]
 
*[[Tutti-frutti effect]]
 
*[[Venetian blind crash]]
 
*[[Venetian blind crash]]
  +
 
{{Doom level format}}
   
 
[[Category:Doom engine]]
 
[[Category:Doom engine]]

Latest revision as of 05:05, 23 August 2019

A sidedef contains the wall texture data for each linedef (though sidedefs do not reference linedefs directly, indeed it is the other way around). Each sidedef contains texture data, offsets for the textures and the number of the sector it references (this is how sectors get their 'shape').

Upper texture - This contains the name of a texture that will be displayed on the border between a sector and its neighboring ceiling of a different height. If the linedef that contains this sidedef is one sided this field is meaningless.

Middle texture - On one sided linedefs this will be the only texture displayed; as the main wall texture. On two sided linedefs this will be displayed as a 'floating' texture which the player is able to walk through. Middle floating textures can be used to achieve a variety of faux 3D effects such as 3D bridges. Note that middle floating textures will only tile horizontally and not vertically, where they only repeat once.

Lower texture - This performs a similar function to the upper texture; the lower texture is displayed on the border between a sector and its neighboring floor of a different height.

x offset - How many pixels to shift all the sidedef textures on the X axis (right or left).

y offset - How many pixels to shift all the sidedef textures on the Y axis (up or down).

Regardless of the texture used on a sidedef, each sidedef will still take up the same amount of space since textures are referred to by name (in Doomstring format).

Sidedef Structure

Each Sidedef is 30 bytes large. Sidedefs are stored in WAD files in the following format:

Offset Size (bytes) Description
0 2 x offset
2 2 y offset
4 8 Name of upper texture
12 8 Name of lower texture
20 8 Name of middle texture
28 2 Sector number this sidedef 'faces'

Sidedefs are exactly the same in ZDoom/Hexen format as they are in the original Doom format.

Sidedef compression

Linedefs reference two sidedefs: one for the left side, and one for the right side, by their order into the SIDEDEFS lump. Naive map authoring tools will generate a unique sidedef for every linedef side in the game (so one per one-sided linedef, two per two-sided).

Wad compression tools can reduce the number of sidedef entries by making multiple linedefs reference the same sidedef, when the linedefs have the same texture, offsets, and sector.

The index used by the linedef entry is an unsigned 16-bit integer, which restricts the number of sidedefs that can occur to 65535 (sidedefs 0–65534) per level. The value "65535" / (uint16_t)-1 is reserved to denote "no sidedef". For huge maps, this figure can be surpassed by sharing sidedefs between linedefs.

See also