Engine inner working
NPC Brain
APlaneShiftGameState::BeginPlay() calls psNPCManager::Initialize() calls ReadNPCsFromDatabase() select * from sc_npc_definitions populates npcs TMap spawnManager->RepopulateLive(); LoadAllNPCCharacterData SELECT characters.* where npc_spawn_rule>0 char = SpawnActor() char->Load() if (IsNPC()) psAIController->SetBrain( using npcs TMap above)
Engine inner working
MyProjectServer.exe!UIpNetDriver::InitListen(FNetworkNotify * InNotify, FURL & LocalURL, bool bReuseAddressAndPort, FString & Error) Line 152 C++ MyProjectServer.exe!UWorld::Listen(FURL & InURL) Line 3927 C++ MyProjectServer.exe!UEngine::LoadMap(FWorldContext & WorldContext, FURL URL, UPendingNetGame * Pending, FString & Error) Line 8983 C++ MyProjectServer.exe!UEngine::Browse(FWorldContext & WorldContext, FURL URL, FString & Error) Line 8144 C++ MyProjectServer.exe!UGameInstance::StartGameInstance() Line 262 C++ MyProjectServer.exe!UGameEngine::Init(IEngineLoop * InEngineLoop) Line 465 C++ MyProjectServer.exe!FEngineLoop::Init() Line 1967 C++ MyProjectServer.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 138 C++ MyProjectServer.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 191 C++
When you execute the "open" command from console, it will queue the travel to open the map:
MyProject2.exe!UGameInstance::HandleOpenCommand(const wchar_t * Cmd, FOutputDevice & Ar, UWorld * InWorld) Line 295 C++ MyProject2.exe!UGameInstance::Exec(UWorld * InWorld, const wchar_t * Cmd, FOutputDevice & Ar) Line 323 C++ MyProject2.exe!UGameViewportClient::Exec(UWorld * InWorld, const wchar_t * Cmd, FOutputDevice & Ar) Line 2014 C++ MyProject2.exe!ULocalPlayer::Exec(UWorld * InWorld, const wchar_t * Cmd, FOutputDevice & Ar) Line 1457 C++ MyProject2.exe!APlayerController::ConsoleCommand(const FString & Cmd, bool bWriteToLog) Line 350 C++ MyProject2.exe!UConsole::ConsoleCommand(const FString & Command) Line 394 C++ MyProject2.exe!UConsole::InputKey_InputLine(int ControllerId, FKey Key, EInputEvent Event, float AmountDepressed, bool bGamepad) Line 651 C++ MyProject2.exe!UConsole::InputKey(int ControllerId, FKey Key, EInputEvent Event, float AmountDepressed, bool bGamepad) Line 1062 C++ MyProject2.exe!UGameViewportClient::InputKey(FViewport * InViewport, int ControllerId, FKey Key, EInputEvent EventType, float AmountDepressed, bool bGamepad) Line 265 C++
Then at the next tick it will do this:
MyProject2.exe!UEngine::Browse(FWorldContext & WorldContext, FURL URL, FString & Error) Line 8161 C++ MyProject2.exe!UEngine::TickWorldTravel(FWorldContext & Context, float DeltaSeconds) Line 8311 C++ MyProject2.exe!UGameEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 812 C++ MyProject2.exe!FEngineLoop::Tick() Line 2257 C++ MyProject2.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 142 C++