Service timing in 4.14.0 Behavior Tree

I have AIs that spawn at the start of a level, the Behavior Tree service task they use works fine when started that way. I spawn additional AI’s later in the level using the exact same code and the “Event Receive Activation AI” requires a delay prior to using the supplied “Owner Controller” or the pawn cannot be used (“Event Receive Tick AI” starts running without initialization from the Activation event). Additionally the “Controlled Pawn” pin can’t be used even with the delay. I solved this as shown in the screenshot below.

All that is significant here are the event itself, and the fact that the controlled pawn can’t be used when the AI character is spawned after the level is running full-swing. The delay and the use of the controller pin and a separate “Get Controlled Pawn” fixes it. It may be significant that in the C++ program that is spawning these AIs, I use a deferred spawn so I can set some variables prior to executing the finishspawning function.

It appears the “Event Receive Activation AI” is fired prior to ensuring it has valid “Owner Controller” or “Controlled Pawn” pins.

I’m just reporting this, I don’t need a solution unless there is some workaround that is more correct not involving using hard delays or I’m doing something inappropriate. My workaround does allow a couple of Tick events to fire before the AI blackboard is actually initialized but I can hack that too.

Note: This is on a trashcan mac pro with 32GB Ram, running Yosemite so not yet using Metal Support.

1 Like

Hey eagletree,

This looks to just be a case where the order of operations is run differently than expected. Your solution should work fine unless you end up running into any issues, as I’ve often used similar workarounds in my own projects.

Let me know if this ends up causing any issues and I’ll be glad to look into it.

Thanks