Quasar
Moderator

Posts: 4484
Registered: 08-00 |
Little Faith said:
This is the dreaded Visplane bug!
It happens because there are too many sidedefs in view or something similar. It used to be the bane of everyone who tried to make large detailed levels.
Actually its the number of distinct flat areas the game attempts to draw. This has nothing to do with lines, and does not necessarily correspond 1:1 with sectors.
The game merges like flat areas where possible so that it draws the entire area in one pass. For a region to be merged with another visplane, it must: be at the same z level, have the same light level, have the same flat, and contact the region.
Thus if you have 20 sectors with identical attributes, there may only be one visplane for all of them.
If you make a checkerboard map with only 2 different flats, it may have 256 visplanes.
The visplane limit in the original DOOM engine was 128. Lee Killough, who during his time in the community devoted a large amount of time to studying and understanding the visplane behavior (he fully understood it even before the source release!), states in the source that there was no logical reason for this limit.
The source contained a comment trying to justify it in terms of the time needed to generate them or something, but with just a few small and pretty obvious tweaks Lee was able to make that irrelevant.
Thus pretty much all modern ports remove the visplane limit. I think there's a few that might still have it. Legacy at one point had doubled it to 256, but they may have removed it since then. I believe Raven may have increased the limits in Heretic and Hexen, but I don't know for sure.
While I'm lecturing, I'll mention a neat little toy that Eternity contains. If you set the r_showvpo console variable to on, when Eternity detects the approximate number of visplanes that would have overflowed in DOOM, it shows a VPO graphic. Note its only approximate though, because Lee also tweaked BOOM's visplane generation so that more planes are merged (making it much more efficient). So Eternity uses fewer visplanes than DOOM did for the exact same scene in some circumstances. To help make up for this, Eternity adds a small constant number of visplanes to the actual total, and thus is not exact :P Go try it out sometime.
|