User Tools

Site Tools


This is an old revision of the document!


Dealing with Leaks

This section explains what a leak is, why leaks are important, how they are found and fixed, and how leaks are prevented.

What is a Leak?

Maps created for the Ca3D-Engine are preprocessed by several compile tools (e.g. CaBSP, CaPVS, CaLight) for optimal performance. These compile tools assume that any map has an inside (where the player and monsters are), and an outside that nobody except for the mapper will ever see. The inside must be sealed “air-tight” or “water-tight” from the outside.

That is, if you imagine you flood-filled the map from the inside with water or pressurized air, at no point must the water or air be able to escape to the outside. Therefore, each place where that would be possible is called a leak.

“A leak is a hole in the world, where the inside of it is exposed to the (unwanted) outside region.” CaBSP error message when a leak was found.

Examples for Leaks

FIXME This section is currently under construction.

  • gaps
  • wrong textures (alphatests, blends)
  • terrain (mention sky blocks leaks)
  • tiny gaps

Effects of a Leak

If your map has a leak, the CaBSP compiler will automatically detect it and consequently abort the compilation with an error message like this (if there is more than one leak in the map, only the first leak will be reported):

*** Fill Inside ***                                 0: 0: 1

### LEAK DETECTED! ###

A leak is a hole in the world, where the inside of it is exposed to the
(unwanted) outside region. Thus, I generated a leak pointfile.
Load this file into CaWE, and find the beginning of the line.
Hint: The beginning is always near one of the "info_player_start" entities.
Then find and fix the leak by tracing the line until you reach the outside.
(I always take the shortest path, so this should be easy.)

Notes:
- Leaks can be *very* small. Use a close-up view, if necessary.
- Use the grid. The grid is useful to fix leaks + to avoid them from the start.
- Make sure that *all* "info_player_start" entities are inside the world!
- Please refer to the documentation for additional information.

Pointfile written to Games\DeathMatch\Maps\LeakDemo.pts

FATAL ERROR: Stopped by leak.
Program aborted. 

That means that with a leak in the map, you cannot run the map at all. As CaBSP doesn't write any output file in this case (except for the above mentioned pointfile), neither the subsequent compilers (CaPVS and CaLight), nor the Ca3D-Engine itself can run the map.

Future versions of CaBSP may reduce the severity level of the occurrence of a leak from an error to a mere warning. This will allow you to run your map with Ca3DE even if it has leaks, but nonetheless will leaks remain a problem that should be fixed. Leaks always indicate that the map could not be optimally processed, and thus imply higher polygon counts and lower performance.

The next section will tell you how to find and fix the leaks reported by CaBSP.

Finding and Fixing Leaks

FIXME This section is currently under construction.

  • Load pointfile, UNLOAD it for performance.

Preventing Leaks

FIXME This section is currently under construction.

CaBSP has become very good in reliably detecting leaks, and when CaBSP aborts compiling and complains about leaks, it makes pretty clear in its error message what's going on.

However, if this is your first leak, I'd much recommend to read the great explanation in the Hammer online help in the Troubleshooting section: “How do I fix leaks in my level?”. It also teaches you what leaks are and how you can prevent them. Here are a few additional remarks that might be helpful:

  1. Run Check for Problems from the CaWE Map menu.
  2. Do never assume that translucent or detail entities seal your world. Sky brushes do.
  3. Carefully look for misaligned brushes. In my experience, the “Carve” tool, rotation and certain other operations easily cause rounding errors which in turn cause leaks.
  4. The best you can do is to prevent leaks from the very beginning by using the grid and avoiding all tools that potentially introduce rounding errors. As a gross guideline, all operations that operate on the grid and that are guaranteed to produce vertices on the grid are usually safe, such as resizing rectangular blocks, shearing, vertex manipulation (although that can introduce other errors, which can be identified with the Check for Problems item from the Map menu), mirroring, and clipping and carving, when the resulting vertices are on-grid. The following operations are usually less safe: Arbitrary rotation, and clipping and carving, when the result has vertices that are off-grid.
    For less-safe operations it is usually better to try to mimic the same effect with the safer operations. For example, when you want an arched door in a wall, creating and placing the wall brushes manually is much preferred over carving an irregular hole into the wall!

Finally, let me mention a very rare situation in which CaBSP reports no leak, but a leak is present: The symptoms of such unreported leaks are a blank screen when you load the world in Ca3DE, only environmental background is displayed, or you are falling through the floor and everything disappears after a few seconds. Such leaks occur sometimes when some old BSP decompile tools that are still available on the internet, produce world geometry that is so degenerate that not even CaBSPs rounding error control and validity tests can help it. It is possible to remedy such cases automatically, but I will write a description for the process only should somebody actually ever experience this problem.

mapping/cawe/leaks.1181204814.txt.gz · Last modified: 2013-01-07 12:07 (external edit)