Player character movement speed affected when AI MoveTo behaviour tree executes

I’ve encountered a really weird bug, and things are a bit too complicated for me to find the root cause.
I’ve finished the UnrealCourse, with some minor tweaks. My repository is available at https://github.com/MitchReidNZ/ProvingGrounds

My problem is that when I shoot, which calls AActor::MakeNoise to broadcast the noise to the AI, my movement speed suddenly plummets and I can barely walk around the map. Jumping happens in normal speed, and the AI in the level can all move at normal speed - it only affects my character speed.

I’ve got a single character which holds a Gun actor.
The gun actor calls AActor::MakeNoise when it fires, so that I can notify the AI in the level of my character shooting.
The AI controller has an AIPerceptionComponent which registers for both Sight and Hearing events. When it detects something, I update a blackboard key with the actor it detected.
My behaviour tree then calls MoveTo to walk toward the actor.
It’s at this point that my character suddenly starts moving really slowly.

I’ve narrowed it down to this after looking at a number of things:

  • Gun.cpp:line 66 calls MakeNoise. If I comment it out the AI can’t hear me, but I don’t get the character slowdown.
  • Leaving MakeNoise uncommented in the gun, and removing the hearing component from /Dynamic/Character/AI/NPC_AI_BP means my AI will chase me on sight, but can’t hear me. And I don’t get the character slowdown.

By checking these two points, I’m confident that the problem comes from my AI Perception setting the target in the behaviour tree (/Dynamic/Character/AI/BasicGuard)

I then went through the behaviour tree disconnecting nodes until I could find whats causing the problem, and it appears to only happen when I run a MoveTo node.
To verify this, I’ve simplified everything else out of the behaviour tree, to get the following screenshot:

If I break the link to the MoveTo node, I can shoot and run around to my hearts content. But if I have the link to the MoveTo node, as per the screenshot, I suddenly move really slowly as soon as I shoot.

Does anyone have any suggestion on what I should look at next to try and solve this?

To anyone visiting from the future with a similar problem - I’ve found a solution to the issue, though I’m still not entirely sure why the issue exists.

The problem is that the AI characters can’t path to the player character, as there’s no nav mesh bounds volume encompassing the player starting area. This was an intentional decision to give the player a safe staging ground before the AI could attack them. However, if you fire the gun in the staging area the AI can still hear it, which marks the player as their target.

The AI then try to MoveTo their Target, but because it’s not in a nav mesh bounds volume the AI can’t find a path to the target. For reasons I don’t understand at all, this causes the player character to move excruciatingly slowly. Presumably because the navigation system is throwing a tonne of errors, but I’m not sure.

Anyway, the fix is to add the “Does path exist” decorator to all parts of my behaviour tree that depend on navigating to the target. This decorator causes the tree to abandon paths where it would need to navigate to something it can’t get a path for, like the character shooting from the staging area.