How to fix leaks - Hammer Editor
So you're trying to compile your map in the beautiful, modern and very stable software Hammer Editor but you're getting a leak while trying to compile a map? Here are a few reasons as to why that could be, and how to fix them!
If you have any other tips feel free to suggest them and I'll add them to this post!
Step 1: Locate the leak
In hammer, go to Edit > Load Pointfile, and click yes when asked if you want to do so.
This should make a red line appear in your map, follow it to find the source of the leak!
Step 2: Identify the problem and fix it.
There are different reasons as to why a map is leaking, here's a list of the typical reasons of why map could be leaking:
Reason 1 :
Map isn't closed off to the void. (Hole in the map)
How to fix: Simply close the map from the void by extending currently placed blocks to patch the hole, or place new blocks to patch the hole.
Note: If you have weird geometry next to the void, it could be that the hole is infinitely small and you should align verticies to the grid, remake the brush or patch the hole with another brush.
In source, your map always needs to be closed off of the void in order to avoid graphical and lighting issues. This is a very common leak and is easily fixable!
Reason 2 :
One of your brushes that touches the void is a func_detail (or other world detail such as a displacement)
How to fix: Make any detail brush that touches the void back into a World geometry by selecting said brush and by using the CTRL + SHIFT + W shortcut
Note: Lots of people will be in "solids" instead of "groups" and because they click a brush and dont see the entity properties thing pop up they assume its world geometry and shouldnt be leaking, make sure you are in groups while selecting the brush to show the entity! (Thanks hex for pointing this out!)
Using func_detail in your map is a good way to optimize your map but be careful to not set any brushes that touch the void into one!
Reason 3 :
One of your brushes that touches the void uses a transparent texture.
How to fix: Insert a nodraw/brush with a texture that isn't transparent between the brush that causes the leak and the void, in order to patch the hole. (See Picture)
Textures with transparent proprieties such as $translucent can cause leaks as they let the map see the void, which causes a leak!
Reason 4 :
One of your tool brushes has an origin that is in the void.
How to fix:
1 - Select all your brushes by going to Edit > Select All
2 - You should now see origins as little white circles in the map or as a blue sphere in the 3D view. Find those who are in the void.
3 a) - If you currently have origins that you want to keep as is (ex: func_rotating), simply find the origin that is out of the void and manually place it inside of the bounds of the map.
3 b) - If you do not have origins that are useful (ex: func_rotating) and want to easily fix this leak, go to Tools > Center Origins. If this doesn't fix it, find the stray Origin and put it inside of your map manually.
Origins can be useful but be careful for stray origins! They will make your map leak!
Reason 5 :
One of your entities has an old keyvalue from being copied over, switched from another entity type, or moved with the vertex tool and that hidden keyvalue is leaking.
How to fix: Remake the entity.
Sometimes when the compiler says the cause of the leak is an entity that normally doesn't have an origin, it could be that it secretly has an origin, even though it doesn't display it. This is definitely one of the most obscure leaks that can happen. Easiest way to fix this is to remake the entity entirely.
Reason 6 :
An entity has a special character in a targetname. (Such as ")
How to fix: Open the .vmf in notepad and change the targetname back to something valid manually.
When an entity has an invalid targetname with characters such as ", it could cause your map to leak since the pointfile would always point straight to the map origin, going through the geometry. Reloading the .vmf would not fix this either since it would basically be corrupt. Thanks to granis for this tip!
Step 3: Enjoy a leak free map! The map compiles now, hurray!
To remove the red line in your map, simply go to Map > Unload Pointfile
🌺 Thanks for reading! Hopefully this guide helped you fix the annoying leaks in your map!