- Jun 17, 2012
- 493
- 191
This is a very simple explanation of how visibility works in TF2 and how you can control it on a very basic level (with hint brushes).
First of all, when you compile a map, the compiler splits the map up into a bunch of convex partitions.
A map could look like this:
And a simplified version of its partitions could look like this:
It makes some choices that don't seem to make sense, but that's because the way it partitions the map is *very* procedural.
Anyway, let's pretend you have two players on the map at the positions of the orange dots:
They "belong" to the partitions that they're inside of, and the purple line shows that the partitions can "see" eachother. This is how the compiler deals with what parts of the map can see what other parts of the map. If it can make a line through nothing but partitions (that is, it doesn't go through a solid brush or the void) to connect two partitions, then anything in one of those partitions will render if the camera is in the other one.
Fortunately, you can constrain partitions with hint brushes, like putting one on the blue line here:
(note that you only need a single face, and the ones you don't want to "cut" leafs/partitions should be textured as "skip")
Which brings us to this case where the orange dots *can't* see eachother:
There's no line you can draw between those two partitions/leafs without going through solid geometry, so they can't see eachother.
Note that adding the visleaf caused one of the automatic separations to change. I put this really nearby, but it can actually happen anywhere, so you would probably want to put a hint on the right side of that building in the middle too.
Note that if you go way overboard with hint brushes you can make your map take much much longer to compile. Having a long compile doesn't mean your map isn't optimized ingame, but it's something you want to avoid because it's really annoying and makes testing things harder or take more effort than it should. Until you get a real good hang of them, you should only use them in important places where it really helps.
First of all, when you compile a map, the compiler splits the map up into a bunch of convex partitions.
A map could look like this:

And a simplified version of its partitions could look like this:

It makes some choices that don't seem to make sense, but that's because the way it partitions the map is *very* procedural.
Anyway, let's pretend you have two players on the map at the positions of the orange dots:

They "belong" to the partitions that they're inside of, and the purple line shows that the partitions can "see" eachother. This is how the compiler deals with what parts of the map can see what other parts of the map. If it can make a line through nothing but partitions (that is, it doesn't go through a solid brush or the void) to connect two partitions, then anything in one of those partitions will render if the camera is in the other one.
Fortunately, you can constrain partitions with hint brushes, like putting one on the blue line here:

(note that you only need a single face, and the ones you don't want to "cut" leafs/partitions should be textured as "skip")
Which brings us to this case where the orange dots *can't* see eachother:

There's no line you can draw between those two partitions/leafs without going through solid geometry, so they can't see eachother.
Note that adding the visleaf caused one of the automatic separations to change. I put this really nearby, but it can actually happen anywhere, so you would probably want to put a hint on the right side of that building in the middle too.
Note that if you go way overboard with hint brushes you can make your map take much much longer to compile. Having a long compile doesn't mean your map isn't optimized ingame, but it's something you want to avoid because it's really annoying and makes testing things harder or take more effort than it should. Until you get a real good hang of them, you should only use them in important places where it really helps.
Last edited: