1. Floating/thin wallBy floating, I certainly do not mean hanging mid-air like a Xen map from Half-Life. Floating here suggests that the wall is more or less detached from other solid structures, and usually at low heights.
The above screenshot taken from the Counter-Strike Source map cs_compound is a classic example of floating walls. The wall is short and encircles the whole compound area; it is also a func_detail so hints and areaportals are not much useful here. The container to the right is also considered a floating wall, regardless of its function (cargo container). Notice the white rectangles denoting the occluders that are neatly inserted inside the brushes while all green models are hidden due to the occluding effect and the red ones are visible.
This screenshot is taken with all details hidden to give you an idea of the actual regular world brushes left in-game. You clearly see that the map is really wide-open and empty with not much work that can be done with hints and areaportals. The walls and containers (now hidden in the screenshot) were scattered across the map, making them floating by definition. Just remember the second condition for occluders: there have to be enough models to warrant the price of the occluders. This means that if there are no models behind those walls, then there is absolutely no need to add an occluder. Here’s another example of floating walls taken from cs_assault in Counter-Strike Global Offensive.
The floating wall is actually two stacked func_detail containers, but because they are not part of buildings, they are considered detached. And since they are located in the middle of an open intersection in front of several models, the occluder is justified (again, the white rectangle inside the container is the occluder). Another type of wall that is prime location for occluders is the “thin wall”. By thin, I don’t mean paper thin but rather any wall that is part of a house, warehouse or building that separates indoors from outdoors. Returning to cs_compound, the warehouses thin walls are good examples to demonstrate this type of walls.
Occluders are totally inserted inside the walls of the warehouse to cull models on both sides of the wall whether the player is outdoor or indoor. Always make sure that your occluder brush is absolutely contained inside the brush it is in without any poking parts (if your brush is 4 units wide, then make your occluder 2 units to be on the safe side). It is worth mentioning that occluders and areaportals should never touch or cross paths… or there will be blood (their rivalry goes back to World War I as I have been told by an elderly person in the village – yep, another “legit” true story). If your occluder has to cross an areaportal, then split the occluder in two parts on each side of the areaportal to avoid any contact between them. Another solid example is found in the CSGO map de_stmarc.
This is the map with all details hidden. As with cs_compound before, the map is really open with few solid structures (and a lot of models not seen in the screenshot). As you might have guessed by now, this is the perfect recipe to use occluders, thin-wall edition.
You can see in the above screenshot how the occluders are scattered inside the different thin walls of the various houses. You can observe some occluders that are showing without being inside brushes; that’s because the func_detail part of the wall/house that contains them is not shown in the screenshot but rest assured that every one of these occluders is neatly hidden inside a brush. Let’s see those occluders in-game.
And for a more general view of the occluders in the map.
2. Displacement hillIf you thought this is the name of a historic battle, then I am sorry to disappoint you; the name you are looking for is “Bunker Hill”. Similar to floating walls, any small to medium hill made of displacements and that separates two areas on each side with a considerable amount of models is a natural target to place an occluder.
In the above screenshot, you can spot a fairly medium-sized displacement hill at a relatively low height (crosshair location). As you might have predicted, hints and areaportals won’t do much in this setup because of the lack of sufficient regular world brushes to support them. In this case, an occluder should be placed inside the displacement, going from ground level to the tip of the hill (from the inside), while also making sure that no parts of the occluder protrude outside the displacement. Here is this particular occluder in action.
3. Prop fence/hedgeAs with the brush-made floating wall, a floating prop of considerable size such as a fence or hedge is also a candidate for occluder placement. The same ground rules apply: make sure that the area has a considerable amount of models, that hints/areaportals are not much viable setup, and that the occluder is totally contained within the prop. Here is a small test map that I cooked for this example.
As in previous examples, the occluder is the white bordered rectangle while the green hidden props on the left are static props and the small ones to the right are physics props. Both the hedge and the wooden fence are prop_static and the occluder brush is only 1 unit thick to make sure it is completely hidden inside the props. In the case of props, it is absolutely more important to make sure your occluder is not poking outside the edge of the prop that contains it. If the occluding face is outside the prop, then the latter will be… yes, you guessed it, culled (this is what occluders do, don’t they). You can clearly visualize that your setup will be flawed and unrealistic with hidden props in front of the players without any visual block to support the culling.
4. A bit of testingAlthough I have mentioned in the introduction that this article is not a wiki nor a tutorial on occluders and even if I have explained occluders in detail in my paper Man vs Engine, I really feel that I should briefly repeat my explanation on proper occluder testing (cost vs benefit for fps). This is a crucial topic when it comes to occluders working in real time in-game. I certainly do not want you to go on an occluding spree and start adding occluders whenever you see a floating wall/displacement or prop, without proper justification or fps testing. Always remember the conditions for occluders: expensive, hide models, work in open space with little world brushes. Also keep in mind that most maps do not require occluders. Keep trying with areaportals and hints until you feel that the low-ish fps in a specific area can’t be improved anymore, and that the area is model-rich with open unobstructed lines of sight. Then, and only then, think of occluders. Now that you know when and where to place an occluder, the important question is how to tell if your occluder is helping with fps or making things worse because of its high cost. Proper fps testing is the plain and simple answer. After you implement your occluder, test your fps in-game near the location of the occluder. Once you take note of the frame rate, disable occlusion by typing r_occlusion 0 in the console and check your fps again at the same location. If the fps remain the same or increase, then your occluder was useless and eating up precious resources; remove immediately without blinking. On the other hand, if after disabling occlusion, your fps plummet considerably, then your occluder was doing a good job maintaining a higher fps which totally justifies its cost. It is worth mentioning that Valve disabled this console command in CSGO and thus, it can’t be used to test the occlusion system. To counter this issue and test your occluders, compile a second version of the map while hiding the occluders visgroup in Hammer to prevent them from compiling into the game (name your second map as something similar to “de_yourmap_occluder” to differentiate it from the main map with occluders included). The fps testing will be carried out in a similar manner to confirm the need for the occluders.
5. Conclusion or occlusionOccluders are very powerful tools in the optimization arsenal but are costly at the same time and need to be handled with care. Think of them as weapons of mass destruction; you don’t use them unless you’re absolutely sure of the outcome. As I mentioned several times earlier in this article and in previous papers, most maps can be safely and solidly optimized without occluders. Occluders are used in very specific conditions; keep trying with hints and areaportals and only after you reach a dead end where those are not feasible, resort to occluders.
Will2k September 14, 2014