Chapter 09

Asset Management

Primary and Secondary assets, the Streamable Manager, reference-counted handles, and loading only the slice you need with Asset Bundles.

In this chapter

  1. The Problem
  2. Primary vs. Secondary Assets
  3. The Machinery
  4. Asset Bundles
  5. Workflow
1

The Problem

Games have far more content than fits in memory, so something must decide what to load, when, and when to free it. That's the Asset Manager.

Unreal does a lot of this automatically. The Asset Manager is for when you want explicit control, plus disk and memory auditing.


2

Primary vs. Secondary Assets

A Primary Asset is a recipe you request by name. Secondary Assets are the ingredients that come along with it.

Two flavors of custom Primary Asset

FlavorUse whenTrade-off
Blueprint classYou need to spawn instances, or want inheritanceMore flexible, less memory-efficient
Data AssetYou just hold dataSimpler to access in code and lighter. It's an instance, which is why you can't inherit from it

The rule: need inheritance or spawning → Blueprint. Just storing data → Data Asset.


3

The Machinery

Loading uses reference counting — Load increments, Unload decrements — and the garbage collector reclaims the memory on its next pass once the count hits zero.

So "unload" releases a reference; it doesn't instantly free bytes. If you're watching a memory graph expecting an immediate drop, you won't see one until GC runs.

4

Asset Bundles

An Asset Bundle is a named subset of a Primary Asset's Secondary Assets that you can load as a group. It's built on soft references (TSoftObjectPtr) — paths that cost nothing until resolved (Chapter 7).


5

Workflow

  1. Optionally, register a custom Asset Manager via DefaultEngine.ini.
  2. Register your Primary Assets — Project Settings → Asset Manager, pointing it at folders to scan, or in code.
  3. Load and unload with LoadPrimaryAsset / UnloadPrimaryAsset, optionally specifying bundles.
Chapter 10 covers Game Features, which automate step 3 — you set a feature's state and it orchestrates the bundle loading for you, instead of scattering load calls through your code.
← Chapter 8 ↑ Index Chapter 10 →