Sunday, July 10, 2011

Map optimization Part 3

In the last part, you learned how does vis work and how it influences your map design. This tutorial is divided in three parts to quickly show you how to optimize maps.

Visleafs

You know how vis leaf work but used properly, you can add a lot of details without hindering the r_speeds of your map.

    The portion of the map where the two teams meet is the encounter spot. It is also called an arena. Make your map keeping the arena in focus. Don't litter the arena with useless details. This is because the arena usually has the highest r_speeds. The connecting corridors should block off the arena visleafs. This will significantly reduce the r_speeds. A modular yet detailed geometry plays a great part here.

Textures


While making a map, add only 4-6 wad files if possible. This is because the compile process takes a certain(4-8 mb) video ram as texture cache. 8 mb seems less but it can impact the performance of your map. There is also a command line parameter to change the value but more about that later.

    Also, stretch the textures in your map where there are open areas. In gl_wireframe mode, you can clearly see the divisions the textures make. If done properly, stretched textures can decrease r_speeds by about 20%.

    But the best you can do to optimize your map is to use the null texture. The null texture is located in a wad file in your zhlt folder. Applying this texture on a brush simply renders it invisible. This texture also blocks vis so you can use it everywhere. A good technique would be to use the null texture while making your map. When you have made the brushwork, just paint all the visible null textures with the proper textures. 

Brushwork

Brushwork is the single most important factor in reducing r_speeds. Here, we take a look a some popular techniques to reduce r_speeds.

1.  Always leave a 1 unit gap between furnitures and the floor. This will ensure the solid won't divide the texture. Go to gl_wireframe mode and see the textures. They are divided by the solid brushwork. Leaving a 1 unit gap will ensure they won't divide the texture. This technique is useful for light fixtures as the lighting looks bad on the fixture. Leaving a gap fixes this. 
    Beware of leaks while doing this. As a precaution, apply this technique after making you map.

2.  Optimize complex geometry. For example, while dividing a brush to make a gap, don't make more sub brushes then intended. For eg:
The average mapper generates 8 brushes while the pro mapper generates only 4 brushes. That is the half of what the average mapper generates.
Another example:
While making a ramp, see whether it is a single brush. If not then delete the ramp and drag the vertice of the box to make a ramp.

3.  You must have heard everyone preach not to overlap brushes. They are right but sometimes, you have to make an exception. For example, while making a railing, you need to overlap the horizontal brush. That is okay because the couple of brushes you are making are better at wasting r_speeds than doubling the brush count by clipping them. Its a bit like "the lesser of the two evils"

4.  Also while making walls, make sure they are lined up correctly. See this screenshot to get a better idea:
See the end vertices. They reduce the r_speeds because by using this method, the texture on the side of the wall is saved by not getting rendered. Not only is this useful for saving r_speeds, sometimes you will need it to make good looking frames. See the left view. The trim texture is lined up properly.

No comments:

Post a Comment

Post your views here