Unreal Engine: content and performance¶
Asset loading, memory, garbage collection, profiling, large worlds, content validation and localization. Materials, shaders and scalability are in Rendering and shaders, and frame budgets are in Game development.
Entries are sorted by score from 1 to 10 (criteria): 9โ10 start here or strongly recommended, 6โ8 recommended, 1โ5 further reading or conditional.
Adopted references¶
- 7 Asset Management: the Asset Manager, primary and secondary assets, asset bundles, and cooking and chunking.
- 7 Common Memory and CPU Performance Considerations (Unreal Engine documentation): the baseline for gameplay performance. Garbage collection, object pooling, Tick versus timers and callbacks, asynchronous and parallel work, and shader compilation hitches.
- 6 Introduction to Performance Profiling and Configuration (Unreal Engine documentation): the profiling workflow, frame budgets and the profiling tools.
Key rules¶
Loading, memory and profiling¶
- 8
UNREAL-10Reference assets that aren't always needed with soft references (TSoftObjectPtr,TSoftClassPtr), and load them asynchronously. A hard reference loads its target whenever the object that holds it loads, and chains of them can load most of a game at startup. (Referencing Assets, Asynchronous Asset Loading) - 8
UNREAL-11Profile early and often on the target hardware, with Unreal Insights. The editor is no substitute for the device. (Introduction to Performance Profiling and Configuration, Unreal Insights) - 6
UNREAL-12Register the content you load on demand, such as levels and data assets, as primary assets with the Asset Manager, and use asset bundles to control which secondary assets load with them. (Asset Management) - 6
UNREAL-32Keep garbage-collection hitches out of gameplay: pool Actors that are spawned and destroyed often when the CPU budget is tight, and collect garbage manually where a spike is tolerable, such as behind a loading screen. Collection spikes are worst after many objects have been destroyed. Otherwise rely on the automatic collector, and tune its settings only when profiling shows the need. This appliesGAMEDEV-13. (Unreal Engine, Common Memory and CPU Performance Considerations) - 6
UNREAL-33Find out what an asset pulls into memory with the Reference Viewer and its Size Map, and track memory at run time on each target platform with the Low-Level Memory Tracker and Memory Insights. The Reference Viewer shows hard and soft references separately, and Memory Insights finds leaks and growth between two points in time, for example across a level transition. (Unreal Engine, Reference Viewer, Low-Level Memory Tracker, Memory Insights) - 5
UNREAL-34Build large open worlds with World Partition, which stores the world in one level divided into grid cells and streams the cells by distance, instead of dividing the map into sublevels and streaming them by hand. (Unreal Engine, World Partition)
Content validation¶
- 6
UNREAL-13Turn content rules, such as naming conventions and size or performance budgets, into Data Validation rules, and run theDataValidationcommandlet in CI. (Data Validation)
Localization¶
- 7
UNREAL-16Keep all user-facing text inFText, created from text properties in assets,LOCTEXTmacros in C++ or String Tables, and build messages withFText::Formatand itsplural,ordinalandgenderargument modifiers. Gather, export, import and compile the text with the Localization Dashboard, and give translators the exported PO files rather than the built-in Translation Editor. This appliesI18N-1,I18N-2andI18N-3. (Unreal Engine, Text Localization, Localization Tools, Localization Overview)
How to enforce¶
Tools that check the key rules above automatically, in CI, the IDE or a commit hook. "Partly" means the tool covers only some of what the rule asks.
- 7 Data Validation commandlet:
UnrealEditor-Cmd <Project>.uproject -run=DataValidationruns the project's validation rules over its assets in CI: C++ rules by default, and Blueprint and Python rules once you enable them. The editor also runs them when an asset is saved. ChecksUNREAL-13.