Subsector
From DoomWiki.org
SSECTORS (an abbreviation for subsector) is the name of a WAD lump which is a component of a level. It is normally generated automatically from other data for the level using a node builder tool.
The node builder creates subsectors out of the sectors, dividing any sector that is not a convex polygon into two or more subsectors that are. Subsector entries are referenced from the nodes lump.
Subsector structure
Doom level format |
---|
Offset | Size (bytes) | Description |
---|---|---|
0 | 2 | Seg count |
2 | 2 | First seg number |
The subsectors and segs are both stored in sequential order. That is, the seg numbers in subsector 0 are 0 through N0 - 1 (where N0 is the subsector 0 seg count), the seg numbers in subsector 1 are N0 through N0 + N1 - 1 (where N1 is the subsector 1 seg count), and so on.
The node builder assures that all segs in a subsector face the same sector. At level load time, the sector that the subsector is a part (or all) of is determined by looking at the first seg and a link to this sector is saved in the internal subsector data structure.