Problems when spawning multiple AI - Multiplayer

So I’ve been working on AI for our game and got it mostly working(I thought so at least) but when I try to spawn more than one AI-character there is some kind of conflict. It is as if the characters are sharing variables.
What happens is the one character sees the player and triggers the chase behavior. But if the other AI is turned away he chasing player will stop almost right away.
I’m not sure where in the code I have messed this up but I am hoping this is a common problem when working with AI in Multiplayer.

I found a thread that said that Black Board Keys shouldn’t be set to “Synced”. But none of mine are.
The Enemy Character and AI controller is set to replicate.
I recorded a clip of what this looks like, my mic wasn’t recorded but maybe it will give some insight anyway.
https://youtu.be/vZLdWL4-cGM
Does anyone have any idea of what might be wrong?

Hi,

didn’t see that in your video, I just saw one AI following the player around. So I guess I didn’t understand the problem, could you describe maybe in different words what your problem is?

Also you seem to be replicating things in the AI controller, the AI controller only exists on the server. They do not exist on clients, therefore nothing there will ever replicate and using replication there is meaningless (ofc it will still work as normal, but the replication will just do nothing). Since behavior tree and blackboard are also inside the AI controller that means they also won’t exist on clients. So its not like you’re doing anything wrong with marking things replicate there, it just won’t do anything and is therefore wasted code.

I’m not sure where in the code I have messed this up but I am hoping this is a common problem when working with AI in Multiplayer.

AI normally hasn’t anything to do with multiplayer since all the logic is server only (ofc if you use something like GetPlayerPawn with index 0 in your AI logic then that will break for more than one player but only since you will always just get the server one).

Thanks for the reply!

I removed the replication stuff and replaced the notifies with regular functions.
I tried a lot of debugging with printstrings and so on and I couldn’t nail down the issue.
I was under the impression that the AI-Characters where sharing data in some strange way.
It turns out there where some other issues.
The main issue was the AI sensing was losing track of the target very easily. I increased the time before the sensing was forgotten.
And also I was using on “result change” for aborting the patrol and chasing the player. This made it so that after some rounds of chasing the AI stopped chasing the player.
I changed this to “on value change” and now it works better.