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:

  1. Correct Lighting
  2. Water
  3. Particle Systems
  4. Sound Scapes
  5. Certain Shaders
  6. 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.

fixing up env_cubemap materials on brush sides…
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.

Valve Software – vvis.exe (Sep 8 2014)
6 threads
reading c:\my_levels\mapname.bsp
reading c:\my_levels\mapname.prt
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.

  1. 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. Radius_culling
  2. 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.
    1. Doing a VBSP only compile in the NORMAL compiler:bsp_normal
    2. Doing a VBSP only compile in the EXPERT compiler:bsp_expert
  3. Verify that a leak is present in this compileleakconfirm
  4. Load the Point File (MAPNAME.lin)
    1. Click Map
    2. Click Load Point File
    3. Click Yes when asked if you want to Load default Point Filemaploadlinlinload
    4. 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.
      1. In the compile output window, grab the XYZ coordinates of the leak.leakxyz
      2. Click View
      3. Click Go to Coordinates…viewcords
      4. Enter the XYZ Coordinates that you got from the compile output, then click OK.cords
      5. 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.leakview
    5. Follow the red line to see exactly where it’s leaving your level.leakfound
    6. 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.Fixedleak
    7. 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?

  1. Entities outside of the level.

    1. You may have accidentally placed a prop, or some other entity outside of your level. Find it, and either put it into your level, or remove it.sillybarrel
  2. 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


  3. 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.displacementleakThis 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.func_detailkeak

  4. 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.

    1. Make sure Helpers are turned on. helpers
    2. Load the Point File as you did before.
    3. Click Edit
    4. Click Select Alleditselect
    5. Where the leak is, you’ll see the little ball. Click and drag it back to it’s owner entity. It will draw a dotted line to where you need to move it.originleak
  5. 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.