Basic Cinematic Optimization and Profiling

Overview

Cinematic Optimization Guidelines

  • Always try and use AnimObjects for characters or entities that require animation.
  • These entities are the lightest for performance and include all the functionality required for cinematic characters. They are located in the Objects panel of the RollupBar under Entity -> Physics -> AnimObject.
  • Occasionally a Rigid Body Ex will be required for an object that interacts with the player, for example a lift that goes up and down moving the player with it.
  • Do not use Geom Entities for characters and vehicles, they cost large amounts of extra frame time and don't have important parameters required that the AnimObject includes.
  • Basic Entities should be used for entities that are static like a brush but need to be updated simply with position or rotation movement or hidden and unhidden.
  • It's important to make sure the entity being used has its flags set correctly. With most entities the "Pushable By Player" and "Rigid Body" should be disabled – this is important as "Rigid Body" being left enabled chews the frame rate!
  • All entities should generally be hidden on start, all particles and sounds should all be disabled in general as well, this will stop random sounds and frame drops on launching.
  • Entities can then be unhidden on the first frame in the trackview and hidden again on the last frame, depending on whether the asset is required further. Don't hide/unhide entities through the Flowgraph as this makes it difficult to edit the sequence and leads to various bugs later in production.
  • Depth of Field (DoF) is your friend, in certain cases by utilising the DoF effect well, large background areas can be left relatively empty and geometry and textures crudely detailed as the DoF effect will hide any imperfections.
  • Care should also be taken with full-screen Image/HUD effects, try and avoid using multiple FX at the same time and make sure to always disable them afterwards!

Profiling the scene

r_displayinfo 3 – will give you basic performance information. It also gives you a big red warning when you exceed texture streaming memory!

p_profile_entities 1 – run your scene and look for fluctuations, any entity causing large peaks should be investigated.

r_stats 6 – run this to find assets with large draw calls or excessive materials, where shadows can be disabled etc.

r_stats 15 – prints detailed frame timings for specific render passes like static geometry or lighting. blue = in budget, red = over budget!

e_debugdraw 2 & 3 - 2 shows Polycount and 3 current LOD of selected entity.

e_CameraFreeze 1 - will lock your current view and allow you to look around without redrawing any elements. This allows you to see where the problems are and fix them.