NPC Spawner, not giving correct navigation_results

Summary

navigation_result returns as interrupted, where unreachable should be returned, when blocking an NPC in an enclosure that removes nav mesh around it.
Stopping Navigation with volumes or mutator zones to play Animations also now count as interrupted.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

make an enclosure that blocks navmesh around a Spawner that is controlled through verse and generate points that are unreachable.

Expected Result

Should get navigation_result.Unreachable.

Observed Result

Will get navigation_result.Interrupted.

Platform(s)

All platforms.

Removing the handling for Interrupted events will also just cause them to do nothing.

FORT-788970 incident has been created. Status is ā€˜Unconfirmedā€™.

1 Like

Code to reproduce as well.

        NavResultGoTo := Navigatable.NavigateTo(NewTarget, ?MovementType := Type)
            if(NavResultGoTo = navigation_result.Unreachable):
                Print("Unreachable")
                StartNavigation(A, LocArray, MoveToWaitDuration, MovementSpeedMultiplier)
            if(NavResultGoTo = navigation_result.Reached):
                Print("Reached")
                Navigatable.Wait(?Duration := MoveToWaitDuration)
                StartNavigation(A, LocArray, MoveToWaitDuration, MovementSpeedMultiplier)
            if(NavResultGoTo = navigation_result.Blocked):
                Print("Blocked")
                StartNavigation(A, LocArray,MoveToWaitDuration, MovementSpeedMultiplier)
            if(NavResultGoTo = navigation_result.Interrupted):
                Print("Interrupted")
                Sleep(2.0)
                StartNavigation(A, LocArray,MoveToWaitDuration, MovementSpeedMultiplier)

was having this issue after the most recent patch where my npcs would just not move and only returned interrupted. this was my previous code:

Result:=Nav.NavigateTo(T, ?MovementType:= movement_types.Running, ?ReachRadius:= MoveTargetReachedDistance, ?AllowPartialPath:=true)
OnResult(Result)

where OnResult is just:

    OnResult<protected>(Result:navigation_result):void=
        case(Result):
            navigation_result.Reached=>Print("Pathed Reached")
            navigation_result.PartiallyReached=>Print("Pathed PartiallyReached")
            navigation_result.Interrupted=>Print("Pathed Interrupted")
            navigation_result.Blocked=>Print("Pathed Blocked")
            navigation_result.Unreachable=>Print("Pathed Unreachable")

All npcs would just get stuck in an infinite ā€œinterruptedā€ loop, even though it worked prior to the patch. My solution that ended up working was simply adding Sleep like this:

Result:=Nav.NavigateTo(T, ?MovementType:= movement_types.Running, ?ReachRadius:= MoveTargetReachedDistance, ?AllowPartialPath:=true)
Sleep(0.0)
OnResult(Result)
1 Like

Funnily enough, adding this sleep will stop them from interrupting later on yeah :slight_smile: Only issue i have now is that they stand still stuck in an interrupted loop in the beginning for a while, but as soon as they start moving the interruption loop is non-existent haha, thanks!

they might be generating the nav mesh before they can move. if you dont notice it after the first initial period where they just kind of stand there then thats probably it. in your npc definition if you set the nav mesh generation to something really high it will have a delay like that too, since its generating a larger areas nav mesh. also, complexity in your map will increase the generation time. usually the default works well enough unless youre doing something more complicated

1 Like

Yeah, been using default Navigation Mesh settings in the Definition. It was all fine and well until the latest UEFN/Verse updateā€¦