Skip to content

Editor startup

Editor startup process#

C++
// Flow of the Editor startup process (Excerpt)
WinMain
  GuardedMain
    FEngineLoop::PreInit
      FEngineLoop::LoadCoreModules                      // CoreModuleのロード
      FEngineLoop::LoadPreInitModules                   // PreInitModuleのロード
      FEngineLoop::AppInit
      UDeviceProfileManager::InitializeCVarsForActiveDeviceProfile          // DeviceProfile Cvarのロード
      InitEngineTextLocalization                                            // Engineローカライズ処理
        ApplyDefaultCultureSettings
          FInternationalization::SetCurrentLanguageAndLocale                // Language/Locale設定
        FTextLocalizationManager::LoadLocalizationResourcesForCulture       // ローカライズリソースロード
          FTextLocalizationManager::LoadLocalizationResourcesForPrioritizedCultures
            FTextLocalizationManager::UpdateFromLocalizations
      FWindowsPlatformSplash::Show                      // Splash表示
      FInternationalization::LoadAllCultureData
        FICUInternationalization::LoadAllCultureData
      FShaderCompilingManager::FShaderCompilingManager  // (1) ShaderCompileWorker起動
      CompileGlobalShaderMap                            // (2) GlobalShaderMapのコンパイル
      CreateMoviePlayer                                 // 起動用MoviePlayer生成
      InitGameTextLocalization                          //     Gameローカライズ処理
      FModuleManager::LoadModule                        // (3) AssetRegistryのロード
      ProcessNewlyLoadedUObjects                        // (4) UObject/Enum/Struct/Propertyの初期化と登録
      LoadStartupCoreModules                            // (5) StartupCoreModuleのロード
      FProjectManager::LoadModulesForProject            // (6) LoadingScreenModuleのロード
      FPluginManager::LoadModulesForEnabledPlugins
      FPlatformMisc::PlatformHandleSplashScreen         //     SplashScreen表示
      FEngineLoop::LoadStartupModules                   // (7) StartupModuleのロード
      FUObjectArray::CloseDisregardForGC                //     DisregardForGCのClose
        FHighResScreenshotConfig::Init                  // (8) HighResScreenshotMaterialの初期化
    EditorInit
      FEngineLoop::Init                                 // (9) EngineLoopの初期化
        UUnrealEdEngine::Init
          UEditorEngine::Init
            UEditorEngine::InitEditor
              UEngine::Init
                UEngine::InitializeHMDDevice            // Device初期化
                UEngine::InitializeEyeTrackingDevice
                UEditorEngine::InitializeObjectReferences
                UEngine::InitializeAudioDeviceManager
            UGameUserSettings::LoadSettings
            UGameUserSettings::ApplySettings
          LoadPackage                                   // EditorResourceロード
      FUnrealEdMisc::OnInit                             // (10) その他の初期化
        FEditorFileUtils::LoadDefaultMapAtStartup
          FEditorFileUtils::LoadMap                     // DefaultMapロード (詳細は3.章参照)
      UEngine::Start
        FWindowsPlatformSplash::Hide                    // Splash非表示

From https://qiita.com/donbutsu17/items/be66551c48360d7b0864

#ProgressWork
100-09

Load TargetPlatformModule Load

Target Platform Module

210-39

Load

shader (.usf) included in compiled Enigne content of GlobalShaderMap

340-44

Load AssetRegistry Load

all compiled properties (UStruct etc)

Four45-49Load resident object for DisregardForGC
Five50-59

Generation of LoadEngine

definition object of StartupCoreModule

660-69Loading Loading Screen Module
770-74

Generation of

object of load project definition of StartupModule

875-79Initialization of HighResScreenshotMaterial
980-89

Loading EngineLoop initialization

configuration file, etc.

Ten90-100Load other initialization boot map

From https://qiita.com/donbutsu17/items/be66551c48360d7b0864

LevelOpen processing#

C++
// Process flow when selecting Level asset from ContentBrowser by double-clicking (excerpt)
// ContentBrowserからLevelアセットをダブルクリックで選択した際の処理の流れ(抜粋)
SContentBrowser::OnAssetsActivated
  FAssetTypeActions_Base::AssetsActivated
    FAssetEditorManager::OpenEditorForAsset
      FEditorFileUtils::LoadMap                             // マップのロード開始
        UUnrealEdEngine::Exec
          UEditorEngine::Exec
            UEditorEngine::HandleMapCommand
              UEditorEngine::Map_Load
                UEditorEngine::EditorDestroyWorld           // 先に現在のWorldを破棄
                  UWorld::ClearWorldComponents
                    ULevel::ClearLevelComponents
                      AActor::UnregisterAllComponents       // 現在のWorldの全てのComponentを登録解除
                  UWorld::DestroyWorld
                    UWorld::CleanupWorld
                      UWorld::ClearWorldComponents
                        ULevel::ClearLevelComponents
                          AActor::UnregisterAllComponents   // 遷移先のWorldのComponentのリセット
                    UEngine::WorldDestroyed
                UWorld::UpdateWorldComponents               // 新しいWorldのComponent更新
                  ULevel::UpdateLevelComponents
                    ULevel::IncrementalUpdateComponents
                      AActor::PreRegisterAllComponents
                      AActor::RerunConstructionScripts
                        AActor::IncrementalRegisterComponents
                          AActor::RegisterAllActorTickFunctions
                          UActorComponent::RegisterComponentWithWorld
                    UWorld::UpdateCullDistanceVolumes
                UWorld::FlushLevelStreaming                 // 現在のWorld情報の更新
                  UWorld::UpdateLevelStreaming
                    ULevelStreaming::UpdateStreamingState
                      UWorld::AddToWorld                    // 新しいWorldのSubLevelを追加
                        ULevel::IncrementalUpdateComponents
                          SortActorsHierarchy
                          AActor::PreRegisterAllComponents
                          AActor::RerunConstructionScripts
                            AActor::IncrementalRegisterComponents
                              AActor::RegisterAllActorTickFunctions
                              UActorComponent::RegisterComponentWithWorld
                UEngine::WorldAdded
                CollectGarbage                              // クリーンアップ
        UUnrealEdEngine::Exec
          UEditorEngine::Exec
            UEditorEngine::HandleMapCommand
              UEditorEngine::Map_Check
ContentBrowserUtils::OpenEditorForAsset

From https://qiita.com/donbutsu17/items/be66551c48360d7b0864

PIE Processing#

C++
// PIE起動した際の処理の流れ(抜粋)
UEditorEngine::PlayInEditor
  UEditorEngine::CreatePIEGameInstance
    UGameInstance::InitializeForPlayInEditor
      UEditorEngine::CreatePIEWorldByDuplication
        UEditorEngine::PostCreatePIEWorld
          UWorld::InitWorld
    UGameInstance::StartPlayInEditorGameInstance
      UWorld::FlushLevelStreaming                           // AlwaysLoadedのSubLevelを起動
        UWorld::UpdateLevelStreaming
          ULevelStreaming::UpdateStreamingState
            UWorld::AddToWorld                              // SubLevel追加
              ULevel::IncrementalUpdateComponents
                AActor::PreRegisterAllComponents
                  AActor::RerunConstructionScripts
                    AActor::IncrementalRegisterComponents
                      AActor::RegisterAllActorTickFunctions
                        UActorComponent::RegisterComponentWithWorld
      UWorld::InitializeActorsForPlay
        ULevel::RouteActorInitialize
          AActor::PreInitializeComponents                   // World上の全Component登録
          AActor::InitializeComponents
            UActorComponent::Activate
            UActorComponent::InitializeComponent
          AActor::PostInitializeComponents
          AActor::UpdateOverlaps
      ULocalPlayer::SpawnPlayActor
        UWorld::SpawnPlayActor                              // Player生成
          AGameModeBase::Login
            AGameModeBase::SpawnPlayerController
              AGameModeBase::SpawnPlayerController
                AGameModeBase::SpawnPlayerControllerCommon
                  UGameplayStatics::FinishSpawningActor
                    AActor::FinishSpawning
                      AActor::ExecuteConstruction
                        AActor::ProcessUserConstructionScript
                          AActor::UserConstructionScript    // BP Construction Script
      UWorld::BeginPlay
        AGameStateBase::HandleBeginPlay
          AWorldSettings::NotifyBeginPlay                   // Worldに存在する全Actorの起動
            AActor::DispatchBeginPlay
              AActor::BeginPlay                             // Tick起動とComponent起動
                AActor::RegisterAllActorTickFunctions
                UActorComponent::RegisterAllComponentTickFunctions
                UActorComponent::BeginPlay
                AActor::ReceiveBeginPlay

From https://qiita.com/donbutsu17/items/be66551c48360d7b0864