DGUnreal Home

Site

Home


 

Unreal Tournament III Tips
This information is provided by DGUnreal.  Please do not copy this and post it elsewhere.

Note: I am still completing this page.


Optimization

- Checking Statistics
- Using Smart Design
- Optimizing CSG Surface Materials
- Removing CSG Surfaces
- Optimizing CSG and StaticMesh Lightmap Size
- Removing StaticMeshes from Occlusion Tests
- Using CullDistanceVolumes
- Optimizing Terrain

Also see the tips for CSG, Lightmaps, Lightmaps versus Vertex, Materials, StaticMeshes, and Terrain for additional relevant information.



Checking Statistics

Console commands are entered in the game by pressing the [Tab] key and typing in the command.  Do not include the quotes.

Stat FPS

The console command for displaying the frames per second is "stat fps".
Note that this technically is not the frames per second that are displayed on your monitor.  This value is simply the conversion calculation from the Frame Time in milliseconds.  The frame time is how many milliseconds are required to perform the rendering and other engine chores for the current scene.  It is simply more relevant to see this value as something meaningful such as 125 fps instead of 8 ms.

Stat Engine

The console command for displaying the engine frame time is "stat engine".
This displays a set of values including the total number of rendered Terrain triangles, total rendered StaticMesh triangles, in addition to Shadow Volume, Skeletal, Decal, Foliage and other engine areas.  The bottom item on the upper group is the FrameTime in ms.

Stat SceneRendering

DrawPrimitives should be no more than 1500 to 2500.
StaticMeshes that are composed of multiple Materials are split into a separate Draw Call for each Material.

Stat Collision

Stat Game

Stat Memory

Stat Streaming

"Texture Pool Size" is the fixed size of the allocated texture memory pool.   All textures are allocated from this block of memory, and it will never grow or shrink.

"Texture memory used" is how much of the texture memory pool is currently occupied by texture data.  The remainder is available for more textures to be loaded.

Stat FPSChart


The lightmap usage should also be checked on a map, and is found in the Editor on the Generic Browser's Primitive Stats tab.  The column in question is Lightmap (kbytes).   The Combined Total for this value should be limited to a value reasonable for the target computer hardware.


Show Commands

Show Portals
Show StaticMeshes
Show BSP
Show Terrain
Show Foliage
Show DynamicShadows
Show UnlitTranslucency


Building Lighting

If your map is showing the "LIGHTING NEEDS TO BE REBUILT" warning in the Play-in-Editor or in-game, the performance will be worse.


Using Smart Design

The most important optimization technique is simply good map design.

If a map has a far view distance, then the number of StaticMesh objects must be fewer or they must be of lower triangle count.

Scene object occlusion should be considered when the map layout is being designed.
For example, an indoor map that has a hallway that looks directly into three highly decorated rooms may have issues with performance due to the number of objects rendered.   A better design would be to have corners in the hallway so that only one room is ever visible at any one time.



Optimizing CSG Surface Materials

completed soon...



Removing CSG Surfaces

As a general rule, do not use CSG surface removal.  A well designed map will usually not benefit from it, and there is the danger of incorrect usage which will actually remove a good occlusion surface and cause a dramatic decrease in performance.   However, there are exceptions, such as the non-visible outside cube of an indoor map or maps that use high amounts of CSG that are not visible from the play area.  In these cases there may be some minor improvement, however, the time and effort to test this is usually offset by simply changing the map design itself to be more optimal.

CSG (Constructive Solid Geometry) is one of the world geometry systems used in the Unreal Engine.  The advantage of CSG is that it can be quickly created, revised and edited.   The disadvantage is that it renders slower than StaticMeshes and has limits on its complexity and design.

Before discussing CSG surface removal, we should establish what exactly is a CSG surface.

CSG is a method of using simple primitive shapes that are booleaned against each other to form a final 3D geometric complex shape.  The simple primitive shapes in UnrealEd are the various Add and Subtract brushes that are available in cube, cone, cylinder, plane and sphere shapes.  When viewed in Brush Wireframe mode, these primitives are shown as a collection of blue and yellow brush shapes for Add and Subtract respectively.  When constructed into the final complex shape by clicking on the Build toolbar button, a set of triangles are created that form the final 3D geometric complex shape.  This can be seen in Wireframe mode as a set of white triangles.

A "surface" is each individual planar section of a brush that is used in the final 3D geometric complex shape and can be selected in the editor.  When viewed in Wireframe mode, one surface may actually be composed of multiple triangles.
Selecting a surface allows for various properties to be set including material and lightmap resolution.  These properties are then applied to all triangles that compose that one surface.

In game engines, keeping the total scene triangle count at a lower number has a performance benefit.  Therefore, being able to remove unneccessary CSG surfaces may provide a performance improvement.

Individual CSG surfaces can be removed from rendering by applying the EngineMaterials.RemoveSurfaceMaterial material.  This is a low-impact black material that still renders the applied surfaces visible in the Editor and the Play-In-Editor, however, within the game the surfaces with this material are not rendered and all of their triangles are hidden.

This feature is useful for cases where a CSG surface such as a wall is completely overlayed with StaticMeshes.  Removing CSG surfaces will hide those surface triangles, possibly improving framerate.  However, if there is even a slight spacing in any of the wall StaticMeshes, without the CSG surface behind them to act as a master occluder, objects behind the wall may also render and cause a drop in performance.

Since these CSG surfaces with the RemoveSurfaceMaterial applied to them are not rendered, they will also not provide occlusion.  Also, since the Editor and Play-In-Editor actually render the surfaces where RemoveSurfaceMaterial is applied, you cannot use the Editor Occlusion function to test the occlusion validity.  So care must be taken in choosing any appropriate surfaces to remove from rendering.

In most cases, even with successfully chosen CSG surfaces to remove, the total number of triangles removed from rendering is usually not significant enough to make a large difference in performance and framerate.

For a real-world example, the UT3 map DM-Deck has a number of CSG surfaces with the RemoveSurfaceMaterial applied.  The total number of triangles that this material is applied to is 2,836.  The map has a total instanced triangle count of 2,405,811, and commonly renders between 200,000 and 800,000 StaticMesh triangles at any one time in the frustum in-game.  The removed CSG surface triangles are a mere 1/1000th of the map total.  A common single StaticMesh can easily be 2,800 triangles.  It is highly unlikely that adding one 2,800 triangle mesh would push a map over the edge into poor performance.  So the savings are in most cases extremely small.

If a map is suffering from performance issues, other techniques should be chosen prior to relying on the CSG surface removal as a method for performance improvement.  CSG surface removal should only be used if the map is suffering performance issues and a hope that multiple cumulative tweaks will cause enough of a performance gain to make the map play acceptably.



Optimizing CSG and StaticMesh Lightmap Size

completed soon...



Removing StaticMeshes from Occlusion Tests

As a general rule, do not set bUseAsOccluder to false on standard StaticMeshes.   Leave it at the default value of checked (enabled).

Each inserted StaticMesh instance has a property that determines whether it is used in the occlusion tests.  The occlusion tests are to determine if a StaticMesh can be used to occlude scene objects that are located behind it.  StaticMeshes that are used as occluders are called occlusion masters.  This property, called bUseAsOccluder, is located at:

StaticMeshActor.StaticMeshComponent.Rendering.bUseAsOccluder

The bUseAsOccluder property is not specifically designed to allow the level designer to choose which StaticMeshes are or are not included in the tests for occlusion masters.   The choice of occlusion masters occurs dynamically by the engine and requires no preparation or intercession by the level designer.

The bUseAsOccluder property is available in the engine to manage the specific case of InterpActors.  bUseAsOccluder should be unchecked for meshes that move in order that they do not get used as occlusion masters.

An example for this could be a train mesh with multiple train cars.  If the train were passing in front of the camera, and was set as an occluder, the meshes behind the cars would not be rendered.  But when each car passes by and the camera can see past the space between the cars, those meshes that were occluded would now visually pop back in to be rendered.  This would cause a visual problem as the meshes behind constantly flickered into the scene as each train car passed by.
By setting the train cars all to bUseAsOccluder = false, they would never occlude meshes behind them and those meshes would then never flicker on and off in visibility as the cars passed by.

In some cases with regular StaticMeshes it is possible to see a small mesh pop into view that is occluded behind another larger scene StaticMesh, such as perhaps a plant behind a large column.  In cases like this, setting the column's bUseAsOccluder to false in order to prevent the smaller mesh from popping into visibility may be an option.
Additional StaticMeshes that may benefit from being removed from the occlusion tests would include light cones since they are normally translucent anyway, and tiny detail meshes such as small light fixtures or control panels.

However, the dynamic occluder test occurs so quickly in the engine even with high scene StaticMesh numbers, that in almost all cases there is no benefit to manually attempting to remove StaticMeshes from the occluder test.  Removing a dozen StaticMeshes from a few hundred on a test that occurs in microseconds won't normally be noticeable in the total frame time.
And if a StaticMesh set to bUseAsOccluder = false actually had provided good occlusion, the overall performance can actually be degraded.  So this feature should only be used by level designers who fully understand the implications and impact of what they are doing.

Unless the current scene has many hundreds of tiny StaticMeshes, spending the time trying to remove individual StaticMeshes from the occlusion list is not worthwhile.  To manually perform this correctly requires a lot of trial and error testing to determine what StaticMeshes should be removed from the occlusion test.  And if the number of StaticMeshes removed from the occlusion test is only a small number of the total in the scene, the percentage of performance improvement will most likely not be noticeable, especially since removal only relates to the very fast occlusion master test.



Using CullDistanceVolumes

completed soon...



Optimizing Terrain

completed soon...




0807.16 · 6958 page accesses · Copyright ©2008 David R. Green · All Rights Reserved.