AI doesn't move in packaged game

Hello guys. I’ve recently upgraded my project to 4.8 from 4.7 and now my ai character just doesn’t want to move in the packaged game. There is no problem when playing in the editor. I tried to visualize the navmesh in the packaged game by executing the blueprint node “Execute Console Command” with command “show navigation” but doesn’t show anything (btw I don’t know if this is available in a game packaged with shipping configuration).

Thanks,

Gabor

2 Likes

Hey EasternWize,

Thank you for bringing this to our attention. Are you using custom AI or are you using AI from one of the templates or learning projects we have available? Are you able to replicate this AI issue with a regular Unreal Engine 4 template? Have you tried copying your project to a 4.9 Preview 2 version to see if the same issue persists?

Looking forward to hearing back from you, thanks!

Hi ,

Thanks for the quick response! I’m using custom AI. Tried it with 4.9 preview 2 with same results. Works in editor, doesn’t work in packaged game. I also tried packaging the example project posted here: [Behaviour trees support stream][1] and it seems that it’s fine. I think I’m gonna check my behaviour tree.

Support Stream – Behavior Trees – March 10th, 2015 - Announcements - Epic Developer Community Forums

So, in the project settings under Navigation Mesh I checked Forced Rebuild on Load and changed Runtime Generation to Dynamic (same as in my RecastNavMesh-Default) and tadaaaa… now my AI started to move in the packaged project.

4 Likes

Glad to see that your AI is finally working. If you happen to have any further questions, let us know!

Have a great day!

I might have a similar issue, AI moves fine on editor, but when I launch the game the issue comes, sometimes in the first level, but sometimes the first level works, then the AI will be freezed on the second level, if I change the project settings, Runtime Generation to Dynamic and check forced rebuild on load, the AI moves, but spinning like crazy, with difficult to continue towards the player as it does fine in the editor. I need help!

There is apparently a bug with Navmeshes in packaged builds in 4.21.0 that may be what you are seeing.

There are gaps on the edges of every tile that the AIs cannot path over. One hopes this will get fixed rapidly - unfortunately there is apparently no way to see the bugs that have been submitted on this right now, but you can see the problem discussed here:

I did the sam ething but did’nt worked for me and I’m using UE4 4.21

2020 and still having this issue. Thanks for coming back and leaving your resolution Gabor D. This just fixed it for me also…

2021 and it’s broken again

2023 and it’s still broken…

I ran into this same issue using 5.1. In the editor everything works fine. In packaged builds the AI movement “rubber bands” on the clients.

I was calling UGameplayStatics::OpenLevel and passing in the host’s IP to join in packaged builds and I was get the rubber band movement on AI controlled characters.

If I use the OnlineSubsystems (I have only tested Steam) the problem goes away and the AI controlled characters move as intended. In the long run this works for my particular situation by does slow down the development process.

This is the first hit on google so I will type my solution:
So the issue was that in a packaged build my behavior tree wasn’t working sometimes but always failed the move to.
It had a service to determine a random location.
The navmesh existed and worked with non BT ai move to nodes.
When testing if the air existed and possessed it was true.
Afterwards I checked if the BTS fired. It did.
However the blackboard values were all floatmax.
It turns out that since one of the value failed to get registered correctly, it would all fail. ONLY IN PACKAGED BUILDS. IT WORKED FINE IN PIE.

So the solution was to set the values in the BTS by casting to the owner and getting the blackboard all set first before using them.
I also had to create a service to figure out my enums in the first selector as well.
Again, no issues in editor; fails in packaged build.