x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] Exception on first invocation of SweepMultiByProfile

I'm using SweepMultiByProfile in a UBTService and I always get an exception the very first time it is executed when playing the game. I use similar sweeps in other classes without an issue.

 void UAI_PickupScanner::TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds)
 {
     UBlackboardComponent* blackBoardComp = OwnerComp.GetBlackboardComponent();
     TArray<FHitResult> hits;
     APawn* pawn = OwnerComp.GetAIOwner()->GetPawn();
     FVector actorLocation = pawn->GetActorLocation();
 
     GetWorld()->SweepMultiByProfile(hits, actorLocation, actorLocation, FQuat::Identity, FName("OverlapAllDynamic"), FCollisionShape::MakeSphere(SearchRadius));
 
   ........
 

SearchRadius is normally set to 4000.0f

This causes the game to hang for about 4 seconds, with StackWalkAndDump taking 3.5 seconds on average. It only happens the first time the TickNode and the sweep are called, and subsequently the game runs without an issue.

Here is the relevant part of the exception:

LogStats: FPlatformStackWalk::StackWalkAndDump - 3.634 s LogOutputDevice: Error: === Handled ensure: === LogOutputDevice: Error: Ensure condition failed: OutResult.ImpactNormal.IsNormalized() [File:D:\Build\++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\Engine\Private\Collision\CollisionConversions.cpp] [Line: 992] LogOutputDevice: Error: Stack: LogOutputDevice: Error: [Callstack] 0x00000000E2902786 UE4Editor-Core.dll!FWindowsPlatformStackWalk::StackWalkAndDump() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:200] LogOutputDevice: Error: [Callstack] 0x00000000E26A123A UE4Editor-Core.dll!FDebug::EnsureFailed() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:298] LogOutputDevice: Error: [Callstack] 0x00000000E26BB906 UE4Editor-Core.dll!FDebug::OptionallyLogFormattedEnsureMessageReturningFalse() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:425] LogOutputDevice: Error: [Callstack] 0x00000000D62883E5 UE4Editor-Engine.dll!ConvertOverlappedShapeToImpactHit() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\collision\collisionconversions.cpp:992] LogOutputDevice: Error: [Callstack] 0x00000000D6288951 UE4Editor-Engine.dll!ConvertQueryImpactHit() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\collision\collisionconversions.cpp:437] LogOutputDevice: Error: [Callstack] 0x00000000D627AD18 UE4Editor-Engine.dll!AddSweepResults() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\collision\collisionconversions.cpp:595] LogOutputDevice: Error: [Callstack] 0x00000000D62974CC UE4Editor-Engine.dll!GeomSweepMulti_PhysX() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\collision\physxcollision.cpp:1201] LogOutputDevice: Error: [Callstack] 0x00000000D6296B5D UE4Editor-Engine.dll!GeomSweepMulti() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\collision\physxcollision.cpp:1254] LogOutputDevice: Error: [Callstack] 0x00000000D62BD8AE UE4Editor-Engine.dll!UWorld::SweepMultiByChannel() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\collision\worldcollision.cpp:147] LogOutputDevice: Error: [Callstack] 0x00000000D62BDBE3 UE4Editor-Engine.dll!UWorld::SweepMultiByProfile() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\engine\private\collision\worldcollision.cpp:356] LogOutputDevice: Error: [Callstack] 0x00000000CA01F42B UE4Editor-Horu-9517.dll!UAI_BodypartScanner::TickNode() [c:\work\horu\horu\source\horu\private\ai\ai_pickupscanner.cpp:18] LogOutputDevice: Error: [Callstack] 0x00000000DE3263BA UE4Editor-AIModule.dll!UBTAuxiliaryNode::WrappedTickNode() [d:\build++ue4+release-4.18+compile\sync\engine\source\runtime\aimodule\private\behaviortree\btauxiliarynode.cpp:66]

Product Version: UE 4.18
Tags:
more ▼

asked Feb 02 '18 at 06:35 AM in C++ Programming

avatar image

GlassBeaver
128 7 15 15

avatar image Yun-Kun Feb 17 '18 at 04:34 PM

I have the same issue in 4.17.

It only happens once in Editor and never again until I restart it.

I'm working with Blueprint only.

EDIT: I thought it was because the first swept was returning 0 result but it's freezing also with 1+ results.

EDIT2: I'm trying to find a workaround (I need to restart my project each time :p).

EDIT3. I arrived at a point where I does not freezes / stack walk and dump when triggering the first MultiSphereTrace by isolating the function and removing any custom parameters used. I'll update with more information.

EDIT4: More info: I'm using variables for TraceChannel, TraceComplex, ActorsToIgnore, DrawDebugType, IgnoreSelf and DrawTime. I played around plugging / unplugging these variables into the MultiSphereTraceByChannel node. I did not arrive to a conclusion yet but I have a feeling it comes from the "IgnoreSelf" boolean.

My setup

EDIT5. I reset every parameter to my initial setup except for IgnoreSelf and TraceComplex and I still don't experience the first freeze. Trying right now with IgnoreSelf unchecked (which is the setup I want). Ok, it did freeze with the "IgnoreSelf" parameter left unchecked. I'm performing that function on an ActorComponent and the starting location of the sphere is the exact location of the actor owning the actor component. Going to think a bit further about this.

example.jpg (81.3 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Nov 02 '18 at 11:23 PM by GlassBeaver for the following reason:

The question is answered, right answer was accepted


4 answers: sort voted first

Adding 0.01 to any axis off the initial sweep position might get rid of the problem.

more ▼

answered Jun 02 '18 at 06:43 PM

avatar image

Yun-Kun
101 5 13

avatar image Laurens Oct 08 '18 at 05:32 PM

This actually fixed it for me on 4.20.3. The accepted answer is merely an acknowledgement of the symptoms but adding a very small amount to the X-axis kept the engine from locking up. This should be the accepted answer @GlassBeaver.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The problem comes from the "IgnoreSelf" parameter if you're using the Blueprint alternative of MultiSphereTraceByChannel.

When using this node for the first time of an editor launch, with the parameter "IgnoreSelf" unchecked, it freezes for 4 seconds and generates a StackWalkAndDump.

I did not find a workaround to the problem but I isolated it.

more ▼

answered Feb 17 '18 at 05:18 PM

avatar image

Yun-Kun
101 5 13

avatar image GlassBeaver Feb 17 '18 at 06:21 PM

I'm not excluding any actors in my call to SweepMultiByProfile, and the c++ version doesn't really have an "ignore self" parameter either. All it has is FCollisionQueryParams where I could (but don't, in this case) specify any actors to ignore.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Yup but I strongly suspect both cases to be related somehow. Maybe the code inside the "MultiSphereTraceByChannel" node can help us out resolve our error.

more ▼

answered Feb 18 '18 at 12:28 AM

avatar image

Yun-Kun
101 5 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Turns out not to be a bug: my 2nd and 3rd parameters were the same, making the IsNormalized() check fail. Not sure why it didn't keep failing after the first invocation, though.

more ▼

answered Jun 02 '18 at 01:42 PM

avatar image

GlassBeaver
128 7 15 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question