A bunch of optimization questions/checklist.

Hello folks.

Optimization is confusing to me, even with the multitude of guides I’ve read, so I basically had a few questions to ask about optimization and related topics.

  1. When I convert things into func_detail, I select multiples things and then tie it to func_detail (like select all the frame brushes on one building and then tie it) is this OK?

  2. How do I optimize waterindicies?

  3. I’ve done all the ‘duh’ things with optimization (convert a lot of brushes to func_detail and use nodraw on nonvisible faces) but non-fast compiles still take around a half hour to complete, and this wasn’t even on that big of a map. What else needs to be done to get low compile times on final compiles?

  4. What absolutely can not and should not be turned into func_detail?

  5. How profound an effect do visleafs have on compile time and in-map performance?

  6. What is everything that you, as a mapper, do when optimizing a map?

Thanks in advance.

  1. I find it easier to group brushes together as one func_detail if it’s all one object.

  2. use propper to turn some of your brushwork into models

  3. VVIS calculations take longer with the more visleafs you have, use Map -> Load Portal File to see your visleafs. Each blue line represents the edge of a space in your map. Certain parts of the map which you cannot see are not rendered to improve framerate. In order to calculate visibility, VBSP (the first compile program) splits the map up into visleafs, VVIS (the second compile program, the one that takes the longest with unoptimized maps) will take each visleaf and calculate:

can leaf 1 see leaf 2? no
can leaf 1 see leaf 3? yes
can leaf 2 see leaf 3? yes

When you play the map, your character will always be standing in a visleaf as long as they are inside the map, and whichever visleafs are not visible have all their containing contents not be rendered. When you run VVIS on fast, it skips over the leaf visibility calculations, speeding up compiles, but potentially lowering FPS. (more info at http://rvanhoorn.ruhosting.nl/optimization.php )

So to get low compile times on final compiles, use common sense and func_detail anything that doesn’t block a lot of visibility in the map. If VBSP is cutting visleafs in a wierd way, you can force a visleaf cut with a hint/skip brush (also more on the guide I linked to).

  1. displacements should never be turned into func_details - or any entity for that matter - VBSP crashes if you do so. Any brushes that block a lot of visibility should not be turned into func_detail either, or any brush that is sealing the map from a leak.

  2. If you have two really detailed rooms connected by a hallway, improper visleaf usage can kill your framerate by rendering both rooms at once, but proper visleaf usage can increase your FPS by only rendering one room at a time, and it has a minimal (maybe a second or two) hit on your compile time. (example)

  3. I usually pull up Map -> Load Portal File after creating another chunk of a map and start deciding what gets func_detail’d and whether or not a hint/skip brush will be of any use or help.

you can also use func_viscluster for big areas and stuff it helps out greatly

You have to be careful with visclusters, it can kill your FPS if you use it improperly. Don’t drag one out through the entire map. If you want a summary of what a func_viscluster does, it essentially looks for all the visleafs that are contained in the boundaries of the brush and assume that the visibility calculations are all yes (you essentially are manually telling VVIS that all those calculations will return as visible. All further calculations with visleafs surrounding the viscluster will treat the entire viscluster as a single visleaf. You should only do this with large, open areas where you can see everything. Example - flatgrass.

As a general rule I turn any brushwork that has faces not at 90 or 45 degrees to the map’s grid, especially large cylinders and arches (my maps end up having a lot of those.) However, I have had some instances where angled brushes don’t harm vis significantly. Usually they’re large angled blocks, defining the structure of the map, and they’re few and far between. Vis actually deals with angled surfaces pretty well, just don’t put a bunch in one place or you’ll give yourself a case of the microleaves.

I don’t have load portal file. It’s an external program, isn’t it?

Edit > Load Portal File

I think that’s it atleast

Nope. It’s not under Edit or Map.

Map > Load Portal File.

Also, you can create a new compile setup for GLview:

vbsp.exe -Glview $path$file
glview.exe -portal $path$file.gl

You can only load portal files in the OB engine hammer. You have to use GLView in Ep1 still.

Also, something that you may find useful: you can type mat_leafvis 1 in console and it will outline whatever leaf you’re standing inside in red.