@#!% LEAKS!!!!
By: Sam "sma" Glidden
Written 2001.
We all suffer at one time or another from this problem. Some of us know how to solve it. Some of us don't. This tutorial is for those people, who seem to number in the millions with more joining their ranks every day. :) No, really, this question seems to pop up in the forums several times a day. So, in a burst of thoughtfulness, I decided to crank this out. Actually, it was out of laziness, so I can just link people with questions to this page. And so, without further ado, THE DREADED LEAK:
WHAT THE HECK IS A 'LEAK' AND WHY DOES IT MATTER?
Ah, back in my youthful days of mapping, I started out just sort of piling brushes together to make my maps. Sure, it seemed all right, my maps looked OK, they just ran a little slow. Actually, they ran really slow. So I got to thinking: How can those Valve people make those large areas with a lot of monsters and have it run all right? Well, after dismissing my first thought of "magic!" I realized it must be in the way the maps were put together. Then I did a little research, actually read those pesky little errors that it gave me when compiling, and put together some startling info: holes in my maps were causing the game to confuse the interior with the outside void, deciding it was to much to compile, and giving up in disgust. To put it technically, the VIS program couldn't run properly because of at least one 'leak in hull 0' causing the map to be compiled so the game engine couldn't tell what you could and couldn't see, and so ended up rendering it all.
This was bad.

OK, so a leak is a hole between my map and the void. And that is somehow related to the unrelated fact of what the engine thinks you can and can't see. So everything screws up and your computer has to struggle under the strain of rendering it all. I can deal with that. But, sadly, my computer can't.
WELL, WHAT CAUSES THE LEAK?
Some brushes that don't line up completely. Here's a picture. See that little crack that leads to the outside? That's it. That's all it takes. So whenever you are putting brushes together, make sure they are perfectly lined up. When rotating brushes, make sure they line up with the adjacent brush. Also it must be a 'world' brush that blocks you map from the void. No entities, the engine sees right through them. So if you make a door at the edge of the map, and make it an entity so people can run into it and here the little latch-lock noise, be sure and put a normal brush behind it.
SO NOW THAT I KNOW LEAKS ARE EVIL, HOW CAN I WIPE THEM OFF THE FACE OF MY MAP?
When you think about it, it is really simple. There's a hole somewhere. So all you have to do is patch it up. That's easy, all you have to do is enlarge a brush to cover it or stick another one in. Most everyone can handle this part. But the real thing that gets everyone is finding those little buggers. That picture I showed early is an example of a nice, big leak. Many leaks are really small and in hard to see places. To combat this problem, people have developed a number of techniques.
Method 1: Hunt
This is simple, and so therefore usually doesn't work. Load up you map, and run around looking for the leak. Nine times out of ten you won't find it. BUT, it is a good way to start because it is fast and easy. If you're not using software rending (I pity you if you are), bring down the console and type "gl_clear 1". That will make the outside a nice bright red, making it much easier to see. If you don't find the leak after a few minutes search, its time to move on to another method or you'll get fed up with the whole mapping business, move to Hawaii, and spend the rest of your life with a nice tan.

Method 2: Pointfile
Here it gets difficult. When your map was compiled, a .pts file was created (mapname.pts). DON'T DELETE THIS FILE. If you already did you'll have to compile again. Now, get this file into the /maps directory, the same one as your map. If you're using a batch compiler, you can tell it to move the file automatically. Otherwise you have to do it manually. Anyway, once it's there, load up Half-Life and run your map. Make sure you start the game with "-console" and "-dev" and "-particles 999999". [If you don't know how to do this, right-click on your HL shortcut, select properties, go to the shortcut tab, and type those commands in after the other gibberish in the "target" line. See picture.] Also make sure you start the map though console, not as a LAN game or something.
So you got your map up and running. Hit ~ to bring down the console. Type "pointfile". If everything worked, an ugly black-white dotted line should appear. You may have to do a bit of running around to find it. Now, once you see it, bring down the console again and type "noclip". Hehe now you can fly around and through walls! So start following that line. Eventually, if you don't lose it through the maze of bounces and webs it creates (yes, sometimes it tries its hardest), it will lead you to, and through, the hole in your map. So, bingo, there's that leak! It sometimes helps if you type in "gl_clear 1" so when you get near the leak you can spot it.
Another Method:
Another less effective an
d more time consuming method is that of using blocks. Make a huge block, put it over part of your map in worldcraft, and compile it. If the leak goes away, you know it was somewhere inside the area where the block is. Otherwise, move the block somewhere else. Note that this doesn't work very well if you have more than one leak.
There are other strategies people have come up with over their mapping years. If you know a good one, e-mail me.
OK, SO I UNDERSTAND LEAKS AND EVERYTHING, BUT DO I REALLY NEED TO GO FIX THEM? WHAT IF MY MAP RUNS FINE ANYWAY?
You're a stubborn monkey, aren't you? Here are some reasons:
1. Just because your map runs fine on your computer doesn't mean it will on everyone else's.
2. If your map is big, it definitely won't run fine.
3. Lighting is always screwed up if VIS doesn't complete right. If you use Zoners compile tools, which you should, it won't work at all. Otherwise, RAD (lighting) is limited to direct lighting only, no reflecting, and that looks bad.
4. Leaks are a sign of weakness.
5. It just makes my skin crawl, having to play a poorly made map. And if your map has leaks, it is poorly made. That just makes me shudder.
6. Ummm. it's just really important, OK?
THANKS FOR TAKING TIME OUT OF YOUR REALLY IMPORTANT LIFE TO EXPLAIN THINGS TO US WEAKLING NEWBIES.
Uh, no problem. Every now and then I like sharing my wisdom with you mortals.
