Use this document as a general set of performance guidelines for creating assets for use in CRYENGINE. By following the tips included below, artists will better understand how to create assets, with the performance in mind.
Typically, objects that are always on screen go through a lot of iterations and need to have a higher visual quality than the other assets. This also means that these objects need to be as performance friendly as possible. You will need to review all the characters and weapons with this in mind.
In addition, AI and particle effects play an important role. These things tend to turn heavy areas into areas with severe performance problems. Thus, it is important to identify these areas first and make all their related art assets as performance friendly as possible.
If you want to hit a specific frame rate, the total amount of vertices and texture space on screen at the same time needs to be consistent for every level. Given the budget that a developer chooses, there needs to be a difference in scene complexity between heavily occluded indoor environments that could use portals, and more un-occluded outdoor environments. The smaller the visibility, the more detail you can put in the level.
Some techniques to make sure you reach the performance goals from the level design side are:
Taking these into account and adjusting some of these numbers, we can arrive at a breakdown even it is quite broad it will give a general idea.
Keep in mind that the DP's (drawpoints/drawcalls) were deliberately kept below 2000 to allow a bit of breathing room for gameplay action firing effects and additional polishing:
Object | Triangles | Drawcalls |
---|---|---|
Terrain | 50000 | 80 |
Particles | 2000 | 100 |
Roads | 30000 | 120 |
Decals | 20000 | 80 |
Veg | 40000 | 200 |
Brushes | 600000 | 1000 |
Entities | 300000 | 320 |
FP Character | 75000 | 40 |
TOTAL | 1042000 | 1940 |
There are ways to improve CPU performance by using fewer draw calls. Do this by using fewer materials, attachments, sprites (instead of LODs), lights (more objects combined on one texture), decals, and shadow casting lights.
Some additional guidelines for improving the CPU performance are:
The following recommendations help improve GPU performance, regardless of the screen resolution:
The following recommendations help improve the GPU performance, dependent on the screen resolution.
To improve texture streaming, follow these guidelines:
This section includes general tips for improving the performance.
This section deals with the performance-oriented asset and level design setup of very large meshes, such as buildings.
Large objects, like buildings, should be split up in a way that enables them to be rendered efficiently in standard gameplay situations. This means that the lower part of a skyscraper, an area the player interacts with and which usually lies in your viewing angle when looking straight ahead, should be in a different CGF than the upper part of the building, which the player only sees when looking straight up. Big, complex parts of a building that are out of sight in the normal way you play a level, such as a building that can only be seen from one side when approached through a street, should always be detached and not be part of the main mesh.
This also helps effective LOD'ing, since the engine decides the LOD level of an object based on it's distance to the camera and size of its bounding box. Very large meshes are switching LOD's much later smaller ones. The effectiveness of occlusion culling is also greatly enhanced by this.
For this reason, it's sometimes beneficial to split off certain parts of a building and adjust the LOD ratio. Initially, the game might have to process more drawcalls if you do this, but this is compensated by the more effective culling and LOD'ing that becomes possible with such an approach.
Some practical tips on working in such a way are:
Every object with a different material has to be drawn in a separate drawcall. Each drawcall adds some overhead / slowdown to the engine. At any given point of view in the level, there should never be more than 2000 drawcalls.
Several examples for reducing the number of draw calls:
The following list details how the number of drawcalls used is calculated:
The following are the material properties that add to the drawcall count:
Having less vertices will improve performance and reduce memory consumption. On some hardware like PS3 and older graphics cards, the cost of vertex processing is quite expensive.
A good physics proxy is very important for reducing CPU calculation time for physics. Without a physics proxy, performance would be too slow.
Always make LODs for each asset. Each LOD must reduce polygon count at least by 50%. For each LOD, do not only reduce the polygon count, but try reducing the number of materials as well. Good LOD's are key to getting good performance (less vertices to process, less materials / drawcalls etc. will improve performance a lot).
Good LOD's are key for getting good performance (less vertices to process, less materials / draw calls etc. will improve performance a lot). If you create good LOD's, you could get away with better looking assets and better performance.
In outdoor games, vegetation is usually the most expensive part of the level due to the fact that natural levels are populated with many trees.
Make particle effects as effective as possible, as they create a huge amount of overdraw and thus have a big effect on performance. Also, place standing particle effects as early as possible in order to get a feeling for the performance impact.