Factors That Cause Levels to Bog Down


Levels can become bogged down for a number of reasons. The first of these is high polygon counts in a scene. Even a simple empty room that has only walls, floor and ceiling can be made up of several hundred polygons. In order to apply lighting and tune the levels performance, the brushes that you make inside hammer are broken down, juggled around and reshaped by the ZHLT Compile Tools as it builds the in game .BSP file out of your .RMF, or .map file. As mentioned above, this process is one of the reasons why you canít edit a .BSP file in hammer. To measure the polygon counts in your game, you use the r_speeds 1 console command.


As a general guideline, the game designers for Half Life kept multiplayer levels to around 400 World Polygons (W Polly) in general on multiplayer levels and 500 -600 or so for single player levels where frame rate was not as vital. Itís important to perform some tests of your own on your target platform to develop your own standards.


Lighting a level via light mapping requires that large brushes be broken down into smaller chunks. This usually happens along texture boundaries. Thus, if you have a large room with a 64x64 floor texture, the floor may be broken up into dozens of 64x64 chunks when in the editor it is shown as a single brush. The reason this is done is to create the light map textures, which give the floor lighting. In the case of a moderately large room, this may add 200 polygons to the scene, but in some very large rooms it can add 400 or more polygons. Itís important to take that overhead into account.


There are ways to reduce this press somewhat. The first is to try to break up large spaces so that only some of the space is Visible at a time. The second, useful in outdoor areas without great ground detail, is to scale up the texture on the floor. Often, a 64x64 dirt texture looks acceptable if scaled up to 128x128. In some cases it even helps give a sense of scale to the outdoor room. Itís important to test this technique yourself and decide whether or not you like the result.


The second cause of high counts is complexity. Itís very hard to resist the urge to put every detail into your geometry instead of using textures to create detail. However, it is much more expensive to add detail using geometry than it is to imply detail through tricks of the eye, lighting and texturing. Avoid non-functional detail that can be added through textures like moulding /trim, curlicues, grooves and bumpy surfaces. A level designers art is figuring out how to imply detail. Ask your texture artists to build a grooved surface or the face of a curlicue-building ledge, and then apply that texture to a simple flat surface. Use as few sides as you can get away with on your columns and carefully consider how to build each shape with the fewest polygons.


Another typical cause of high counts is intersecting brushes. Every place where one brush touches another, the processor splits the touched brush in order to remove the hidden sections of each brush. However, this can drive counts up very significantly. A large, square room thatís normally lit would be subdivided into a simple grid of square brushes. If you place a square column in the middle of the room, the rooms still split along a square grid, since the splits around the base of the square column run parallel to the grid of splits made for lighting. However, if you put down a 12-sided column in the middle of the room, split lines run out from each of the 12 vertices that make up the base of the column. These lines disrupt the even pattern that existed before and scatter new brush splits throughout the room.


You can observe this by using the r_drawflat 1 and gl_wireframe 2 console commands.


The best way to avoid this problem is to carefully pre plan before adding details in areas where their effects will be drastic. Also, in many cases such as light fixtures and some columns, you can build your fixture and then move it 1 to 4 units away from the surface it would normally be touching. That prevents the split, and in many cases the player will never notice the difference. You must be careful using this technique, however. If you place a light in the right location, it will give away what youíve done since the lifted object wont cast a proper shadow.


Another issue that increases your polygon counts in a room is Visibility leaks. To explain, the computer and the player see the level in different ways. The player canít see anything thatís behind a solid wall or any solid surface. However, the computer always looks just a little bit ahead and pre draws some objects that may not yet be VISible to the player. This is for two reasons: One, the computer estimates cautiously when it decides what the player will be able to see. Two, the computer pre loads some geometry that it thinks the player may soon see in order to spread out the press of loading the polygons and textures.


This usually comes in the form of a wall or other fixture in the next room that adds to the poly counts in the current room. Sometimes the increase in counts makes very little sense. You can have a very small room without any real detail such as an entryway with the polygon counts of a much larger, more detailed room. If you look around in a room like this, you can almost always find either a hallway into another more detailed room or a leak to the outside of the level.