Ok, so you (hopefully) have a well designed map with some stunning architecture and awesome effects... now it is time to make it all run well. This tutorial will help your map run a little faster.
Posted by Basket_Case on Oct 23rd, 2006
Ok, so you (hopefully) have a well designed map with some stunning architecture and awesome effects... now it is time to make it all run well. This tutorial will help your map run a little faster. However, I must point out that while all mappers should do it, it won't automatically make the map super playable. It should help though, to say the least.
[page=Tools of the Trade]
First of all, for Source compiling, you should get Zoner's Custom Compile Tools (CST). They compile maps a lot faster than Valve tools do. Don't worry, there are no extra things you need to do to compile a map after you install these things. Once you have CST, unzip it all to your sourcesdk/bin folder, as shown:
Now open up Source SDK, and then open Hammer. Go to Tools --> Options, then go to the Build Programs tab (make sure that in the textbox titled "BSP executable", it points to cstbsp.exe in the directory). Next do the same thing for the textbox entitled "VIS executable", except ensure it points to cstvis.exe in the directory. Finally, do the same for the textbox titled "RAD executable", and make it point to cstrad.exe in the directory. Here is how it should look after you are done (Note that you don't have to be using $SteamUserDir):
Congratulations, you have set up Zoner's Custom Source tools! Now let's move on to the next part of this tutorial: The nodraw texture.
[page= The Nodraw texture]
The nodraw texture's purpose is very simple: Any face that it is applied to isn't rendered by Source! This lets the render tool take care of other things. So apply the nodraw texture to any face that the player should not see while playing. Note, however, that any faces that can be seen in Spectator mode, but not when the player is actually ingame, should have the Nodraw texture applied. However, this does not apply to your skybox! Never use nodraw on your skybox brushes, or the sky won't be rendered! The little chicken would go nuts! Here is an example of the Nodraw texture:
Note that I applied the nodraw texture to the out sides of the hollow cube with an
info_ playerstart and an info_player_deathmatch in places where the player should not be able to see, except while in spectator mode. Next up in this tutorial is skybox optimization!
Ok, first let me show you how NOT to do a skybox:
Whatever you do, do not make a hollow cube with the sky texture applied to it, and put a sky_camera entity in the middle!
Here is a very good tutorial on skyboxes
There is one simple rule for water optimization: Use as little as possible. And use a water_LOD enity near it so the detail decreases as you get farther away.
Next up in optimization, clipping vs. carving – something I am rather passionate about!
[page=Clipping vs. Carving]
Let me put this as straight as I can for you, (I apologize for the caps, but I want to get a point across):
CARVING IS VERY VERY VERY BAD!!!!! DO NOT USE THE CARVE TOOL IN YOUR MAP! I DON’T GIVE A MONKEY'S FOOT THAT IT'S MUCH EASIER, IT'S VERY VERY VERY VERY VERY BAD!!!!
Now, allow me to justify myself, and explain why you should use clipping instead. You see when you carve, you make the hole you want... but it leaves a ton of brushes left over. For example if you were to carve a cylinder into a block, you will have so many extra brushes, which brings me to another optimization point (try to have as few brushes as possible!
This could be done better by using clipping along each vertices edge, however I am not good with the clip tool, so it will be a while before I have an image. Just make sure it sticks, remember:
CARVING IS EVIL!!!!!! DON'T DO IT!!!!!!!!!!!!!!!!!!!!!!!
Hopefully I have gotten my point across! That concludes this tutorial - expect more tips shortly