Description

The Build All Levels editor action cleans up the world's NavDataSet (UNavigationSystemV1::NavDataSet) as pre-rebuild world cleanup by calling:

SetNavigationSystem(nullptr); 

inside

UWorld::CleanupWorldInternal() 

See callstack 1.

 

That navigation system does not get re-added at any point during Build All Levels, resulting in no navigation being built during the FBuildOptions::BuildAIPaths build step in 

FBuildAllHandler::ProcessBuild() 

See callstack 2.

 

Afterwards, the navigation system (UNavigationSystemV1) is in an incorrect state, having no NavData for the loaded world in its NavDataSet. Navigation will fail to build for the map, until it is reopened or until the existing RecastNavMesh actor is deleted.

In its broken state moving the NavMeshBoundsVolume does not trigger a recalculation of the RecastNavMesh actor in the world.

This results in an orphaned RecastNavMesh actor that does not update along with its NavMeshBoundsVolume. Likely, this also results in navigation not working in-game.

Steps to Reproduce
  • Add a NavMeshBoundsVolume to a map and observe the green preview for the nav mesh
  • Put a breakpoint in UNavigationSystemV1::RebuildAll() outside and inside the for-loop
  • In editor, trigger: Build > Build Paths
    • Observe that the for-loop in RebuildAll() processes 1 NavData
  • In editor: Build > Build All Levels
  • Observe: 
    • Observe that the for-loop in RebuildAll() processes no NavData
    • If you do: Build > Build Paths again, you also notice no NavData now
    • If you move the NavMeshBoundsVolume, notice that the nav mesh does not get updated. The green preview displays an orphanced nav mesh.
  • Expected, after Build All Levels: 
    • The world either retains NavData in UNavigationSystemV1::NavDataSet, or a new navigation system gets re-added in time for the FBuildOptions::BuildAIPaths build step.
    • When moving the NavMeshBoundsVolume, the nav mesh preview should update.
Callstack

Callstack 1: Cleanup of NavData for world
> UnrealEditor-Engine.dll!UWorld::CleanupWorldInternal(bool bSessionEnded, bool bCleanupResources, bool bWorldChanged) Line 5312 C++
  UnrealEditor-Engine.dll!UWorld::CleanupWorld(bool bSessionEnded, bool bCleanupResources, UWorld * NewWorld) Line 5307 C++
  UnrealEditor-Engine.dll!UWorld::ReInitWorld() Line 2244 C++
  UnrealEditor-UnrealEd.dll!FUnrealEdMisc::CB_MapChange(unsigned int InFlags) Line 1222 C++
  [Inline Frame] UnrealEditor-UnrealEd.dll!Invoke(void(FUnrealEdMisc::*)(unsigned int)) Line 66 C++
  [Inline Frame] UnrealEditor-UnrealEd.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(FUnrealEdMisc::*)(unsigned int) &) Line 311 C++
  UnrealEditor-UnrealEd.dll!TBaseRawMethodDelegateInstance<0,FUnrealEdMisc,void __cdecl(unsigned int),FDefaultDelegateUserPolicy>::ExecuteIfSafe(unsigned int <Params_0>) Line 535 C++
  [Inline Frame] UnrealEditor-UnrealEd.dll!TMulticastDelegateBase<FDefaultDelegateUserPolicy>::Broadcast(unsigned int) Line 254 C++
  UnrealEditor-UnrealEd.dll!TMulticastDelegate<void __cdecl(unsigned int),FDefaultDelegateUserPolicy>::Broadcast(unsigned int <Params_0>) Line 956 C++
  UnrealEditor-UnrealEd.dll!UEditorEngine::RebuildMap(UWorld * InWorld, UEditorEngine::EMapRebuildType RebuildType) Line 1700 C++
  UnrealEditor-UnrealEd.dll!UEditorEngine::Map_Rebuild(UWorld * InWorld, const wchar_t * Str, FOutputDevice & Ar) Line 1564 C++
  UnrealEditor-UnrealEd.dll!UEditorEngine::HandleMapCommand(const wchar_t * Str, FOutputDevice & Ar, UWorld * InWorld) Line 6291 C++
  UnrealEditor-UnrealEd.dll!UEditorEngine::Exec_Editor(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 5752 C++
  UnrealEditor-Core.dll!FExec::Exec(UWorld * InWorld, const wchar_t * Cmd, FOutputDevice & Ar) Line 18 C++
  UnrealEditor-Engine.dll!UEngine::Exec(UWorld * InWorld, const wchar_t * Cmd, FOutputDevice & Ar) Line 4686 C++
  UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Exec(UWorld * InWorld, const wchar_t * Stream, FOutputDevice & Ar) Line 662 C++
  UnrealEditor-UnrealEd.dll!FBuildAllHandler::ProcessBuild(const TWeakPtr<SBuildProgressWidget,1> & BuildProgressWidget) Line 1386 C++
  [Inline Frame] UnrealEditor-UnrealEd.dll!FBuildAllHandler::StartBuild(UWorld *) Line 1251 C++
  UnrealEditor-UnrealEd.dll!FEditorBuildUtils::EditorBuild(UWorld * InWorld, FName Id, const bool bAllowLightingDialog) Line 544 C++
  UnrealEditor-LevelEditor.dll!FLevelEditorActionCallbacks::Build_Execute() Line 758 C++
  [Inline Frame] UnrealEditor-LevelEditor.dll!Invoke(void[Image Removed]() &) Line 47 C++
  [Inline Frame] UnrealEditor-LevelEditor.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void[Image Removed]() &) Line 311 C++
  UnrealEditor-LevelEditor.dll!TBaseStaticDelegateInstance<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() Line 777 C++
  UnrealEditor-Slate.dll!TDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfBound<void,0>() Line 570 C++
  [Inline Frame] UnrealEditor-Slate.dll!FUIAction::Execute() Line 139 C++
  UnrealEditor-Slate.dll!FUICommandList::ExecuteAction(const TSharedRef<FUICommandInfo const ,1> InUICommandInfo) Line 117 C++
  UnrealEditor-Slate.dll!SMenuEntryBlock::OnClicked(bool bCheckBoxClicked) Line 1158 C++
  UnrealEditor-Slate.dll!SMenuEntryBlock::OnMenuItemButtonClicked() Line 1118 C++
  [Inline Frame] UnrealEditor-Slate.dll!Invoke(FReply(SMenuEntryBlock::*)()) Line 66 C++
  [Inline Frame] UnrealEditor-Slate.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(FReply(SMenuEntryBlock::*)() &) Line 311 C++
  UnrealEditor-Slate.dll!TBaseSPMethodDelegateInstance<0,SMenuEntryBlock,1,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() Line 281 C++
  UnrealEditor-Slate.dll!TDelegate<FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() Line 549 C++
  UnrealEditor-Slate.dll!SButton::ExecuteOnClick() Line 465 C++
  UnrealEditor-Slate.dll!SButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 390 C++
  UnrealEditor-Slate.dll!SMenuEntryButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 434 C++
  [Inline Frame] UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda_3>::operator()(const FArrangedWidget &) Line 5220 C++
  UnrealEditor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,`FSlateApplication::RoutePointerUpEvent'::`8'::<lambda_3>>(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::<lambda_3> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) Line 442 C++
  UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) Line 5206 C++
  UnrealEditor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) Line 5775 C++
  UnrealEditor-Slate.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button, const UE::Math::TVector2<double> CursorPos) Line 5740 C++
  UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 2231 C++
  UnrealEditor-ApplicationCore.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,1> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 2738 C++
  UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 1099 C++
  [Inline Frame] UnrealEditor-ApplicationCore.dll!WindowsApplication_WndProc(HWND__ *) Line 931 C++
  UnrealEditor-ApplicationCore.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 937 C++
 [External Code]
  [Inline Frame] UnrealEditor-ApplicationCore.dll!WinPumpMessages() Line 119 C++
  UnrealEditor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 148 C++
  UnrealEditor.exe!FEngineLoop::Tick() Line 5749 C++
  [Inline Frame] UnrealEditor.exe!EngineTick() Line 61 C++
  UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 188 C++
  UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 247 C++
  UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 298 C++
 [External Code]
Callstack 2: Missing NavData for world in NavDataSet:
> UnrealEditor-NavigationSystem.dll!UNavigationSystemV1::RebuildAll(bool bIsLoadTime) Line 4101 C++
  UnrealEditor-NavigationSystem.dll!UNavigationSystemV1::Build() Line 3776 C++
  [Inline Frame] UnrealEditor-Engine.dll!TDelegate<void __cdecl(UWorld &),FDefaultDelegateUserPolicy>::Execute(UWorld &) Line 549 C++
  UnrealEditor-Engine.dll!FNavigationSystem::Build(UWorld & World) Line 247 C++
  [Inline Frame] UnrealEditor-UnrealEd.dll!FEditorBuildUtils::TriggerNavigationBuilder(UWorld * &) Line 967 C++
  UnrealEditor-UnrealEd.dll!FBuildAllHandler::ProcessBuild(const TWeakPtr<SBuildProgressWidget,1> & BuildProgressWidget) Line 1386 C++
  [Inline Frame] UnrealEditor-UnrealEd.dll!FBuildAllHandler::StartBuild(UWorld *) Line 1251 C++
  UnrealEditor-UnrealEd.dll!FEditorBuildUtils::EditorBuild(UWorld * InWorld, FName Id, const bool bAllowLightingDialog) Line 544 C++
  UnrealEditor-LevelEditor.dll!FLevelEditorActionCallbacks::Build_Execute() Line 758 C++
  [Inline Frame] UnrealEditor-LevelEditor.dll!Invoke(void[Image Removed]() &) Line 47 C++
  [Inline Frame] UnrealEditor-LevelEditor.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void[Image Removed]() &) Line 311 C++
  UnrealEditor-LevelEditor.dll!TBaseStaticDelegateInstance<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() Line 777 C++
  UnrealEditor-Slate.dll!TDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfBound<void,0>() Line 570 C++
  [Inline Frame] UnrealEditor-Slate.dll!FUIAction::Execute() Line 139 C++
  UnrealEditor-Slate.dll!FUICommandList::ExecuteAction(const TSharedRef<FUICommandInfo const ,1> InUICommandInfo) Line 117 C++
  UnrealEditor-Slate.dll!SMenuEntryBlock::OnClicked(bool bCheckBoxClicked) Line 1158 C++
  UnrealEditor-Slate.dll!SMenuEntryBlock::OnMenuItemButtonClicked() Line 1118 C++
  [Inline Frame] UnrealEditor-Slate.dll!Invoke(FReply(SMenuEntryBlock::*)()) Line 66 C++
  [Inline Frame] UnrealEditor-Slate.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(FReply(SMenuEntryBlock::*)() &) Line 311 C++
  UnrealEditor-Slate.dll!TBaseSPMethodDelegateInstance<0,SMenuEntryBlock,1,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() Line 281 C++
  UnrealEditor-Slate.dll!TDelegate<FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() Line 549 C++
  UnrealEditor-Slate.dll!SButton::ExecuteOnClick() Line 465 C++
  UnrealEditor-Slate.dll!SButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 390 C++
  UnrealEditor-Slate.dll!SMenuEntryButton::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 434 C++
  [Inline Frame] UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent::__l8::<lambda_3>::operator()(const FArrangedWidget &) Line 5220 C++
  UnrealEditor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,`FSlateApplication::RoutePointerUpEvent'::`8'::<lambda_3>>(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l8::<lambda_3> & Lambda, ESlateDebuggingInputEvent DebuggingInputEvent) Line 442 C++
  UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent(const FWidgetPath & WidgetsUnderPointer, const FPointerEvent & PointerEvent) Line 5206 C++
  UnrealEditor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent(const FPointerEvent & MouseEvent) Line 5775 C++
  UnrealEditor-Slate.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button, const UE::Math::TVector2<double> CursorPos) Line 5740 C++
  UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 2231 C++
  UnrealEditor-ApplicationCore.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,1> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 2738 C++
  UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 1099 C++
  [Inline Frame] UnrealEditor-ApplicationCore.dll!WindowsApplication_WndProc(HWND__ *) Line 931 C++
  UnrealEditor-ApplicationCore.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 937 C++
 [External Code]
  [Inline Frame] UnrealEditor-ApplicationCore.dll!WinPumpMessages() Line 119 C++
  UnrealEditor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages(bool bFromMainLoop) Line 148 C++
  UnrealEditor.exe!FEngineLoop::Tick() Line 5749 C++
  [Inline Frame] UnrealEditor.exe!EngineTick() Line 61 C++
  UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 188 C++
  UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 247 C++
  UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 298 C++
 [External Code]
 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-208487 in the post.

2
Login to Vote

Unresolved
ComponentUE - AI - Navigation
Affects Versions5.3.2
Target Fix5.5
CreatedFeb 28, 2024
UpdatedJun 13, 2024
View Jira Issue