Unknown ensure condition failed

Hello, I have a problem that seems impossible to solve.

After upgrading UE version 5.2 to 5.3, these error code are occured.

There’s detail ensure call stack log about this problem.

LogOutputDevice: Error: === Handled ensure: ===
LogOutputDevice: Error: Ensure condition failed: FMath::IsNearlyEqual(Dir.SizeSquared(), (FReal)1, (FReal)(1.e-4f))  [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Public\Chaos\ImplicitObjectScaled.h] [Line: 597] 
LogOutputDevice: Error: Stack: 
LogOutputDevice: Error: [Callstack] 0x00007ff8383e363d UnrealEditor-Engine.dll!Chaos::TImplicitObjectScaled<Chaos::FTriangleMeshImplicitObject,1>::Raycast() [D:\build\++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Public\Chaos\ImplicitObjectScaled.h:597]
LogOutputDevice: Error: [Callstack] 0x00007ff8383e4108 UnrealEditor-Engine.dll!Chaos::TImplicitObjectTransformed<double,3,1>::Raycast() [D:\build\++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Public\Chaos\ImplicitObjectTransformed.h:215]
LogOutputDevice: Error: [Callstack] 0x00007ff8315c53fa UnrealEditor-PhysicsCore.dll!TSQVisitor<Chaos::TSphere<double,3>,Chaos::FAccelerationStructureHandle,ChaosInterface::FRaycastHit,1>::Visit<0>() [D:\build\++UE5\Sync\Engine\Source\Runtime\PhysicsCore\Private\SQAccelerator.cpp:305]
LogOutputDevice: Error: [Callstack] 0x00007ff82fd48b4b UnrealEditor-Chaos.dll!Chaos::TAABBTree<Chaos::FAccelerationStructureHandle,Chaos::TAABBTreeLeafArray<Chaos::FAccelerationStructureHandle,1,double>,1,double>::QueryImp<0,Chaos::FQueryFastData,Chaos::TSpatialVisitor<Chaos::FAccelerationStructureHandle,double> >() [D:\build\++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Public\Chaos\AABBTree.h:2772]
LogOutputDevice: Error: [Callstack] 0x00007ff83028fc26 UnrealEditor-Chaos.dll!Chaos::TSpatialAccelerationCollectionHelper<0,3,Chaos::TSpatialTypeTuple<Chaos::TAABBTree<Chaos::FAccelerationStructureHandle,Chaos::TAABBTreeLeafArray<Chaos::FAccelerationStructureHandle,1,double>,1,double>,Chaos::TBoundingVolume<Chaos::FAccelerationStructureHandle,double,3>,Chaos::TAABBTree<Chaos::FAccelerationStructureHandle,Chaos::TBoundingVolume<Chaos::FAccelerationStructureHandle,double,3>,1,double> >,Chaos::FAccelerationStructureHandle,double,3>::RaycastFast<Chaos::TSpatialVisitor<Chaos::FAccelerationStructure
Handle,double> >() [D:\build\++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Public\Chaos\SpatialAccelerationCollection.h:211]
LogOutputDevice: Error: [Callstack] 0x00007ff8302c7705 UnrealEditor-Chaos.dll!Chaos::TSpatialAccelerationCollection<Chaos::TAABBTree<Chaos::FAccelerationStructureHandle,Chaos::TAABBTreeLeafArray<Chaos::FAccelerationStructureHandle,1,double>,1,double>,Chaos::TBoundingVolume<Chaos::FAccelerationStructureHandle,double,3>,Chaos::TAABBTree<Chaos::FAccelerationStructureHandle,Chaos::TBoundingVolume<Chaos::FAccelerationStructureHandle,double,3>,1,double> >::Raycast() [D:\build\++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Public\Chaos\SpatialAccelerationCollection.h:487]
LogOutputDevice: Error: [Callstack] 0x00007ff83156f647 UnrealEditor-PhysicsCore.dll!FChaosSQAccelerator::RaycastImp<ChaosInterface::FRaycastHit>() [D:\build\++UE5\Sync\Engine\Source\Runtime\PhysicsCore\Private\SQAccelerator.cpp:607]
LogOutputDevice: Error: [Callstack] 0x00007ff8374de72d UnrealEditor-Engine.dll!TSceneCastCommonImp<TSQTraits<ChaosInterface::FRaycastHit,0,0>,FRaycastSQAdditionalInputs>() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Collision\SceneQuery.cpp:379]
LogOutputDevice: Error: [Callstack] 0x00007ff837557ae0 UnrealEditor-Engine.dll!FGenericPhysicsInterface::RaycastSingle() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Collision\SceneQuery.cpp:478]
LogOutputDevice: Error: [Callstack] 0x00007ff837545001 UnrealEditor-Engine.dll!UWorld::LineTraceSingleByChannel() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Collision\WorldCollision.cpp:78]
LogOutputDevice: Error: [Callstack] 0x00007ff82427a46b UnrealEditor-AIModule.dll!UAISense_Sight::ComputeVisibility() [D:\build\++UE5\Sync\Engine\Source\Runtime\AIModule\Private\Perception\AISense_Sight.cpp:564]
LogOutputDevice: Error: [Callstack] 0x00007ff824296f34 UnrealEditor-AIModule.dll!UAISense_Sight::Update() [D:\build\++UE5\Sync\Engine\Source\Runtime\AIModule\Private\Perception\AISense_Sight.cpp:369]
LogOutputDevice: Error: [Callstack] 0x00007ff824293205 UnrealEditor-AIModule.dll!UAIPerceptionSystem::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\AIModule\Private\Perception\AIPerceptionSystem.cpp:218]
LogOutputDevice: Error: [Callstack] 0x00007ff838bfcc8a UnrealEditor-Engine.dll!FTickableGameObject::TickObjects() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Tickable.cpp:153]
LogOutputDevice: Error: [Callstack] 0x00007ff837d9785b UnrealEditor-Engine.dll!UWorld::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1581]
LogOutputDevice: Error: [Callstack] 0x00007ff832bea53a UnrealEditor-UnrealEd.dll!UEditorEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1905]
LogOutputDevice: Error: [Callstack] 0x00007ff83367edc6 UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:519]
LogOutputDevice: Error: [Callstack] 0x00007ff6fe19875f UnrealEditor.exe!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5812]
LogOutputDevice: Error: [Callstack] 0x00007ff6fe1b473c UnrealEditor.exe!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:188]
LogOutputDevice: Error: [Callstack] 0x00007ff6fe1b482a UnrealEditor.exe!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:107]
LogOutputDevice: Error: [Callstack] 0x00007ff6fe1b74f0 UnrealEditor.exe!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:244]
LogOutputDevice: Error: [Callstack] 0x00007ff6fe1ca4c4 UnrealEditor.exe!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:284]
LogOutputDevice: Error: [Callstack] 0x00007ff6fe1cd996 UnrealEditor.exe!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
LogOutputDevice: Error: [Callstack] 0x00007ff8dd84257d KERNEL32.DLL!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff8df30aa58 ntdll.dll!UnknownFunction []

It looks like a problem that related on chaos and ai perception. But there are no code that i wrote. Plz help me to solve this error.

When does the crash happen exactly ?,

Try these:

  • Delete the folder ‘intermediate’ & “DerivedCache” in your project folder, then let it recompile.
  • Try to disable your core blueprint one by one to test which one is causing the crash, for example don’t spawn/place your main character.

Well, i couldn’t find the actual situation that causes those error.

And It is not crash, just frame drop including that logs.

I already tried to rebuild project with your solution several times, but it didn’t work… :sweat:

Did you try this one: Ensure condition failed on project start - #11 by L.F.A

Search for World Context in all bp:

Thanks for your help.

But it is not worked for me :joy:

That a weird issue :face_with_spiral_eyes: , see if that happen on a fresh project and try to re-install 5.3, or just stay on 5.2 for now until 5.4

1 Like
void AAIControllerBase::InitAIPerceptionSystem()
{
	SightPerceptionConfig = CreateOptionalDefaultSubobject<UAISenseConfig_Sight>(TEXT("SIGHT_CONFIG"));
	SetPerceptionComponent(*AIPerceptionComponent);

	SightPerceptionConfig->DetectionByAffiliation.bDetectEnemies = true;
	SightPerceptionConfig->DetectionByAffiliation.bDetectNeutrals = true;
	SightPerceptionConfig->DetectionByAffiliation.bDetectFriendlies = false;
	SightPerceptionConfig->SetMaxAge(MaxSightAge);
	SightPerceptionConfig->SightRadius = SightRadius;

	AIPerceptionComponent->SetDominantSense(*SightPerceptionConfig->GetSenseImplementation());
	GetPerceptionComponent()->ConfigureSense(*SightPerceptionConfig);
	GetPerceptionComponent()->OnTargetPerceptionUpdated.AddDynamic(this, &AAIControllerBase::UpdateTargetPerception);
}

void AAIControllerBase::UpdateTargetPerception(AActor* Actor, FAIStimulus Stimulus)
{
	if (IsValid(Actor) && Actor->ActorHasTag("Player") && Stimulus.WasSuccessfullySensed())
	{
		GetWorldTimerManager().ClearTimer(SightLossTimerHandle);
		GetBlackboardComponent()->SetValueAsBool("HasLineOfSight", true);
		GetBlackboardComponent()->SetValueAsObject("TargetCharacter", Actor);
	}
	else
	{
		GetBlackboardComponent()->SetValueAsBool("HasLineOfSight", false);
		GetWorldTimerManager().SetTimer(SightLossTimerHandle, FTimerDelegate::CreateLambda([&]()
		{
			GetBlackboardComponent()->SetValueAsObject("TargetCharacter", nullptr);
		}), 1.0f, false, MaxSightAge);
	}
}

I found the problem in my c++ code. The problem is solved when i erase that code.
The ensure log including frame drop doesn’t appear without above code.
But, I think that code has no logical error. Is there something wrong with my code?

There is nothing wrong with the code, the problem is that your scene have something with wrong geometry.
The code that you have erased is turning on some kind of line trace or sweep that is deteting this geometry and is printing the error.

I had a similar problem, in my case I had a cylinder to which by mistake I set the Z scale to 0.