I am trying to make AI work in multiplayer if there is a way to ensure it running on the server that would be great.
My character and controller are connected and some features do work, i have found that the ai characters can still see my character.
I have set everything to replicates and always relevant for now to try and force it to work on multiplayer (Within the ai character and ai controller)
The movement seems to not work other stuff seems to work (For the most part)
My question is how would I go about forcing MoveTo to replicate/execute on server. I have tried making AI Tasks using switch has authority on moveto to no prevail.
Please do not respond with a quick start guide to AI, I have looked at many guides and answer threads none seem to help.
EDIT AND PLEASE NOTE: All AI functions work in single player, it is not an issue with the actual logic just the moveto functionality or moving in general
I think you are using more variables into the characters, have you tried by setting them to be replicated? I’m not talking about the actors, I’m talking about the position, boolean values, etc.
For example this is a variable:
Please let me to know if that works. If not, I can give you more help
As of now the AI uses no variables within the character. It only uses blackboard variables and one replicated controller variable. Also my issue is not replication as I have been able to confirm AI perception does indeed work. My problem is that the MoveTo function does not seem to replicate/work in multiplayer.
I guess to rephrase is there a way to make sure bb/bt replicates? Like if there is an option.
I know everything is already on the server but I replicated everything again just in case. Is there a multiplayer ai example project or something that I could look at?
My issue is either with AI Behavior Trees or Navmeshes. I checked that page and your advice would help if I was doing something else. Im using AI Moveto.
What works:
Variable Replication
Controller Possession
AI Perception and Replication
What doesn’t work:
AI MoveTo / Pawn Movement Input
My question is not about replication in general its about the specific moveto in the ai behavior tree
People that answer have obviously never tried to get AI to work with multiple people playing. I have an AI that works great when playing as the server but seems to ignore all clients. I am using a vision check via blueprints and not pawn sensing. I will probably have to switch over. Another thing I will try is to code all the AI’s decision making and logic in the AI_Character_BP instead of using a behavior tree.
It’s interesting and I’m going to want your result of trying. Why I say it’s interesting? I bought some AI blueprint asset from marketplace, and everything just worked with multiplayer, which is amazing, yet I don’t know what it did to achieve this, since there’s nothing special I saw, and there was no documentation.
btw I remember from another project that SimpleMoveToActor and SimpleMoveToLocation simply does not work on clients. For that to work there I had to manually get a path and add movement to the Pawn.
I suspect it will be the same issue here
I tried using ‘Simple Move to Location’ instead of ‘Move to Location’ and it works over the net
…
and oddly enough, ‘Move to Location’ seems to also work over the net
Right now I have a homemade ai system done completely in blueprints. It works for multiplayer but I am NOT using any behavior tree. My AI are not the smartest at the moment, but they are able to wander, chase, attack, return to wander, die, respawn, etc.
My next challenge is to create variants of this simple base of behavior. For example a mob that once one “wolf” sees the player, all wolfs around will aggro the seen player. Another example would be to flee when the AI is low on health.
Lastly, I have a dragon that I got on the marketplace for free. It has a bunch of flying animations. I hear that programming flying AI is a total headache. Any good links you guys know of to learn from send my way.