Slime trail

Slime trails are vertical bands of texture which "bleed" out towards the edges of the screen. They can occur when a level has not been built properly because of a bug in the BSP builder, but they will also occur frequently as a natural consequence of Doom's map format even in perfect node builders.

Within the map, vertex coordinates are only stored as integers. In normal map editing, vertices may only be placed at integer coordinates. During BSP building, however, lines may need to be split into segs at a location that has non-integral coordinates. The BSP builder ends up having to chop a significant amount of precision out of the coordinates of its generated vertices, and as a result, segs may end or begin far short of where they need to be placed for a mathematically correct BSP. This results in an open subsector, and the flat of the subsector will bleed out at the location of the offending vertex. Any open subsector will display similar behavior.

Slime trails are occasionally so severe that they span the entire screen, in which case the floor texture can be seen to meet the ceiling texture in the center of the screen. This type of slime trail is very rare, but one can be spied when the view angle is tangent to one of the sides of the star near the exit of DOOM II MAP09: The Pit.

Lee Killough initially created an optional heuristic in the algorithm of the BSP node builder utility which would attempt to avoid seg splits which would result in a high degree of round-off error. This fix could seal up a vast majority of slime trails that other node builders would generate, but it was far from flawless.

When Lee began work on the MBF port, he decided to investigate a possible engine-side fix to the problem. Within the game engine, vertex coordinates are converted to fixed-point numbers. Using the law of cosines, MBF and its descendant ports attempt to project vertices which are used only by segs (and not by the ends of linedefs) back toward the linedef to which the segs belong.

Slime trails are not usually associated with lines that are exactly horizontal or vertical, because round-off error on those lines will place the vertex at some point along the line, generating no opening. MBF avoids testing vertices along such lines in interest of maximum efficiency.

Note that even MBF's algorithm cannot repair all slime trails, and thus they must remain an accepted part of editing maps for a low-precision game engine.