UE4 AI : What about FSM and HTN?

Hi,

Currently, AI in UE4 is centered around behavior trees. There are also cool tools at our disposal for fundamental AI problems, such as pathfinding.

I am currently working on a HTN implementation for students, and I decided to take a look at what was planned. Nothing on Trello, but I saw this link where MieszkoZ says that there are “plans” for FSM and HTN. But this was 8 months ago.

May I ask if there has been any progress?

Ping for update =)

I don’t think there is anything planned in the immediate future. The trello is somewhat in line with their current priorities. I’d recommend adding AI and/or other tags as Mieszko answers questions based off the tags.

We do plan to eventually add FSM and HTN implementations, but it’s not going to happen anytime soon. If you wanted to do that I encourage you to reuse our BrainComponent just like our BT implementation does. If you ended up writing something yourself it would be awesome if you could share it via github PR :smiley: And let me know if you run into any issues while doing that (the HTN part, not the github :wink: )

Cheers,

–mieszko

1 Like

I know, really a very very old thread, but I just wonder how official status looks like. I’m asking, because I kind of got into problems doing my logic with BTs. Whenever doing logic, I come to a point, where I feel like being pressed into a schema to implement simple things. Sure, at many points I find, how stuff can be done in a much smoother way using the provided BT functionality, but changes in the BT generally are really difficult and I believe, that I’ve found one of the reasons now when watching AI Arborist: Proper Cultivation and Care for Your Behavior Trees - YouTube (apart from the fact of course, that I still might do some things not the correct BT’ish way yet)
Especially that point in 37:20 - it is that cyclic vs. acyclic problem, which is well explained in that video makes me believe, that BTs alone are not the best way to go.

Now, searching more into the direction of hybrid approaches, I found quite some stuff. Need to go deeper into it, and I learned, that this AI topic is a huge field of research.

HTN - this in my understanding is like BTs, but the tree is calculated in advance and only returns a list of actions to the caller, who himself is now responsible for executing that task list, while BTs include the execution while traversing the tree. Please correct me, if I’m wrong here.

State Machines - many say ‘do not use them, use BTs’ - but as I said, this causes what I called pressed into a schema - and the above video has good examples for this.

During my search, I found these plugins:

  • Epics HTNPlanner plugin - it’s still experimental for years and I found, that source code is more or less just a skeleton that might have been the start for something years ago, but to me it looks like this has been dropped.

  • HTN Planner on Marketplace by Mads Maisak. Checking the tutorials on this, it has the same look and feel like Behaviour Trees in UE4 (decorators etc), basically doing the same, using the Blackboard, having decorators with same logic.

  • Then, on the State Machine side, there’s Logic Driver Lite on the MarketPlace. This one looks very interesting and I will give the Lite version a try. The Pro version even got an Epic Megagrant

I wonder, what the plans are by Epic. BTs seem to be the way to go, correct? Any plans for such hybrid approaches?

I will definitely go deeper into BTs and study the Lyra AI as well.

Thank you for some thoughts on this.

I found the following, which is also very interesting regarding the topic of BTs and alternative approaches.