Thursday, April 21, 2011

Map optimization part 1

Introduction to optimization.

Optimization is important in this age even if your computer can easily run huge cs maps without any lagg. In cs, optimization is important because as a level designer, you can't rely on everyone have a good configuration. Also, good optimization can also reduce the network load.

    Skip the next part if you don't like history.

A bit of history

Back in the day when half-life was like crysis and the year was 1998, map developers for valve had a limit of 600 r_speeds. The technical limit was 800 r_speeds after which the game would crash in a certain video mode. Of course, now any pc without a graphic card can easily handle 4000> r_speeds and even then it won't really matter to the processor as the goldsrc engine wasn't optimized for dual core processors.

    The goldsrc graphic engine itself was made from the quake 2 engine and optimized but the reason why half-life won so many awards was because of good gameplay and storytelling techniques, not graphics. In 1999, a couple of modders released counter-strike. In only 1 week, they got 10,000 downloads. Initially, only the hostage rescue mode was available but soon afterwards they updated the game, added more weapons, more player models, maps and other game modes. Within a short time, the community started making maps using the cs fgd. The 1.6 version released in 2004 when the modders decided that they will no longer update the game. During this time, the aim for mappers was a maximum r_speeds of 800. Pretty soon, that became the community standard for maps.

Some useful commands

Load a map and type r_speeds 1 in the console. Four numbers should pop up like this:
See the wpoly number? That shows how much is being rendered on screen. The epoly number shows the model polygons being rendered. This command is useful for measuring how much optimized your map is.
To turn it off, simply type r_speeds 0 in the console.

Another good command is the gl_wireframe 2 command. Type it in the console and every brush and the texture on it will be seen with a white outline. With this, you can see what the graphic engine is rendering.

Some quick tips

When making a map, don't intersect brushes over each other because they will be rendered even if you can't see the brush.

Stretch textures which are used as floor, grass or big buildings because they tile a lot and can impact the r_speeds.

If you have made any furniture then leave a gap of 1 unit between the floor and the furniture. To see why, turn gl_wireframe 2 on before leaving a gap and after leaving the gap. I will explain this in the next tutorial.

No comments:

Post a Comment

Post your views here