Context
Recast lets you configure multiple agent types in Project Settings > Navigation System > Supported Agents. When agents have unique settings such as agent radius, building a nav mesh results in multiple nav meshes contained in the level as separate Recast-AgentName actors.
Problem
After changing agent settings, the next time nav meshes are built new Recast actors are created for the new agent configurations. Recast actors targeting agent configurations that no longer exist should be cleaned up. Currently this happens when the map is loaded in editor or at runtime, by UNavigationSystem::ProcessRegistrationCandidates() destroying obsolote Recast actors.
However for maps with one-file-per-actor enabled (World Settings > Use External Actors): this does not result in the external actor asset being deleted even when the map is saved. That obsolete Recast actor will keep getting loaded at editor or game runtime and then being deleted in the session. Ideally the asset is deleted from the file system once the level is saved.
Suggestion
Deleting the obsolete Recast actor requires that its external actor package is found and marked for cleanup inside
> UnrealEditor-UnrealEd.dll!InternalPromptForCheckoutAndSave(const TArray<UPackage *,TSizedDefaultAllocator<32>> & FinalSaveList, bool bUseDialog, TArray<UPackage *,TSizedDefaultAllocator<32>> & OutFailedPackages) Line 4167 C++ UnrealEditor-UnrealEd.dll!FEditorFileUtils::PromptForCheckoutAndSave(const TArray<UPackage *,TSizedDefaultAllocator<32>> & InPackages, FEditorFileUtils::FPromptForCheckoutAndSaveParams & InOutParams) Line 4576 C++ [Inline Frame] UnrealEditor-UnrealEd.dll!InternalSavePackages(const TArray<UPackage *,TSizedDefaultAllocator<32>> &) Line 3831 C++ UnrealEditor-UnrealEd.dll!FEditorFileUtils::SaveCurrentLevel() Line 4110 C++ [Inline Frame] UnrealEditor-LevelEditor.dll!Invoke(void(*)() &) Line 47 C++ [Inline Frame] UnrealEditor-LevelEditor.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence<unsigned int>>::ApplyAfter(void(*)() &) Line 309 C++ UnrealEditor-LevelEditor.dll!V::TBaseStaticDelegateInstance::ExecuteIfSafe() Line 777 C++ [Inline Frame] UnrealEditor-Slate.dll!TDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfBound() Line 570 C++ UnrealEditor-Slate.dll!FUIAction::Execute() Line 139 C++
This has three requirements:
LogNavigation: Warning: NavData RegistrationFailed_AgentNotValid, NavData instance contains navmesh that doesn't support any of expected agent types.
The third Recast nav mesh actor has been destroyed by UNavigationSystemV1::ProcessRegistrationCandidates().
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-229996 in the post.
0 |
Component | UE - AI - Navigation |
---|---|
Affects Versions | 5.4 |
Target Fix | 5.6 |
Created | Nov 8, 2024 |
---|---|
Updated | Dec 10, 2024 |