[Twitch] Support Stream - AI - Dec. 2, 2014

Senior AI Programmer Zielinski takes us through behavior tree services, EQS (Environment Querying System), navmesh generation, and answers your questions on AI.

Tuesday, Dec. 2nd @ 2PM ET - Countdown]


Zielinski - Senior AI Programmer
Palomino - Developer Support Manager

Feel free to ask any questions on the topic in the thread below, and remember, while we try to give attention to all inquiries, it’s not always possible to answer’s questions as they come up. This is especially true for off-topic requests, as it’s rather likely that we don’t have the appropriate person around to answer. Thanks for understanding!

EDIT: The YouTube archive is up here](- YouTube)

Also - is joining us on Thursday to continue the discussion. Come join us!

What bonuses (if any) are there to using Behavior Trees as opposed to creating the logic in the Enemy Parent Blueprint?

(I currently created it all in the Parent class and I was wondering if there were any bonuses to moving it to behavior tress…cheaper, faster, etc?..)


At the moment it’s only possible to specify how frequently a Service in a Behaviour Tree repeats itself in seconds. Would it be possible to be able to have an option to specify this in ticks and also limit the total amount of services that take place during a tick of the game so that it’s possible to optimize AI further without digging into C++?


Nav Link Proxyies only allow AI to jump down from ledges & platforms. Will there be an added feature allowing AI to jump up to a platform as well?


Whats the “optimal” Way to handle a behavior tree? right now my current BT is mostly composed of BT Tasks and a few decorators ( mostly to go a different path if a specific bool is set etc ), When shouldother nodes besides Task be used? ( Parallel, services etc ) a example scenario would be appreciated


  1. Are there any implementations of steering behaviours in UE4, to handle navigation of big groups of agents. Also, what would be the best approach to design AI for big groups of Agents in UE4?
  2. When will you continue your awesome blog?
  3. Will there be more AI examples in the future? Like Example projects that focus on AI.

Hey guys… got a few:

I’d like to have a priority selector and some kind of floating point value returning decorators (i.e. returning a utility value) instead of the default boolean condition based decorators, is this possible, if so how would I ensure that the priority selector would be run at a given update frequency?

I really need some way of handling when a subtree gets overridden by a higher priority tree so I can do some cleanup. Can we have a cleanup callback into blueprint as the subtree gets changed so I can reset values in the blackboard :wink:

Can we have access to set blackboard values on startup/default.

What is the status of navmesh support for large world?

Got to ask about documentation. Can we have some official organized docs at some point?

There seem to be some issues with the BT editor during debugging, in that sometimes it keeps focussing on a specific node no matter which nodes are actually being activated.

On a similar note, the BT editor doesn’t seem to single step as you would expect. Its almost like its not evaluating the nodes in the correct order sometimes.

How easy would it be to have arrays inside the blackboard? i.e. so we can have an array of enemies within the blackboard as a single array-type value (much as in variables in blueprint).

I’m sure I’ll think of more on the night :slight_smile:


Hey Phil, I seen your question and I needed something similar to check nodes results. What came after was to use a Decorator which can report back the results of the node its attached to once the node finishes execution. This event within the Decorator is called the Event Receive Execution Finish, returns Node Result enum which you can Switch on. The enum breaks down 4 different states; Succeeded, Failed, Aborted, or In Progress.

So I have a decorator on a node which tells the AI to move to the next route(increment bbdata int route up) if it finishes it current route successfully. If it aborts in your case, it can call functions which do your garbage collection.

I hope that is what you’re looking for. :slight_smile:

Hey ,

Yeah, I tried the Event Receive Execution Finish. Only it didn’t happen ;), seems its wasn’t called on the subtree nodes that were “subsumed”. I think it might work in your case because you’re running it on the executing node, where as I need to run it on the parent node (so that anywhere it needs to quit out of that subtree I should reset my value).

Unless Mieskzo fixed it and I’ve missed the fix :slight_smile: which is pretty likely as I’ve not updated UE versions yet (I wanted to make sure I used the same versions for my tutorials rather than switching over mid-stream).

Maybe I’ll update when 4.6 comes out and is stable and update my tutorials a bit.

Looking forward to watching handle a stream :slight_smile:


Interesting, would you mind showing me a sample of what you have setup? I’m trying to recreate your scenario so that I can see the problem too. I have 3 branches, so 3 separate subtrees. I have a callback decorator on a subtree within one of the trees, not on any of the branch nodes. When my bot switches states, and the subtree’s subtrees are ultimately aborted out. I still get notifications of the aborts. So let me know if I’m doing something different.

Hey , its quite likely been fixed in newer versions of the engine. I had a blackboard value that I was using to control a condition on one of the subtrees, when I ran a higher priority subtree I wanted to capture that so I could null out the blackboard entry for the currently running tree just before it switched context to the new subtree. So I think it was the EnemyTarget blackboard actor value I wanted to set to NULL if I ever aborted the subtree that dealt with Enemy attacking (so for instance if I had ran a higher priority tree when the AI got too far away from its guard target). The problem was that the Execution finish nodes weren’t being activated (I had a cleanup decorator on the subtree so that no matter where I was in the tasks of that subtree if the subtree was subsumed for any reason I could clear the Enemy Actor value out).

I’ll test something similar sometime next week and see if its been fixed as it felt like it should have received the execute finish for EACH node in the subtree.



What is the PROPER way to generate NavMeshes? I ask this because I installed one in my level and now every time I start the editor, I get a message that the NAV mesh is being re-generated and I have to wait about 5 minutes before the thing finishes its computations. Is there a way to just do this when the level is built rather than everytime the level is started or played?

See this questions/102662/my-navmesh-needs-to-get-rebuild-after-i-reload-a-m.html

Hello, i waiting this stream.
My Questions:

  1. When users can see fixing this very bad bug?: questions/102662/my-navmesh-needs-to-get-rebuild-after-i-reload-a-m.html
  2. Save/load navmesh … Please add “Save/load navmesh” in Editor. Ie, saving and loading navmesh in a separate file (example .unavmesh), separate from the “.umap” level file. It’s very useful!
  3. When users can see “different-sized agents support on a single navmesh”, add in close future or in 2015?
  4. When users can see DetourCrowd in Editor (without use C++ code)?
  5. AI work plans on future 2015?


For “UE4 AI noobs”: interesting UE4 AI future - AI section in Trello


Does it require a special system to create AI for an open world game where pedestrians walk on the curb and cars follow the traffic laws? Or can this be done using just the systems available that would normally be used for regular AI. And how efficient would something like this be when it’s fully made with Blueprint, or if it’s made in C++ but expanded with Blueprint? For me, it doesn’t necessarily need to be incredibly realistic, but a system where cars follow the basic rules and pedestrians don’t walk on the road would be enough.

I second this. large numbers of agents are essential for most RTS games now. Having even 100 guys running around has them rubbing against each other even with the Detour system.

Still Component Based?

A while back I was told on github that the AI system was being revamped to use BP components and a more component based approach.

I’ve been hesitant to do a lot of AI coding because I am worried that Epic is making a big internal shift that would force me to rewwrite a lot of code.

What is the status of this shift?

Is it still going on?

In other words, will PathFollowingComponent and NavigationComponent still be around for a long time, so I can code with them comfortably?



PS: I say hi in advance to on the stream!


  1. Is there any way to get the pathing system to ignore Z-difference when pathing to the next Immediate Move Destination. Sometimes agents step above and over a link in the path and this causes jitter (turning a corner that’s higher and sloped, for example) because he jumps over the move destination and then tries to go back over it.

  2. Do you have best practices for getting a character to only move forward in the direction he is facing while using navmesh pathing? I’ve tried “Orient Rotation to Movement” and such, but that just makes him turn in the direction he’s facing, rather than slow his forward movement down while he’s turning. I basically would like to keep him only moving straight ahead, while also only pathing on the navmesh (which would require the path to constantly update I’m sure).

  3. Rama has done some work making agents dynamically path and jump in Unreal (hi Rama). Do you have any suggestions on what C++ classes and such we should look into to extend the navigation system like Rama has? I assume it’s the PathFollowingComponent and NavigationComponent as he stated in his question above, but… yes I would also like to know if this stuff is being rewritten.

  4. As mentioned here, do you have any information on prioritizing navmesh generation at runtime? I currently have agents waiting to move when the game starts because our (world) mesh (and subsequently the navmesh) is being generated at runtime.

Another question: If you had an unlimited amount of time and money, what sort of features would you add first to UE for AI?


Whats the best practice for generating navmesh in a large world. Is it possible to generate multiple navmesh sets with separate volumes and only talk to the navset you are in for things such as A*?