Duplicating a OFPA Level has resulted in actors having duplicated Ids

We created a “template” level with some basic setup and then duplicated the level to create our new levels. Now the stuff on those levels has duplicated ids.

  1. Please fix that
  2. How do I reassign Ids to actors so I dont have to delete and replace everything that was shared on all our levels?

Steps to Reproduce
Create a OFPA + World Partition level that has Level Instances placed.

Duplicate that level.

Notice the Level Instances share Ids

Hi,

The GUIDs are meant to be unique within the context of the level and are not regenerated when copying a level through the editor or the WorldPartitionRenameDuplicateBuilder. Are you experiencing problems with the duplicated levels?

Regards,

Martin

Please share the command line that is failing the check you mentioned. Getting the log and the callstack would also be helpful.

Regards,

Martin

Thanks for sharing the information. I was able to reproduce the problem locally with the minimap builder. I would recommend that you process the levels in separate processes while we investigate the problem further.

Hello!

The solution is to run the Garbage collector between each WP level in the commandlet main loop. The fix should be live in a few hours. I created a bug report so this is documented and the fix can eventually be found here:

Regards,

Martin

The official fix is 48556661. I’ll “shake the tree” so the public tracker goes live soon…

Yes, running world partition builder commandlets that iterate over the maps in a collection to “do stuff” is running into ```check(!OuterWorld->PersistentLevel->bAlreadyMovedActors);``` in WorldPartition.cpp in ```void UWorldPartition::Initialize(UWorld* InWorld, const FTransform& InTransform)```

and then a crash in ```void ULevelStreamingLevelInstance::OnLoadedActorsAddedToLevelPostEvent(const TArray<AActor*>& InActors)``` in LevelInstanceStreaming.cpp when the GetLoadedLevel() is null.

I did try to modify the ResaveExternalActors commandlet to regenerate the GUID and the ObjectName, but it breaks MaterialConstants when processing Landscapes.

I would really like to avoid having to find every conflicting LevelInstance that was duplicated, copy/paste, and delete the original on all the maps

So here’s the callstack of the assert

	UnrealEditor-Engine-Win64-Debug.dll!UWorldPartition::Initialize(UWorld * InWorld, const UE::Math::TTransform<double> & InTransform) Line 793	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevel::OnLevelLoaded() Line 3552	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreaming::SetLoadedLevel(ULevel * Level) Line 1413	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreaming::PrepareLoadedLevel(ULevel * InLevel, UPackage * InLevelPackage, int InPIEInstanceID) Line 1476	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreaming::RequestLevel(UWorld * PersistentWorld, bool bAllowLevelLoadRequests, ULevelStreaming::EReqLevelBlock BlockPolicy) Line 1701	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreaming::UpdateStreamingState::__l2::<lambda_1>::operator()() Line 1008	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreaming::UpdateStreamingState(bool & bOutUpdateAgain, bool & bOutRedetermineTarget, const TOptional<UE::FTimeout const> & InExternalTimeout) Line 1138	C++
 	UnrealEditor-Engine-Win64-Debug.dll!UWorld::UpdateLevelStreaming(const TOptional<UE::FTimeout const> & ExternalTimeout) Line 4976	C++
 	UnrealEditor-Engine-Win64-Debug.dll!UWorld::BlockTillLevelStreamingCompleted() Line 4712	C++
 	UnrealEditor-Engine-Win64-Debug.dll!UEngine::BlockTillLevelStreamingCompleted(UWorld * InWorld) Line 16709	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreamingLevelInstance::LoadInstance(ILevelInstanceInterface * LevelInstance) Line 440	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelInstanceSubsystem::LoadLevelInstance(ILevelInstanceInterface * LevelInstance) Line 602	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelInstanceSubsystem::UpdateStreamingStateInternal() Line 356	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelInstanceSubsystem::OnUpdateStreamingState() Line 288	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelInstanceSubsystem::Tick() Line 962	C++
 	UnrealEditor-Engine-Win64-Debug.dll!UWorld::Tick(ELevelTick TickType, float DeltaSeconds) Line 1715	C++
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 1975	C++
 	UnrealEditor-Engine-Win64-Debug.dll!CommandletHelpers::TickEngine(UWorld * InWorld, double InDeltaTime) Line 99	C++
 	UnrealEditor-Engine-Win64-Debug.dll!FWorldPartitionHelpers::FakeEngineTick(UWorld * InWorld) Line 287	C++
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UWorldPartitionBuilder::Run(UWorld * World, FPackageSourceControlHelper & PackageHelper) Line 324	C++
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UWorldPartitionBuilder::RunBuilder(UWorld * World) Line 141	C++
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UWorldPartitionBuilderCommandlet::RunBuilder(TSubclassOf<UWorldPartitionBuilder> InBuilderClass, const FString & InWorldPackageName) Line 350	C++
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UWorldPartitionBuilderCommandlet::Main(const FString & Params) Line 246	C++
 	UnrealEditor-Win64-Debug.exe!FEngineLoop::PreInitPostStartupScreen(const wchar_t * CmdLine) Line 4020	C++
 	UnrealEditor-Win64-Debug.exe!FEngineLoop::PreInit(const wchar_t * CmdLine) Line 4319	C++
 	UnrealEditor-Win64-Debug.exe!EnginePreInit(const wchar_t * CmdLine) Line 40	C++
 	UnrealEditor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine) Line 152	C++
 	UnrealEditor-Win64-Debug.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 294	C++
 	UnrealEditor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 364	C++

and here’s the crash

	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreamingLevelInstance::OnLoadedActorsAddedToLevelPostEvent(const TArray<AActor *,TSizedDefaultAllocator<32>> & InActors) Line 275	C++
 	UnrealEditor-Engine-Win64-Debug.dll!TBaseUObjectMethodDelegateInstance<0,ULevelStreamingLevelInstance,void __cdecl(TArray<AActor *,TSizedDefaultAllocator<32>> const &),FDefaultDelegateUserPolicy>::ExecuteIfSafe(const TArray<AActor *,TSizedDefaultAllocator<32>> & <Params_0>) Line 691	C++
 	UnrealEditor-Engine-Win64-Debug.dll!TMulticastDelegateBase<FDefaultDelegateUserPolicy>::Broadcast<IBaseDelegateInstance<void __cdecl(TArray<AActor *,TSizedDefaultAllocator<32>> const &),FDefaultDelegateUserPolicy>,TArray<AActor *,TSizedDefaultAllocator<32>> const &>(const TArray<AActor *,TSizedDefaultAllocator<32>> & <Params_0>) Line 258	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevel::AddLoadedActors(const TArray<AActor *,TSizedDefaultAllocator<32>> & ActorList, const UE::Math::TTransform<double> * TransformToApply) Line 1107	C++
 	UnrealEditor-Engine-Win64-Debug.dll!FWorldPartitionLoadingContext::FDeferred::~FDeferred() Line 210	C++
 	UnrealEditor-Engine-Win64-Debug.dll!IWorldPartitionActorLoaderInterface::ILoaderAdapter::RefreshLoadedState() Line 201	C++
 	UnrealEditor-Engine-Win64-Debug.dll!IWorldPartitionActorLoaderInterface::ILoaderAdapter::Load() Line 64	C++
 	UnrealEditor-Engine-Win64-Debug.dll!UWorldPartition::Initialize(UWorld * InWorld, const UE::Math::TTransform<double> & InTransform) Line 815	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevel::OnLevelLoaded() Line 3552	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreaming::SetLoadedLevel(ULevel * Level) Line 1413	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreaming::PrepareLoadedLevel(ULevel * InLevel, UPackage * InLevelPackage, int InPIEInstanceID) Line 1476	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreaming::RequestLevel(UWorld * PersistentWorld, bool bAllowLevelLoadRequests, ULevelStreaming::EReqLevelBlock BlockPolicy) Line 1701	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreaming::UpdateStreamingState::__l2::<lambda_1>::operator()() Line 1008	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreaming::UpdateStreamingState(bool & bOutUpdateAgain, bool & bOutRedetermineTarget, const TOptional<UE::FTimeout const> & InExternalTimeout) Line 1138	C++
 	UnrealEditor-Engine-Win64-Debug.dll!UWorld::UpdateLevelStreaming(const TOptional<UE::FTimeout const> & ExternalTimeout) Line 4976	C++
 	UnrealEditor-Engine-Win64-Debug.dll!UWorld::BlockTillLevelStreamingCompleted() Line 4712	C++
 	UnrealEditor-Engine-Win64-Debug.dll!UEngine::BlockTillLevelStreamingCompleted(UWorld * InWorld) Line 16709	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelStreamingLevelInstance::LoadInstance(ILevelInstanceInterface * LevelInstance) Line 440	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelInstanceSubsystem::LoadLevelInstance(ILevelInstanceInterface * LevelInstance) Line 602	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelInstanceSubsystem::UpdateStreamingStateInternal() Line 356	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelInstanceSubsystem::OnUpdateStreamingState() Line 288	C++
 	UnrealEditor-Engine-Win64-Debug.dll!ULevelInstanceSubsystem::Tick() Line 962	C++
 	UnrealEditor-Engine-Win64-Debug.dll!UWorld::Tick(ELevelTick TickType, float DeltaSeconds) Line 1715	C++
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 1975	C++
 	UnrealEditor-Engine-Win64-Debug.dll!CommandletHelpers::TickEngine(UWorld * InWorld, double InDeltaTime) Line 99	C++
 	UnrealEditor-Engine-Win64-Debug.dll!FWorldPartitionHelpers::FakeEngineTick(UWorld * InWorld) Line 287	C++
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UWorldPartitionBuilder::Run(UWorld * World, FPackageSourceControlHelper & PackageHelper) Line 324	C++
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UWorldPartitionBuilder::RunBuilder(UWorld * World) Line 141	C++
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UWorldPartitionBuilderCommandlet::RunBuilder(TSubclassOf<UWorldPartitionBuilder> InBuilderClass, const FString & InWorldPackageName) Line 350	C++
 	UnrealEditor-UnrealEd-Win64-Debug.dll!UWorldPartitionBuilderCommandlet::Main(const FString & Params) Line 246	C++
 	UnrealEditor-Win64-Debug.exe!FEngineLoop::PreInitPostStartupScreen(const wchar_t * CmdLine) Line 4020	C++
 	UnrealEditor-Win64-Debug.exe!FEngineLoop::PreInit(const wchar_t * CmdLine) Line 4319	C++
 	UnrealEditor-Win64-Debug.exe!EnginePreInit(const wchar_t * CmdLine) Line 40	C++
 	UnrealEditor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine) Line 152	C++
 	UnrealEditor-Win64-Debug.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 294	C++
 	UnrealEditor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 364	C++

the commandline is for a custom WorldPartitionBuilderCommandlet, but doesnt appear to be in this stack

> UnrealEditor-Cmd.exe Project MapCollection -run=WorldPartitionBuilderCommandlet -Builder=CustomBuilder -unattended -SCCProvider=Perforce

Dropped a CollectGarbage in and that seems to have resolved it

I’ll swap mine out with the real change when it comes in, but I am unblocked now.

Thanks!!!