In this lesson, you will learn how to automate performance-critical console variable (CVar) configurations during engine initialization to ensure each target platform adheres to your specific optimization budget.
The Problem: One Size Does Not Fit All
While Unreal Engine’s default scalability settings are useful, they are rarely sufficient for high-end production. You often need to enforce specific hardware-level constraints—such as disabling expensive features on mobile or forcing higher shadow cache limits on consoles—before the game even finishes loading the first frame. Relying on manually executing commands or DefaultGameUserSettings.ini is error-prone; instead, we use Platform-Specific CVar Presets.
Implementing via BaseScalability.ini and PlatformScalability.ini
The most robust way to enforce these configurations is through the [ConsoleVariables] section within the engine’s configuration hierarchy. By using platform-specific overrides (like Windows/WindowsScalability.ini or Android/AndroidScalability.ini), you can inject mandatory CVars during the engine's early startup phase.
For example, to enforce strict memory budgets for texture streaming and shadow map caching on an Android device, you might define the following in your AndroidScalability.ini:
[ConsoleVariables]
r.Streaming.PoolSize=1024
r.Shadow.MaxResolution=1024
r.Mobile.DisableVertexFog=1
Why Use Presets Over Runtime Logic?
By placing these in initialization files rather than executing them via ExecuteConsoleCommand in Blueprints or C++, you ensure that the engine's renderer, memory allocator, and texture streamer are configured before any scene data is processed. This prevents "pop-in" or frame-rate hitches caused by changing settings after the renderer has already initialized.
Furthermore, these files are baked into the build process, meaning your platform-specific constraints are guaranteed to be active as soon as the application process starts, providing a stable baseline for your profiling efforts. This approach effectively decouples your "performance profile" from the "gameplay logic," allowing your engineering team to iterate on performance targets without touching the game code.
Key Takeaway: Leverage platform-specific Scalability.ini files to bake CVar presets into your project, ensuring consistent, optimized hardware utilization from the moment of engine initialization.