Snarkpit Articles


Finding leaks in the new Hammer



This tutorial is meant for those new mappers to Half-Life 2. This a simplified version of the VERCs that can be found here.

The definition of a leak is a entity exposed to the "ouside" world. Basically an entity isnt enclosed in solid brushes. The key thing to look for in the compile log is this:

**** leaked ****
Entity info_player_start (645.66 1879.28 -1239.00) leaked!
This means we have a leak, and the entity is the one that is closest to the hole in the level. The numbers are the cordinates of the entity's center. It might be helpful to go to these co-ordinates, but sometimes the leak could travel all the way across a level before it actually gets to the hole.

Also if you see this error:

FindPortalSide: Couldn't find a good match for which brush to assign to a portal near (3072.0, -512.0, -384.0)
Leaf 0 contents: CONTENTS_SOLID
Leaf 1 contents:
viscontents (node 0 contents ^ node 1 contents): CONTENTS_SOLID
This means that none of the brushes in leaf 0 or 1 that touches the portal has CONTENTS_SOLID
Check for a huge brush enclosing the coordinates above that has contents CONTENTS_SOLID
Candidate brush IDs:
Then it means that you have a leak, and it will go away once the leak is fixed.

Also if you receive one of these errors:

The map overflows the max portal count (94909 of max 32768)!
This means you have a leak. It is because VIS doesn't know which area of your map is inside or outside, so it is calculating both, thus leading to the max_portals error.

To us veterans we know how much of a pain it can be to find them, but the gods have heard our calls, and they have given us a much easier way to find them using Hammer.

Note: when finding leaks you may need to re-compile over and over again, you only need to run bsp to generate a pointfile, not vis or rad, so don't run them when trying to find leaks.

To find the leak we use what we call a pointfile. To load it we go to the Map-->> Load Pointfile.

The current version of Hammer will automatically load your pointfile (which is stored in a file called mapname.LIN, found in the same directory as the VMF you're currently working on). If it doesn't load it, then either you don't have a leak or you will need to manually load it up. When you do, Hammer will display a red line in your level which you need to follow to find your leak:



However, this method only solves "basic" leaks. Below are the different types you may encounter.

LEAK TYPE 1: Point Entity Outside of the Sealed Area



You're map may be sealed entirely, but you may have an entity out side of the sealed area, that causes a leak.



Notice that the model (prop) and light were out of the sealed level. To fix this, either delete the entities, move them into the sealed area, or build a new area around them!

LEAK TYPE 2: The Simple Hole





This is the second most simple form of a leak to solve, merely extend the brush down to cover the hole.

You can also sometimes end up with "microleaks." There are due to floating point errors when compiling, which can sometimes happen with rotated and heavily manipulated brushes. To avoid this, try to keep vertices aligned to the grid, and use displacement surfaces or models if possible rather than complex solid brush geometry.

LEAK TYPE 3: Entities or displacement surfaces sealing the map





This is a little harder to envision, everything must be enclosed by solid brushes. Displacement surfaces are not considered brushes (like the example above), they do not enclose the world, nor do any brush based entities (func_wall, func_door, func_"anything"). To solve this merely place (or I believe a better term would be "cap off") a brush behind the displacement surface or brush based entity - use the nodraw texture on it, as it will still seal leaks and means the game doesn't need to render more surfaces.

Note: to optimise performance on the map you can have the bush behind the displacement surface/brush based entity covered in the "nodraw" texture. This way the source engine wont render whats behind it, but still not create a leak.

There is also more to this leak that many may not realise:



How is this possible you ask? It's because this brush has a glass texture on one side of it. You see now in the new hammer whenever certain textures are placed on a brush, they are automatically turned into a brush based entity, like the glass example. The glass texture turned the brush into a brush based entity, and as we know brush based entitys are not allowed to enclose the world. The way you solve this is by replacing that one texture to something else, like "nodraw" or any other "solid" texture.

LEAK TYPE 4: Area Portals



This is a new type of leak that result from areaportals not being used correctly (usually, there is a path from one side of the areaportal to the other that doesn't go through any other areaportals). Simply load your pointfile to find out which areaportals are causing the error, and check out our areaportals tutorial.



Conclusion



Although this is a handy tool that Hammer comes with, the prevention of leaks in the first place is essential. Do this by avoiding the carving tool, the hollowing tool, and pay attention to resizing brushes that are not cubes (e.g. pentagons). Hope this was helpful.


Post ReplyView Topic
Discussion
0 starsPosted by $loth on Tue Oct 2nd 2007 at 5:32pm

Definately a decent recourse, especially to those completely new to leaks.

It would be good to mention that VIS should be read upon, a link to a description wouldn't go amis.
0 starsPosted by Leperous on Wed Jun 1st 2005 at 7:57pm

I've just updated the tutorial slightly, and fixed some spelling mistakes. Decent resource, though.
0 starsPosted by Notes on Sun Mar 6th 2005 at 9:27pm

These other people seem like they know what they're talking about/doing already, so why read a tutorial like this for beginners like me? Also, if overlapping brushes can have repurcusions, then.. what repurcusions? (explain, please) because I'm just trying to fix up a map to make it work, and this tutorial helped me solve the problem. The brushes appeared to line up fine, so I made them overlap, and the leak went away.

This tutorial is great for what it is. Short, sweet, to the point, and with some pictorial examples of some different types of leaks you can get.

Thanks smiley
0 starsPosted by DrFrag on Sun Jan 16th 2005 at 2:09pm

0 starsPosted by baalpeor on Wed Dec 29th 2004 at 11:53pm

Yeah, this was a straight-forward and much-needed tutorial. Good job, dooder!
0 starsPosted by thursday- on Fri Dec 24th 2004 at 9:27am

I feel you rushed this slightly and didn't proof read, fix or even consult anyone else on, which is a shame. Now that you've got quite a few comments I feel you could re-make this tut and hit each area perfectly. Although, only really helpful for those that have never used hammer 3.5, and I feel you need to concentrate on pointfiles and finding leaks without the pointfile, as we all know pointfiles in 3.5 were sometimes dodgy, although I've had no new bad experience with Hammer 4, its a nice area to touch on though.
Note: This may not make sense, wrote early morning in tiredness.
0 starsPosted by G.Ballblue on Thu Dec 23rd 2004 at 2:14am

Post ReplyView Topic