Optimisation
We all have to face it. We all fear it. And very few of us understand it. But I've decided to throw together a tutorial which brought my map's fps up from 30 to 45. This tutorial is by no means a complete guide to optimisation, but it's certainly better than nothing.
I’m going to assume here that you already understand what should and shouldn’t be a func_detail. For the purposes of this tutorial, I have func_detailed anything that you cannot hide behind. I’ve removed 2 ramps near the bottom of that picture because you can’t really hide behind them, but I’ve kept all the walkways because they can block rendering when looking up or down. I’m also going to assume that you are still in the blocking stage, and don’t have too many tricky details to work around.
Hints
Hints are one of the most difficult, yet most efficient, forms of optimisation. This is because you need to understand how optimisation functions in order to use them. This is the model I’m basing this tutorial on:
This works fine, except when Vis screws up, and messes with the visleafs, as per the right. This is prevented by adding hints that run perpendicular to the wall, resulting in the good scenario. If you have a large wall, simply duplicate it, stretch it in both directions perpendicular to its face, and turn it into a hint brush.
Of course, keep in mind that each brush can only have 2 faces textured with hint, the rest need to be textured with skip. For this scenario you need to use 2 brushes, and remember to texture the ends and bottom with skip. When putting this into practise, it’s inefficient to do this for every single brush, which is why I make a grid out of hint brushes. Keep in mind that the grid method will not work for all maps. It works best for mine because my map is built on a nice 128x128 grid, so the faces all line up. Just try to run the faces textured with hint across the ends of as many world brushes as possible, perpendicular to the largest face.
For example, here's a typical world brush, with this method of optimisation
Keep in mind that hint brushes only need to run until they intersect with a world brush
And of course, you always need to run planar hints over the levels of your map.
You can use hints in both directions, as long as they run perpendicular to at least one large face. It's find if hints intersect.
Here I've started nodrawing the skip faces, so that it's easier to understand the more complex examples. In reality you should keep them as skip, and not use hints 1 unit thick.
When a structure has multiple levels, make sure to run the hint brushes above the next floor, if they're on the outside.
Here's an abstract version of a switch-back. Note how the hints don't run on the inside, because then they wouldn't be perpendicular to the large faces.
With large blocks, hints can run in both directions
Here's a typical house
Using hints for the doors and windows looks painful, but is beneficial. The goal is not the connection through the doorway, but blocking the connection through the surrounding walls.
Of course, areaportals are not to be skipped on.
However, in this situation, there would be an areaportal leak. Either add a huge areaportal in the top (undesirable)
Or simply cover the roof
Finally, this is an example of a situation in which one should use occluders:
We all have to face it. We all fear it. And very few of us understand it. But I've decided to throw together a tutorial which brought my map's fps up from 30 to 45. This tutorial is by no means a complete guide to optimisation, but it's certainly better than nothing.
I’m going to assume here that you already understand what should and shouldn’t be a func_detail. For the purposes of this tutorial, I have func_detailed anything that you cannot hide behind. I’ve removed 2 ramps near the bottom of that picture because you can’t really hide behind them, but I’ve kept all the walkways because they can block rendering when looking up or down. I’m also going to assume that you are still in the blocking stage, and don’t have too many tricky details to work around.
Hints
Hints are one of the most difficult, yet most efficient, forms of optimisation. This is because you need to understand how optimisation functions in order to use them. This is the model I’m basing this tutorial on:
This works fine, except when Vis screws up, and messes with the visleafs, as per the right. This is prevented by adding hints that run perpendicular to the wall, resulting in the good scenario. If you have a large wall, simply duplicate it, stretch it in both directions perpendicular to its face, and turn it into a hint brush.
Of course, keep in mind that each brush can only have 2 faces textured with hint, the rest need to be textured with skip. For this scenario you need to use 2 brushes, and remember to texture the ends and bottom with skip. When putting this into practise, it’s inefficient to do this for every single brush, which is why I make a grid out of hint brushes. Keep in mind that the grid method will not work for all maps. It works best for mine because my map is built on a nice 128x128 grid, so the faces all line up. Just try to run the faces textured with hint across the ends of as many world brushes as possible, perpendicular to the largest face.
For example, here's a typical world brush, with this method of optimisation
Keep in mind that hint brushes only need to run until they intersect with a world brush
And of course, you always need to run planar hints over the levels of your map.
You can use hints in both directions, as long as they run perpendicular to at least one large face. It's find if hints intersect.
Here I've started nodrawing the skip faces, so that it's easier to understand the more complex examples. In reality you should keep them as skip, and not use hints 1 unit thick.
When a structure has multiple levels, make sure to run the hint brushes above the next floor, if they're on the outside.
Here's an abstract version of a switch-back. Note how the hints don't run on the inside, because then they wouldn't be perpendicular to the large faces.
With large blocks, hints can run in both directions
Here's a typical house
Using hints for the doors and windows looks painful, but is beneficial. The goal is not the connection through the doorway, but blocking the connection through the surrounding walls.
Of course, areaportals are not to be skipped on.
However, in this situation, there would be an areaportal leak. Either add a huge areaportal in the top (undesirable)
Or simply cover the roof
Finally, this is an example of a situation in which one should use occluders:
Last edited: