ZNODES

ZNODES is an optional lump built by the nodebuilder for a map in the Universal Doom Map Format. It contains data that correspond to the NODES, SSECTORS and SEGS lump from the classic binary map formats.

ZNODES are necessarily GL nodes, normal nodes are not supported. Given that ZDBSP is the only nodebuilder in existence that can parse UDMF maps, this requirement is reasonable. Nodes can be indifferently in the XGLN, ZGLN, XGL2, or ZGL2 formats, but no other. If the lump is not present, ZDoom will use its internal nodebuilder, which is an integrated version of ZDBSP.

GL nodes (“XGLN” or “ZGLN” signature)

DWORDNumSegsNumber of segs
Repeat NumSegs times:
DWORDv1Seg's first vertex
DWORDpartnerSeg's partner seg (0xFFFFFFFF if none)
WORDlineThe linedef this seg came from (0xFFFF if none)
BYTEsideThe linedef's side this seg came from (0=front, 1=back) (ignored if no line)

GL nodes (“XGL2” or “ZGL2” signature)

DWORDNumSegsNumber of segs
Repeat NumSegs times:
DWORDv1Seg's first vertex
DWORDpartnerSeg's partner seg (0xFFFFFFFF if none)
DWORDlineThe linedef this seg came from (0xFFFFFFFF if none)
BYTEsideThe linedef's side this seg came from (0=front, 1=back) (ignored if no line)

Unlike standard GL nodes, each seg's second vertex is not stored. This is because GL subsectors must form a closed area. In other words, one seg's second vertex is the same as the next seg's first vertex. The subsector information contains everything you need to know to close each area and start a new one.

Example: Suppose you have not read any segs yet, and the first subsector has four segs. Therefore, the second vertex for the first four segs can be determined to be:

Seg 0Second vertex is Seg 1's first vertex
Seg 1Second vertex is Seg 2's first vertex
Seg 2Second vertex is Seg 3's first vertex
Seg 3Second vertex is Seg 0's first vertex (because this is the last seg in the subsector)

So for each subsector, all but the last seg's second vertex will be the same as the next seg's first vertex. The last seg's second vertex will be the same as the first seg's first vertex.

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.