AI MoveTo not working properly in built game vers

I have some simple “MoveTo” functions in the Behaviour Tree and it all works fine when running in the editor version of the game. But as soon as I build a final version of the game and try it out, enemies just stand around most of the time, not moving at all. Other tasks and services do not seem to have any issues.

I’m using 4.7.2

Is this a known issue? If so, when can we expect a fix for this?

Thank you very much.

Hi Blue669,

I was not able to reproduce this issue in a new project using some basic functions to find a random location on the navmesh then move to the location. Could you provide more details about your Behavior Tree and how you are feeding information into the Move To? Screenshots may help with this. Also, if you create a package a Top Down project (just the default template), can the character move in that? Knowing if the Top-Down character does not move would help determine if AI movement is working at all.

Also, did you download the engine from GitHub or the Launcher?

Thanks!

I’m using the Launcher version.
Maybe this problem has to do with the fact that the AI enemies are spawned from a Blueprint and are not already in the map when it starts?

Here is the setup of my random wander BP, the BT setup and also the way how I spawn the AI enemy in the map.

I am trying this out, but still not achieving what I am looking for. This may come down to an interaction between assets that I am not going to be able to see from here. Would you be willing to share the project with me so that I may look into it directly?

Unfortunately the project is a few GB in size, so it’s not so easy for me to share it.

I’ve investigated a bit further and the problem still exists in 4.7.3.
It seems that the whole Behavior Tree is not run until the player gets really close to the enemy. This only happens to some spawned AI, not all of them. I would say 3/4 are fine.

My greatest concern is that when I run the game in editor mode, everything works 100% of the time without any problems. Only after building a stand alone game this problem occurs.

Are there other people with similar problems? Maybe there is a way to share our experience with the issue to nail it down further.

The questions that I could find that were similar were these:

Unfortunately, neither are related to a difference in packaged games and in editor simulation.

Could you migrate the enemy that is at the root of this into a very basic project and send me that file? I’d like to try packaging the AI myself and hopefully find the cause. If you are not comfortable sharing it here, you could PM me a Google drive download.

I’ve sent you a PM in the forums with a link to the AI files and protoype enemy. Let me know if you need anything else!

Hi Blue, I sent you a response with some suggestions and a request.

Also, there has been a rather critical pathing fix that may be related. The github commit for it is here:

https://github.com/EpicGames/UnrealEngine/commit/40629f0e3f5c6ba1486a7ca44c0b59fabce978a4

I hope that helps, but please let me know if it does not. I will continue discussing the project with you on the PM as well until this is resolved.

Hey , do you think this fix could also fix this problem?

I am not sure if it is going to fix the issue of non-movement entirely, but it will help with a lot of pathing problems. I am recommending it to who is having problems with AI movement.

As for the “aborted” error you are seeing in that post, just absed off of what I’ve read there, it may be related to the building actor’s location not being on the navmesh. This is an educated guess, as I would need to dig into it more to say exactly what the problem is.

I suggest trying the github commit and also see if the actor will not move to an arbitrary point on the navmesh or if it is only trying to path to the building that causes problems. If you think it may be a bug, feel free to move it to bug reports and I’ll assign an AI specialist to look into it.

Let me know if that helps at all.

I have downloaded and compiled the latest 4.7 branch with the fix inside but unfortunately the issue still occurs there, so my problem is not related to the fix :frowning: Moving to random points on the navmesh always works fine.

I’ll continue working with you on the other thread then

Blue669, I was able to use your assets to create a series of AI, but I am still working on testing them being spawned it. I am going to leave this open while I investigate it further.

Not sure if this helps, but I can frequently get this “stuck” behavior even in the editor when playing as client with “dedicated server” checkmarked. When I check the BT, it shoes that it pretty much just skips through every service and move command and only executes waits and other tasks. Blackboard items seem to work properly, vectors, actors, bools and floats are set correctly. With the service and move commands ignored, it seems that it also ignores tick rates, so it runs through the BT at very high speed.

I can make a video of it if that helps.

Hi Blue,

Sure, a video may help. Make sure to include a video of the stuck AI’s BT at runtime so I can see what part of the chain it gets stuck in.

I am now testing this for multiplayer. I have the player spawning in AI at begin play and also pressing a button will spawn in the AI. The Butcher 2 BP is working with the EnemyBT2 randomly wandering. I cut out most of the BT for later tests, as none of it was ever called.

There is a known issue with the “SimpleMoveToLocation” function currently that makes it not receive navigation data on the clients, but I do not this it’s related.

Can you try reducing one AI down to just the wandering and see if that is the root of it for you? If so, can you swap out wandering routines to see if only one is causing it alone?

Thanks!

Hi Blue,

I was unfortunately unable to reproduce the error, but I am happy to continue the investigation once I have these details. Until then, I will mark this as answered for tracking. Please feel free to comment and reopen the question when you are ready.