4.1 Behaviour tree movement issue

Hi Peeps!

Getting a rather annoying issue that wasn’t happening in 4.0.2 - the below blueprint is sent through a Behaviour tree - the tree is still firing correctly as the print string is displaying upon each spawn of the enemy - however they are no longer moving toward the player character as before.

All I want them to do is move towards the player character until they reach it. The collision and other stuff is still working.

Any ideas?

Blueprint:

My very fist guess would be that pathfinding fails due to projecting destination (or start) to navmesh failing. There has been minor changes to related code and it seems it’s a bit more strict now. If that’s the case the easiest way to address it would be to expand navigation query extent and that can be done by adding following to your DefaultEngine.ini:

[FONT=Lucida Console][/Script/Engine.NavigationSystem]
SupportedAgents=(DefaultQueryExtent=(X=278,Y=278,Z=250))

FYI, there are other parameters a supported agent can specify. And you can have more than one witch will result in multiple navmeshes, one per unique supported agent.

In general the best way to debug AI issues is to use VisualLog. It’s not perfect (it’s a tool for coders by coders, so… you know… :wink: ) but it’s irreplaceable when it comes to tracking AIs’ state in time. Just run console command “vislog”, press “record” and start/continue playing. Let me know if you find anything interesting! :slight_smile:

1 Like

Thanks, would really like to find a way to solve it in blueprint but I’ll try the fix suggested and let you know how I get on!

I’ve tried adding that o my DefautEngine.ini and still no luck :frowning:

I’m still getting issue, its a rather odd one. I was trying to see if I could set up just on the AI controller, yet when I’ve removed the Behaviour tree from the ‘Spawn AIFrom Class’ node it has completely stopped the spawning of the pawn class pin too.

certainly wasn’t the case in 4.0.2 - Is part of a wider issue? I’m worried at point if there is something out of my control/knowledge preventing me from progressing here.

EDIT: I’ve now fixed the spawning and need assistance with the moving again. time no Behavior Tree. I have ran a print string from the player location I’m using, and there is a value there for the AI to go to. Really concerned that porting my project has broken something major within it. Desperate for feedback as soon as possible!

I checked my project in the new version, 4.1. All the AI and pathfinding plus the Behavior Trees are working fine.

I think you may have a problem with your assets or navmesh that is nothing to do with the new version. Sorry, I can’t guess what that problem is.

After porting my project to 4.1 I noticed movement issues as well:

MoveTo task in BT does not work for me
Move Directly toward BT task does work
Simple Move To blueprint function does not work if i try to make my own movement blueprint task
Here’s my behavior tree, if Move To is replaced with Move Directly Toward the AI moves to the destination but gets caught on walls

is a project based on Blueprint FPS game.

[=;23920]
After porting my project to 4.1 I noticed movement issues as well:

MoveTo task in BT does not work for me
Move Directly toward BT task does work
Simple Move To blueprint function does not work if i try to make my own movement blueprint task
Here’s my behavior tree, if Move To is replaced with Move Directly Toward the AI moves to the destination but gets caught on walls

is a project based on Blueprint FPS game.
[/]

Thanks for the information Jordan, more than anything its nice to know I’m not alone with issue. I can strike out it being an issue with my blueprint functions finally.

I have PM’d you. Please respond asap :slight_smile:

ok, so trying to test out what could be broken I found some sort of work around…

So I created a new project in 4.1 that used the FPS blueprint template. I made a simple AI that’s BT uses move to to move it to a hard set location. It worked fine… which never worked in my 4.1 converted project… So I migrated that content to my original project I’d been working in and it worked in there…then I switched to my AI that hadnt been working and the move to function began working… So i’m not sure if it’s related to creating a new project in 4.1 or migrating content from a newly created 4.1 project but there’s certainly some funkiness going on

[=;23922]
ok, so trying to test out what could be broken I found some sort of work around…

So I created a new project in 4.1 that used the FPS blueprint template. I made a simple AI that’s BT uses move to to move it to a hard set location. It worked fine… which never worked in my 4.1 converted project… So I migrated that content to my original project I’d been working in and it worked in there…then I switched to my AI that hadnt been working and the move to function began working… So i’m not sure if it’s related to creating a new project in 4.1 or migrating content from a newly created 4.1 project but there’s certainly some funkiness going on
[/]

Ok I’ll give a try, but just so I know I’m doing exactly what worked for you, can you post the BP you setup in the ‘new’ project and how you migrated it? cheers!

I created a character and gave it some skel mesh.
created blackboard with one vector called dest
created behavior tree
created task called setDest, it set blackboard vector value as 0,0,0
behavior tree was root->sequence->setDes, MoveTo with Dest as the destination

then to migrate I selected all those assets in the content browser right click> Migrate then selected the content directory of my project

Some additional information:

I remember when I first upgraded the project to 4.1 some of my tasks didnt work. I opened up the blueprint and for the execution and finish nodes instead of referencing self, they referenced some long name, and I had to replace the nodes to get them working again.

[=;23934]
I created a character and gave it some skel mesh.
created blackboard with one vector called dest
created behavior tree
created task called setDest, it set blackboard vector value as 0,0,0
behavior tree was root->sequence->setDes, MoveTo with Dest as the destination

then to migrate I selected all those assets in the content browser right click> Migrate then selected the content directory of my project

Some additional information:

I remember when I first upgraded the project to 4.1 some of my tasks didnt work. I opened up the blueprint and for the execution and finish nodes instead of referencing self, they referenced some long name, and I had to replace the nodes to get them working again.
[/]

So for example the Event Begin Play etc?

Well I’ve tried all suggested and still not working, I’ve also uninstalled and reinstalled both 4.0.2 and 4.1 to make sure there wasn’t anything corrupt. issues is happening with all new blueprints, so I’m now paying for something ultimately useless to me

[=;24005]
Well I’ve tried all suggested and still not working, I’ve also uninstalled and reinstalled both 4.0.2 and 4.1 to make sure there wasn’t anything corrupt. issues is happening with all new blueprints, so I’m now paying for something ultimately useless to me
[/]

Ok I may have been hasty - after running a vislog I’ve finally sourced the issue, the move to location node I’m using is failing to project my destination location to the navmesh

I’ve already tried making a new navmesh and getting the same issue from the vislog. I feel like I’m getting close to sorting this. Just need that last bit of help please! :smiley:

Could you paste a change you did to your ini file here? What you describe should get addressed with a change to navigation query extent. If you’d be willing to share a saved vlog file I might be able to help more :slight_smile:

Also make sure your navmesh is present in game at all. Just run “[FONT=Lucida Console]show navigation” console command.

What size is the character’s capsule?

[= ;24460]
What size is the character’s capsule?
[/]

Capsule Size is 344 by 130

show navigation shows the green on the floor.

Link to Vlog

[=;24621]
Capsule Size is 344 by 130
[/]

That’s pretty big :slight_smile: In case you need bigger navigation query extent, like this (in DefaultEngine.ini)


[/Script/Engine.NavigationSystem]
SupportedAgents=(DefaultQueryExtent=(X=500,Y=500,Z=350))

or something along these lines :slight_smile: I assume is AI’s capsule. What about the player? The same? Where do you send your AI. Are you sure location is on the navmesh? How about posting some pictures? :smiley:

I took the size of both the capsules back to default, everything is now working. Can’t believe that small issue sent me on journey. but at least its working now! I can finally get cracking with my HUD! :smiley: So no doubt I’ll be speaking to you all very soon!