Level Optimization For Consoles

Overview

This article covers suggested performance targets for consoles as well as tips and features on how to get the most of of CRYENGINE for consoles.

Recommended targets for consoles:

  • Memory limit for the Xbox 360 is 512mb.
  • Drawcalls: 2000
  • Triangles: 1,000,000

SaveLevelStats - Saves data from the level. This can be run either from Sandbox (Tools -> SaveLevelStats) or via CVar of the same title in Launcher. A level designer may not be a specialist as to how big assets should be memory-wise, or if the texture is too big, but if something looks suspiciously heavy compared to other similar items then they can ask an artist or somebody that created the asset if it's correct and make adjustments. Maybe someone checked in a texture that was not rescaled or an unoptimized asset, this tool will print the information that will help you find it.

r_displayinfo 1 - Allows you to see memory consumption, frame rate, triangle count and drawcall count.

r_DisplayInfo
DUMPTODISK, RESTRICTEDMODE

Toggles debugging information display.
Usage: r_DisplayInfo [0=off/1=show/2=enhanced]

Drawcalls

Every object that has to be rendered produces a drawcall or drawcalls depending on the amount of materials it uses. Shadows also generate drawcalls. The fewer drawcalls the better.

To improve drawcalls, you can use simpler materials or lower view distances for the object so that less of them are rendered.

  • The limit of 2000 drawcalls forces you to make levels in a way that distant views are not expensive. If you use assets that are combined with lots of small fake objects such as X trees for places where you can not ever reach, it will make vista views possible to achieve.
  • Long distance views through the gameplay area will of course be heavier because for gameplay areas you use individual ungrouped objects because they need to be adjusted for gameplay.
  • Moving a tree by 1 meter will affect gameplay, so it would be also expensive and uninteractive to use grouped tree assets for a level designer to work with.
  • The Default value for vegetation view distances is 7 (e_ViewDistRatioVegetation). Big breaking long distance view obstacles can be placed to hide annoying tree popping.

Occlusion

Occlusion is a feature that makes the renderer deal only with the content of the scene to be rendered in the front, closest to camera point of view.

Usage of Occluders:

  • Model terrain in a way that it covers meshes. This will prevent them from rendering.
  • Place big objects with proper occlusion proxy.
  • Plan occlusion of the terrain even before doing a whitebox level, so it will be easier to beautify the level in the future.
  • Make sure that the bounding box with content of the map is completely covered by occlusion. If something sticks out even a pixel it will be rendered.

Triangle Count

You can go up to 1 million triangles from the code perspective and it's still okay. But of course less is better, and around 700,000 is really okay. This of course depends also on the frame rate.

If you have 40 or 50 FPS and 1.3 million triangles, than it is not actually a performance issue.

Lowering triangle count:

  • Use occlusion and LOD ratio of assets.
  • Draw distance of assets. It doesn't make sense to render a small bush that is far away and covered with 10 trees already.
  • At the moment, sprites are not cheap and actually level designers need to find the right balance between making asset to be rendered as a mesh or sprite. Sometimes a mesh is cheaper than a sprite even if it generates additional triangles and drawcalls. In theory sprites should be the cheapest way to have content, but they are not.

Console Commands for Beautification

Details like small vegetation, rocks and other small assets should only be placed where they are visible to the player, as if the shadow is too deep it doesn't really make sense to waste time and resources to make it detailed. If you have a dense forest and you can have light falling from among trees onto the ground and by coincidence there are some decals, a bench, or whatever eye candy you can think of, it will make the player concentrate on this one spot and forget about other ones that don't look as good. Put more details where you can see them and less where you can't.

r_wireframe 1 or 2

1 shows the wireframe and 2 shows vertices. This is the easiest way to get an idea of if there is too much on the screen. The darker it is the more content it contains. You can also access the wireframe and point mode

e_CameraFreeze 1

e_CameraFreeze

Freeze 3dengine camera (good to debug object culling and LOD).
The view frustum is drawn in write frame.
 0 = off
 1 = activated

Useful debug tool to help level designers actually see what is rendered from the camera's point of view and what is correctly occluded and what is not correctly occluded.

profile 1

profile

Allows CPU profiling
Usage: profile #
Where # sets the profiling to:
	0: Profiling off
	1: Self Time
	2: Hierarchical Time
	3: Extended Self Time
	4: Extended Hierarchical Time
	5: Peaks Time
	6: Subsystem Info
	7: Calls Numbers
	8: Standard Deviation
	9: Memory Allocation
	10: Memory Allocation (Bytes)
	11: Stalls
	-1: Profiling enabled, but not displayed
Default is 0 (off)

This can be a complicated tool, and most of the functions are useful mostly for programmers, but if there are some options that can show you which areas are harming your framerate in useful groupings such as Vegetation, AI, etc.

e_TerrainBBoxes

e_TerrainBBoxes

Show terrain nodes bboxes

This will unhide the bounding boxes of the terrain. This is useful to set up the beginning of the process of making the map.

e_defaultmaterial 1

e_DefaultMaterial

use gray illumination as default

Sometimes it's good to check if materials/shaders/drawcalls are not bottlenecks. This mode replaces all materials with simple red replace me textures.

e_DebugDraw 1, 2, 3, and 4

e_DebugDraw

Draw helpers with information for each object (same number negative hides the text)
 1: Name of the used cgf, polycount, used LOD
 2: Color coded polygon count
 3: Show color coded LODs count, flashing color indicates no Lod
 4: Display object texture memory usage
 5: Display color coded number of render materials
 6: Display ambient color
 7: Display tri count, number of render materials, texture memory
 8: RenderWorld statistics (with view cones)
 9: RenderWorld statistics (with view cones without lights)
10: Render geometry with simple lines and triangles
11: Render occlusion geometry additionally
12: Render occlusion geometry without render geometry
13: Display occlusion amount (used during AO computations). Warning: can take a long time to calculate, depending on level size! 
15: Display helpers
16: Display debug gun
17: Streaming info (buffer sizes)
18: Streaming info (required streaming speed)
19: Physics proxy triangle count
20: Display object instant texture memory usage
21: Display animated object distance to camera
22: Display object's current LOD vertex count