OK I ran some more thorough tests (with console output) and here's a more visual explanation of what's happening and the behavior I'm seeing. Hopefully I'm just missing something.
Our AI frags are just lonely custom Template frags hanging out in the project. I created one for the Crew of our ship.
![Image](https://i.imgur.com/EpYshG5.jpg)
Inside each node is just a very simple setup:
![Image](https://i.imgur.com/AaI8NBq.jpg)
The purple node is what we call a Behavior. So each NPC has it's own ArticyFlowPlayer() script which is set to start on Crew AI and our own custom FlowHandler() that deals with the ArticyFlowPlayer callbacks for pauses and branches. Also, while it may seem like using an ArticyFlowPlayer() to handle this would be unnecessary, this is just a simplified version of what a normal AI frag is like. Normally, there's multiple purple Behavior nodes that have conditionals on their input pins, so what happens is that at the start of each loop the ArticyFlowPlayer() handles the conditions and tells us which of the nodes is valid via OnBranchesUpdated(). So what our code does is save the current pause object that was passed via OnFlowPlayerPaused(), then when OnBranchesUpdated() is called right afterwards we check the situation and if we're paused on a Behavior we start the Behavior code. The Behavior code is coroutine that takes the info from the Behavior and executes it with some random delays thrown in to make sure all NPC's don't act exactly alike. Once the coroutine done, it lets the FlowHandler() know that it's done and it proceeds to continue the flow, which is just to get to the jump, jump back to the AI, get to the Behavior, repeat.
I've added some print statements in our FlowHandler() code that lets us know when we're about to begin the Behavior code and when it ends. I added time stamps as well. Here's what happens when only one NPC (Grunfeld) is using this setup:
![Image](https://i.imgur.com/jdZ3zfm.jpg)
So as you can see the Behavior starts, some time passes, the behavior ends and then it's restarted again very quickly (I think it's just three frames because we don't pause on connections or pins).
Now when I have the same AI frag on two NPC's, here's what happens:
![Image](https://i.imgur.com/9cXvtXZ.jpg)
So what's happening is that Carver and Grunfeld star their Behaviors, Carvers ends, he gets his flow going again which causes a restart of the behavior, but when he does that Grunfeld's flow player is going again as well which causes his Behavior to start agiain before the previous one was done. His flow player should still be waiting for the callback from his own Behavior before continuing, but it's being continued after Carver restarts his (part of why I think this is what's happening is that the time stamp for both Carver and Grunfeld's 2nd start is the same. You'd expect it to be the same the first time but the 2nd time they should start at different times unless the randomizer happened to choose the exact same values, which would be rare since it's a random float). The error message is something I put in the code. I set a flag to true at the start of the Behavior coroutine and set it to false at the end, so in the FlowHandler() code if you're trying to start the Behavior again before it's finished it lets us know. So the error shows up before Grunfeld starts his Behavior again, which he shouldn't because his Behavior hasn't finished yet, only Carvers. If you stop and start the scene multiple times the error switches back between the two characters. This is the part what I think Grunfeld's flow player is getting restarted by Carver's flow player, which doesn't make sense because they each have their own flow player on their game object, but they share the same AI frag.
Now if I make a duplicate copy of the AI frag and have each NPC's ArticyFlowPlayer start on one of the two individual nodes (NPC Crew 1 and NPC Crew 2), you get this:
![Image](https://i.imgur.com/JSGToMa.jpg)
This is the expected behavior in that each Behavior starts, runs, ends, and repeats all without the the Behaviors not starting until the previous Behavior finishes (note how the time stamps for every start after the first are different due to the random times involved with the Behaviors).
So this is pretty much a cleaner test of what I was encountering when I posted the original message about things tripping over each other. It's still very possible that I'm doing something wrong but I simplified the scene so that pretty much Carver and Grunfeld just running their AI loops is all that's going on. I hope this helps and makes sense! Let me know if you need any more info.
Thanks!
-Mike