Mostrando entradas con la etiqueta optimization. Mostrar todas las entradas
Mostrando entradas con la etiqueta optimization. Mostrar todas las entradas

jueves, 15 de agosto de 2013

Map optimization Part 3

type='html'>
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.

This post was made using the Auto Blogging Software from WebMagnates.org This line will not appear when posts are made after activating the software to full version.

miércoles, 14 de agosto de 2013

Map optimization part 1

type='html'>
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.

This post was made using the Auto Blogging Software from WebMagnates.org This line will not appear when posts are made after activating the software to full version.

Map optimization part 2

type='html'>
I will now show you what is vis leafs and how it will influence your map design.

While you play a linear design game like cs, call of duty, l4d2,etc every polygon on the map is not calculated. To shorten the load on the processor, only the polygons visible to the player is rendered and textured.
        But how can the game engine know which polygons are seen by the player
When you compile your map, it runs through 4 processes; bsp, csg, vis and rad. During the vis process, the area visible by the player will be calculated.

2 Rooms are conected by a corridor. The player is standing on the blue circle. From his viewpoint, he can see about 1/3 portion of the other room. But if you test this map and turn gl_wireframe 2, you will see the entire room being rendered. To fix this, I am taking another example.


The rooms being rendered are shown by an orange outline. The small room on the southeast corner is not actually being rendered but if the corridor is placed further north and the viewpoint shifts to the north, the room will get rendered. Partly because the corridor joining the small room is too small to qualify as a room itself. To improve this, we will modify our layout a bit.
This time, only the room in which the player is standing and the corridor is rendered. To apply this to a practical layout, see this picture.
See the corridors ending in an angle. Not only do they block the visleaf but they also juice up the design. One particularly interesting area is the room east of the ct spawn. The corridor ends in a room and the door is located north and is fully blocking the visleafs.

    So the moral of the story is to make well planned maps. Any large, highly detailed open world map in cs won't post good r_speeds because of visleafs. On another note, you can use the the hint texture with the skip texture to manually create a break in visleafs but only as a last resort. I will post more about special textures later.

This post was made using the Auto Blogging Software from WebMagnates.org This line will not appear when posts are made after activating the software to full version.

lunes, 5 de agosto de 2013

Map optimization Part 3

type='html'>
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.

Map optimization part 2

type='html'>
I will now show you what is vis leafs and how it will influence your map design.

While you play a linear design game like cs, call of duty, l4d2,etc every polygon on the map is not calculated. To shorten the load on the processor, only the polygons visible to the player is rendered and textured.
        But how can the game engine know which polygons are seen by the player
When you compile your map, it runs through 4 processes; bsp, csg, vis and rad. During the vis process, the area visible by the player will be calculated.

2 Rooms are conected by a corridor. The player is standing on the blue circle. From his viewpoint, he can see about 1/3 portion of the other room. But if you test this map and turn gl_wireframe 2, you will see the entire room being rendered. To fix this, I am taking another example.


The rooms being rendered are shown by an orange outline. The small room on the southeast corner is not actually being rendered but if the corridor is placed further north and the viewpoint shifts to the north, the room will get rendered. Partly because the corridor joining the small room is too small to qualify as a room itself. To improve this, we will modify our layout a bit.
This time, only the room in which the player is standing and the corridor is rendered. To apply this to a practical layout, see this picture.
See the corridors ending in an angle. Not only do they block the visleaf but they also juice up the design. One particularly interesting area is the room east of the ct spawn. The corridor ends in a room and the door is located north and is fully blocking the visleafs.

    So the moral of the story is to make well planned maps. Any large, highly detailed open world map in cs won't post good r_speeds because of visleafs. On another note, you can use the the hint texture with the skip texture to manually create a break in visleafs but only as a last resort. I will post more about special textures later.

sábado, 3 de agosto de 2013

Map optimization part 1

type='html'>
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.