Course contentsShow
← Unreal Engine Game Development
Lesson 824 of 88011. Performance Profiling and OptimizationFree lesson

Managing Platform-Specific Asset Cooking

Define custom cook rules to ensure that high-fidelity assets are excluded from mobile builds while remaining available for PC and console.

In this lesson, you will learn how to reduce the footprint of your mobile builds by using custom cook rules to exclude high-fidelity assets that are only required for PC and console platforms.

Why Exclude Assets at Cook-Time?

When you deploy a project to multiple platforms, Unreal Engine defaults to including all assets referenced in your project. However, mobile devices have strict memory constraints and smaller storage capacities. If you have 8K textures or high-poly source meshes used in your PC build, including them in a mobile APK or IPA is not only a waste of space—it can cause the build to exceed deployment limits or lead to unnecessary memory pressure.

Implementing Custom Cook Rules

To exclude specific assets, we use the Primary Asset Label system or specific Cook Rules defined in the Project Settings. The most direct approach is to leverage Asset Manager and Primary Asset Labels.

You can create a PrimaryAssetLabel data asset, add your high-fidelity assets to its "Assets" list, and set the "Cook Rule" to exclude them for specific platforms. Alternatively, you can use the DefaultEditor.ini to define cook filters.

To exclude a folder of high-fidelity assets from a mobile build specifically, you can add an entry to your project's DefaultGame.ini under the [DedicatedServer] or specific platform sections, but the cleanest way is often using Cook Filters in your DefaultEditor.ini:

[/Script/UnrealEd.ProjectPackagingSettings]
+ExcludedFolders=(Path="Game/HighFidelityAssets")

However, for platform-specific control, wrap your assets in a Data Asset or Primary Asset Label and use the "Cook Rule" setting inside that asset. Set the "Cook Rule" to NeverCook for target platforms like Android or iOS, while keeping it as AlwaysCook for Windows or PS5.

By defining these rules, the Unreal Cooker reads the metadata during the packaging process and skips any asset marked for exclusion on the target platform. This ensures your mobile binary remains lean without requiring you to manually move files out of the project folder.

Key Takeaway: Use Primary Asset Labels or project-level Cook Rules to instruct the Unreal Cooker to strip platform-incompatible high-fidelity assets, ensuring your mobile builds remain optimized and within storage limits.