2
glBSP and Map-Tricks/Errors
3
===========================
5
1. Self-referencing Lines
7
This trick involves linedefs with the same sector reference
8
on both sidedefs. In the original DOOM renderer, segs from
9
these lines are virtually ignored (though any mid-masked
10
texture is still drawn). Hence by using a sector which is
11
different from the surrounding sector, people could create
12
the following special physics effects:
14
1. invisible walkways (self-ref sector floor is higher)
15
2. deep water (self-ref sector floor is lower)
16
3. force fields (self-ref sector blocks movement)
17
4. railings you can jump over.
19
glBSP detects these lines and does two things: prevents
20
spurious warnings about mismatched sectors, and adjusts
21
the final subsector so that the FIRST seg is not one on
22
a self-reference line. It does the latter because most
23
engines use the very first seg to decide what sector to
24
associate the subsector with.
26
Engines should be aware of the trick and perform their
27
own analysis to emulate it. NOTE this trick will cause
28
some subsectors to contain segs from multiple sectors.
33
This trick is mostly used to make higher mid-masking textures.
35
glBSP can detect perfectly overlapping linedefs (ones using
36
the same start and end vertices, possibly swapped), and will
37
IGNORE them (producing no segs from the second and subsequent
40
Engines should also detect overlapping lines and emulate
41
the trick (by rendering the additional mid-masked textures).
46
This trick uses a one-sided linedef where a two-sided linedef
47
should be, so the back of the one-sided line faces into a
48
normal sector. In the original DOOM renderer, there was no
49
back-facing seg in the BSP, hence you could see through the
50
line when viewed from the back. When viewed from the front,
51
the one-sided linedef acted normally (blocked your view).
53
glBSP can detect many usages of this trick (although not 100%
54
since that would require much more expensive analysis). It
55
has to be explicitly enabled with the -windowfx option (or
56
for libglbsp via a field in nodebuildinfo_t).
58
When found, glBSP will add a REAL seg along the back of the
59
one-sided linedef. This is the only time that segs are
60
placed on a linedef with no corresponding sidedef.
62
Engines should detect that and emulate the trick accordingly.
63
Depending on how your renderer does occlusion culling, it may
64
not be necessary to do anything special.
67
4. Missing Lowers/Uppers
69
This trick is mentioned since it is very common, though it
70
doesn't affect or interfere with node building in any way.
72
When the DOOM renderer encounters a missing lower texture,
73
and the floor on the back side is visible (z < camera.z)
74
then the space where the lower texture should be will be
75
filled by that floor texture. The same thing happens with
78
This effect can be used to create a deep water effect, or
79
for drawing a dark ceiling over a bright lava sector.
81
When the back floor is out of view (z > camera.z), then
82
the missing lower is not drawn at all. Same for missing
83
uppers. This is sometimes used to create "invisible"
89
PWADs often contain a few mapping errors in them, and even
90
the IWADs contain some small errors, for example:
92
Doom1 E3M2: Linedef #156 has a wrong sector reference.
93
Doom2 MAP02: Sector #23 is not properly closed.
94
Doom2 MAP14: Linedefs #964 and #966 are missing back sidedefs.
95
Hexen MAP02: Vertex #1370 is not joined to linedef #668.
97
glBSP is not psychic and cannot automatically fix errors
98
in maps (and besides, sometimes they are used deliberately
99
for special effects, as described above).
101
When a linedef has a wrong sector reference, the usual
102
result is that the subsector (or subsectors) near that
103
spot will contain segs belonging to different sectors.
104
I cannot say what best way to handle it is -- engine
105
developers should at least be aware of the possibility.
107
Other map errors are more serious and cause structural
108
problems, like degenerate subsectors (which contain only
109
one or two segs). There is nothing glBSP or the engine
110
can do in these cases.
113
---------------------------------------------------------------------------