Practical guide on hint brushes placement
If you haven’t gotten the hint from the title, this article deals with the usage of hint brushes in Source engine. For the rest of the article, I will assume that you are familiar with the working of the Source engine and have an understanding of hints, visleaves and overall optimization. If it is not the case, then it is highly advisable to start on the Valve developer Wiki page (Hint wiki) and (visibility optimization), as well as read my comprehensive Source optimization paper (Man vs Engine) for an in-depth explanation of hints and optimization in general.
I get a lot of questions and requests on hint brushes, so this article is more like a journey inside my head to see how I think about and approach hints placement and to give everyone some practical examples on how I systematically proceed with hint brushes. Smoking is prohibited during this journey and please keep your limbs inside the train at all times…what?? Never mind, that was my internal voice.
As the name implies, horizontal hint brushes are parallel to the ground as opposed to vertical brushes which are perpendicular to the ground.
If you build your base brushwork in standard sizes (64, 128, 256, etc.), these horizontal hints will be neatly placed at those same heights. What if you do not build your backbone brushes in standard sizes? Well, nothing is lost and you can still add those horizontal hints. You just need to select 4-5 common heights in your map’s brushwork and place hints accordingly (for example, if many of your brushes are at 144, 276 and 348 units high then placing 3 horizontal hints at these heights would be ideal).
If the water area in the screenshot is also accessible in-game, then a 4th horizontal hint should be placed at ground level (location 4 on screenshot) to separate lower water area from upper ground level.
Here’s how horizontal hints look like in my map de_brooktown.
After the horizontal brushes, T-shaped brushes are the second pattern that I look at to add some hints. You must be confused right now asking what the hell a T-shaped brush is!
The answer is easy: it’s a brush with a shape of a T (Ah, you don’t say). Joking aside, it is any brush or conglomerate of adjacent brushes that is more or less shaped like the letter T when looked at from the top view.
Yes, I know you need a screenshot; here it goes.
Let me show you the same scenario but without the hints applied.
The visleaves are highlighted in blue and you can clearly observe that A & B have now a direct line of sight (LOS) as is the case for B & C. Having a direct LOS means that the 2 visleaves will be both totally rendered regardless of the player’s location inside one of them (refer to my paper for a full explanation of the BSP and “visibility from a region” concepts).
If you stand in B (right at the location of the letter B where you are not supposed to see A and C), the engine will render the whole A and C visleaves as well as all the visleaves to the north of B and the south and west of C; in simpler words, your fps will plummet faster than a plane hit by AA guns.
Always stay on the look for these T-shaped brushes to separate visleaves on both sides of the T.
Corner hints are easily the most overlooked hints by beginner and advanced mappers alike.
It could be that some designers don’t know about them while others are confused by their usage, but these corner hints are extremely valuable in cutting visibility and should be the 3rd pattern to systematically look for in your map.
As I mentioned in my paper, corners could be indoors (corridor) or outdoors (street); as long as you have a corner edge with regular world brushes on both sides of the corner, then this hint is a viable solution. These hints can be of any shape but I find it easier to have them in triangular shape for simpler manipulation in Hammer editor.
Let’s see those corner hints in my map de_spezia_pro.
The corner hint must (and I say again must) touch the tip of the corner as denoted by the red arrows location. It should also extend on both sides of the corner until it touches regular world brushes (as denoted by the red circles locations). Please note that only the hypotenuse (the diagonal side) is textured with hint while all other sides are skipped.
Using these triangular corner hints, visleaves A & B cannot see each other and nothing in B is rendered when you stand in A and vice versa. Similar logic is applied to C & D visleaves since without this hint, the whole street to the right of D will be rendered when you stand in C.
Some corners’ geometry might be tricky or some other corners might have one side without regular world brushes; in this case, you can skip the hint placement on such corners (no pun intended).
Make it a habit to always trigger the angular hint flag in your head when you see corners in the map.
Many mappers leave visleaves’ division to VBSP but do not know that vbsp does a not-so-brilliant job in this regard. Whether you like it or not, a manual intervention with hint brushes is mandatory to ensure proper visleaves’ cuts across the map.
One of the poor vbsp judgments is something I like to call the poking hallway; it is simply when a visleaf extends through a hallway, doorway or window beyond their edge, which allows this visleaf to see other visleaves in the vicinity and render their content, putting an overhead on the engine.
I hear you shouting “screenshot” to which I’ll gladly oblige with some screenshots from my map cs_east_borough.
If the hallway is long, it might be worth adding a hint brush in its middle in addition to the two on its edges.
Let me show you now the above screenshot but without those hints.
With this setup, and even if you are in the middle of this back alley and can’t technically see C and D, the poking visleaf you are standing within can, and will unfortunately render all of their contents. If the map is highly detailed, then you’re in for a frustrating slide show of low fps.
If you have been paying attention so far, you would have noticed that the left edge of this hallway (towards C) is also a perfect candidate for a corner hint. Aha, you didn’t think of that, did you? Hints work best in combination as you can tell and you should keep this in mind when dealing with them.
As I mentioned in my paper “Man vs Engine”, your ultimate goal is to make a specific visleaf “see” the least amount of adjacent leaves thus preventing the engine from rendering the content of these “unseen” leaves which will reduce engine overhead and increase frame rate.
Please memorize this golden rule as it will be included in your pop quiz next week :).
One final hint
Hints are easy and fun to work with, trust me. The hard part is understanding how the Source engine and the BSP work. Once you know these well, placing hints becomes intuitive and natural.
This article summarized my systematic approach with solid examples about proper hint placement. As with any system, it needs practice and perseverance and the rewards are big.
To give some you motivation, I can tell you that by constantly practicing and following this approach, I am able to have a 1-2 minutes run in a map and come up with more than 90% of the hint setup in my head.
This article, coupled with my previous comprehensive paper on Source optimization, should give you enough tools to win your optimization fight and have tightly-optimized maps with high frame rate and fluid gameplay.
June 15, 2014