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.
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 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.
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
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.
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.
This will unhide the bounding boxes of the terrain. This is useful to set up the beginning of the process of making the map.
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
This section provides information on some useful techniques and tools for console optimization.