Better call Mario!

How to fix a leak in a Hexen II map

Leak fixed!

Sometimes when it's time to test your map, things start going south: doors or buttons don't respond anymore to player touching them but behave like func_illusionary entities instead, that sort of things... It's a clue that something is wrong, and that may very likely be a leak in your map.

A leak is when the map's world is not fully enclosed by brushes and there is at least one possible path from the surrounding void to the entities. Imagine your map is a tank full of water: a path to the void would be a hole through which the water would vanish. Hence the name.

The Point file

The Point file (aka pts file) is your best tool to find the leak. It is automatically generated by the bsp compiler in the same directory as your .map file with the same name except for its .pts extension. You can load this file in TrenchBroom (menu File\Load Point File...). It draws a crooked green line you need to follow carefully (. (dot) and , (comma) keys are there to help you doing so) to eventually find where the line manages to pass from the inside to the outside.

If it happens to be in an area where brushes are standard parallelepipeds whose faces are well aligned on the grid, the leak is probably extremely obvious. It's the result of a simple lapse in concentration and is easily fixed. Easiest case, but also the rarest one. Leaks occur generally in more chaotic places with random shapes, triangles intersecting at weird angles, etc. (basically brushes representing organic architectures, terrain, caves...). Yet thanks to the pts line you should still be able to figure out where the leak is and neatly seal it.

That was Solution #1, use it preferably when you can.

The random extensions

An impossible leak

Pts line going right through a brush? Are you serious?

Sometimes unfortunately, even with the pts line things are not so clear (especially when the line goes directly through a brush, which of course makes no sense: leaks are always between brushes, not inside them!). Solution #2 consists in expanding the size of the surrounding brushes in every direction towards the void and make them intersect so that the result looks awful in TrenchBroom but makes any interstice between brushes impossible because brushes don't simply stick one to each other delicately anymore but roughly intermingle like if acting in a scary architectural porn movie.
The weak point of this method is that, as the leak was not precisely spotted, expanding all brushes randomly gives you chances of sealing it... but no guarantee.

The big box

Okay the leak is still there and the 2 solutions above failed at fixing it. So let's zoom out even more. Thanks to the pts line you have at least a general idea of the area where the leak is. Time to pull out the heavy artillery and enclose the full area within a big box! Thus, never mind it leaks, because there is an hermetic container all around (except for the holes allowing the area to connect with the other parts of the map). From the inside, the player has of course no clue they're trapped inside a "box in a box" (and they're actually not because all that apparatus doesn't use to outlive the bsp compilation and is never seen in-game, even with the noclip cheat code).
This trick works better if the problematic area can be isolated fairly well from the rest of the map (dead end or one-entry-one-exit style). If not, you can always raise the trick up to eleven and enclose the entire world, like a remake of The Truman Show.
The big box trick is said to make the compilation last a bit longer and the bsp file a bit bigger. Didn't really experience that but feel free to check, and decide by yourself whether it's worth to spend more time looking for the leak or if the big box is good enough for you.

Not always easy to fill Mario's boots!

Want to ask for clarification, report an issue with this trick or propose another one? Drop me an email If you use the trick please credit me and put a link to this website.