[4.8preview4] AI/behavior tree bugs in editor/shipped (example scene included)

I’ve spent a deal of time trying to nail down an issue with my shipped project where enemies weren’t moving/rotating even though it all worked in the editor, and on top of the results and there quirks being beyond confusing I discovered another issue.

Here’s a link to the demonstration scene I built to show the issues I’ve been having - https://www.dropbox.com/s/ow700i89bod7k2u/TestAIsenddata.?dl=0

Bug #1 - In both editor and shipped, when you spawn a pawn it’s AI controller returns ‘none’ via the “Get Controlled Pawn” node. It works when the pawn is placed in the scene first though. This can be seen in my example by pressing 1~3, which spawns a pawn with one of my AI types and deletes the current one. The new pawn doesn’t move/rotate because of the “Get Controlled Pawn” node returning ‘none’.

Bug #2 - This is the really confusing bug that only shows up in shipped.
I’ve provided 4 AI types, and you can choose which to use by selecting the cube pawn in the scene and editing “AItype” under “Change AI” to 0~3. Overall the bug seems to have something to do with way data is being transferred around the behavior tree.
[BT_PawnA/AItype = 0] - This is where the bug is most evident. I only have “AItask_MovePawnA” in this tree, and it interps the location it gets from the service via a Key to move/turn the pawn towards the target (which changes location and moves there every 2 seconds), while displaying that information it receives above it via a widget component.
Here’s an in-editor screenshot: http://i.gyazo.com/c5f411e172abff6581693d5958462ea8.png
That works perfectly fine, however when it’s shipped it is broken and doesn’t seem to get that information at all, leaving it unable to move/turn.
Here’s a shipped screenshot: http://i.gyazo.com/f128845f7a3431fd65bd703442cc82ce.png
As you can see, that’s definitely not right.
[BT_PawnB/AItype = 1] - And now this is where it gets confusing. All I’ve changed with for this task from “AItask_MovePawnA” is removed the interp so the velocity/rotation is set directly. For some reason, this allows it to work in shipped?
[BT_PawnB/AItype = 2] - This task gets the location of the target via a “Get all actors of class>Get>Get actor location” set of nodes, instead of from the vector sent by the service. Even though this is uses interp like the “AItask_MovePawnA” task, it still works in shipped.
[BT_PawnB/AItype = 3] - And here’s the most confusing example. I have 2 tasks in here, from AItype 0 and AItype 1, which are switched by left clicking anywhere. It starts with AItype 0, which doesn’t work.
When you switch it to AItype 1, it works. However when you switch it back to AItype 0, the rotation is working-and interping correctly, while the velocity is still broken? Even though its derived from the same target location being sent by the service?

I can’t understand Bug #2 at all but I’ve spent a lot of time building this demonstration scene so hopefully it helps lead to a fix in the engine as I’m unable to move my project forward with this broken as it is, as I’d greatly appreciate this being fixed for 4.8 so I’m able to finally ship my project with full functionality.

Hi SwitfIllusion,

It looks like you are experiencing the same bug as listed here: AI behavior tree stops running after changing controlled pawn - AI - Epic Developer Community Forums

Can you try Mieszko’s solution and see if it works for you?

Sorry but that’s not at all like the problem above. I never detach AI from its controller, each one is spawned with its own AI. As mentioned the above does work in the editor, but not in shipped, as the included demonstration scene shows.

Hi ,

I’ve entered a bug report, UE-17433 to be assessed by the development staff.