UE4 Lifecycle

Hi. need some help
I’ve been looking for help or a diagram on the Unreal Engine Lifecycle, specially I want to figure out what get’s created first so I can set game variables before I load my level and where I can store those settings.

I was trying to put them in the game mode but but doesn’t seem to work

any help is appreciated

thank you

Also looking for this

UGameInstance might be initiated ealier

Just keep in mind unlike GameMode, GameInstance is pernament as long as game runs.

If you want to dive deeper then explore UEngine and UGameEngine or/and UEditorEngine, inits:

https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp#L708
https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Engine/Private/GameEngine.cpp#L426
https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp#L562

UEngine is initiated after code modules are loaded so it usally unavable on module startup. UGameEnigne is obviuesly standalone exlusive portion of the code and UEditorEngine is editor exlusive.

You can actully override UGameEngine and UEditorEngine (as well as UUnrealEdEngine) by changeing thoswe varables in engine.ini:

GameEngine=/Script/Engine.GameEngine
EditorEngine=/Script/UnrealEd.EditorEngine