Quick answer: Unreal GameInstanceSubsystems initialized in non-deterministic order, causing some to read from others that aren’t ready? Declare dependencies explicitly so the engine orders init.
A SaveGameSubsystem initializes before SettingsSubsystem; reading the save’s settings before SettingsSubsystem exists is a null deref.
Initialize Override
void USaveGameSubsystem::Initialize(FSubsystemCollectionBase& Collection) {
Collection.InitializeDependency(USettingsSubsystem::StaticClass());
Super::Initialize(Collection);
}InitializeDependency ensures the named subsystem is ready before yours. Engine builds the init DAG and orders accordingly.
Avoid Cyclic Deps
If A depends on B and B depends on A, init becomes ambiguous — refactor to extract shared state into a third subsystem.
ShouldCreateSubsystem
Override ShouldCreateSubsystem to conditionally enable. Useful for platform-specific subsystems — reduces unused initialization.
Deinitialize Mirror
Subsystems also deinitialize in reverse order. Resources A acquired from B are released before B itself goes down — consistent shutdown.
Verifying
Subsystems initialize in the expected order. No null derefs during early-game logic. Editor restart confirms deterministic behavior.
“Subsystem init order is non-deterministic by default. InitializeDependency makes it explicit.”
Document subsystem dependencies in the class header comment — the next dev to add a dependency knows the contract.