What is a leak, and how do I fix it?
Levels created with the Source Engine must be completely sealed. The inside of your level must not be able to reach the outside or as we call it, The Void. When there are any kind of holes to The Void, a leak is generated when the map is compiled by VBSP. This results in a MAPNAME.lin file (Also call the Point File) to be created on compile, this file contains where the level has leaked out to The Void. When the leak occurs, the tools do not know which part of the level is inside, and what part is outside, and VVIS cannot run correctly. If VVIS is not run several effects may not work or look right including, but not limited to:
- Correct Lighting
- Particle Systems
- Sound Scapes
- Certain Shaders
- Other random things
You can confirm if you have a leak by looking at your compile log. You’ll see something like this in the compile log.
ProcessBlock_Thread: 0…1…2…3…4…5…6…7…8…9…10 (0
**** leaked ****
Entity prop_static (558.00 -4.00 183.00) leaked!
Processing areas…done (0)
Building Faces…done (0)
NOTE: Some games will abort a compile when you have a leak, while some older games will just keep compile with the leak. Some games will have VVIS.exe crash, and leave this error in your compile log.
LoadPortals: couldn’t read c:\my_levels\mapname.prt
If you have any of these happen to you, you probably have a leak. Now we just have to try and locate the leak. This is done by using the MAPNAME.lin file that was generated by VBSP when it realized that your level could reach the void.
- Make sure Radius Culling is off, this tool causes many problems and should never be used. If it’s on, there will be a red circle in all your 2D views.
- Start by doing a standard VBSP ONLY compile. VBSP is all we need to compile to test for leaks. This is because VBSP with either generate the needed MAPNAME.prt file for VVIS to do it’s job, or if there is a leak MAPNAME.lin will be generated instead.
- Verify that a leak is present in this compile
- Load the Point File (MAPNAME.lin)
- Click Map
- Click Load Point File
- Click Yes when asked if you want to Load default Point File
- Now you have to locate the leak in the 3D and 2D views. The leak is represented as a red line. It draws it’s path from the entity the leaked, and the path it to to reach the outside of level. Locating the red line in a level full of stuff can be difficult due to the sheer amount of stuff in your level. To easily find the line, follow these steps.
- In the compile output window, grab the XYZ coordinates of the leak.
- Click View
- Click Go to Coordinates…
- Enter the XYZ Coordinates that you got from the compile output, then click OK.
- You’ll now be looking right at your leak. Click on the entity that is causing the leak, and press CTRL+E to center all your 2D views onto it.
- Follow the red line to see exactly where it’s leaving your level.
- Now, using only world brushes, you’ll need to patch that hole. You can do it by creating new brushes, or just extending existing ones. REMEMBER: Only world brushes will prevent leaks.
- Compile the level again, then check the compile log to see if you have a leak. If you do, follow these same steps again to fix the leak. It’s not uncommon to have multiple leaks at a time.
What are some other causes of leaks?
Entities outside of the level.
Improperly constructed area portals
Leaks can be caused when an area portal does not completely seal the two areas that it touches. When this happens a leak will be generated. Find the trouble area, then either fix the trouble area portal or create another one to seal the area. When you have one of these leaks, you’ll receive a different compile log leak error.Areaportal leak ! File: c:\my_levels\mapname.lin
Brush 55419: areaportal brush doesn’t touch two areas
Non solid geometry that does not seal the level
Displacements and entities (such as func_detail and func_brush) do not prevent leaks. You’ll have to put a backer entity behind these to prevent them from reaching the void. Typically you use tools\toolsnodraw for this.This is an example of a func_detail causing a leak. Either put a nodraw brush behind it, or press CTRL+SHIFT+W to move to back to a world brush.
Mismatched / Misplace entity origins
Some entities have the origin ball. You may have accidentally moved this away from the entity. (This can happen when you vertex edit things). To solve this leak, follow these steps.
Translucent textures on brushes
If your level is completely sealed, but one of the brushes that is sealing your map has “$translucent” “1” on it, this will not seal your level. You’ll have to either remove the translucent parameter from that texture, or use nodraw behind this offending brush to prevent the leak.