# UE4 AI : What about FSM and HTN?

**URL:** <https://forums.unrealengine.com/t/ue4-ai-what-about-fsm-and-htn/308592>\
**Category:** Platform & Builds\
**Tags:** State-Machine, artificial-intellige, unreal-engine, question\
**Created:** [March 1, 2015, 1:52pm UTC](https://forums.unrealengine.com/t/ue4-ai-what-about-fsm-and-htn/308592 "2015-03-01T13:52:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fezvez\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fezvez\_1](https://forums.unrealengine.com/u/Fezvez_1)\
**Post date:** [March 1, 2015, 1:52pm UTC](https://forums.unrealengine.com/t/ue4-ai-what-about-fsm-and-htn/308592/1 "2015-03-01T13:52:26Z")

</div>

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](https://answers.unrealengine.com/questions/15160/where-is-ai-documentation.html) 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?

---

<div class="post-metadata">

**Author:** ![Fezvez\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fezvez\_1](https://forums.unrealengine.com/u/Fezvez_1)\
**Post date:** [March 3, 2015, 1:52am UTC](https://forums.unrealengine.com/t/ue4-ai-what-about-fsm-and-htn/308592/2 "2015-03-03T01:52:19Z")

</div>

Ping for update =)

---

<div class="post-metadata">

**Author:** ![anon26705860](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon26705860](https://forums.unrealengine.com/u/anon26705860)\
**Post date:** [March 3, 2015, 2:42am UTC](https://forums.unrealengine.com/t/ue4-ai-what-about-fsm-and-htn/308592/3 "2015-03-03T02:42:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MieszkoZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MieszkoZ](https://forums.unrealengine.com/u/MieszkoZ)\
**Post date:** [March 3, 2015, 4:55pm UTC](https://forums.unrealengine.com/t/ue4-ai-what-about-fsm-and-htn/308592/4 "2015-03-03T16:55:59Z")

</div>

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 😃 And let me know if you run into any issues while doing that (the HTN part, not the github 😉 )

Cheers,

–mieszko

---

<div class="post-metadata">

**Author:** ![herb64](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@herb64](https://forums.unrealengine.com/u/herb64)\
**Post date:** [September 15, 2022, 8:35am UTC](https://forums.unrealengine.com/t/ue4-ai-what-about-fsm-and-htn/308592/5 "2022-09-15T08:35:24Z")

</div>

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](https://youtu.be/watch?v=Qq_xX1JCreI) (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](https://www.unrealengine.com/marketplace/en-US/product/29560d88937e4cd1a435f4b634890655) 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](https://www.unrealengine.com/marketplace/en-US/product/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.

---

<div class="post-metadata">

**Author:** ![herb64](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@herb64](https://forums.unrealengine.com/u/herb64)\
**Post date:** [October 2, 2022, 10:56am UTC](https://forums.unrealengine.com/t/ue4-ai-what-about-fsm-and-htn/308592/6 "2022-10-02T10:56:57Z")

</div>

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

> **[Common issues with Behavior Trees and things you should competely avoid. |...](https://dev.epicgames.com/community/learning/tutorials/L9vK/unreal-engine-common-issues-with-behavior-trees-and-things-you-should-competely-avoid)**
>
> This article explains basic do's and dont's about Behavior Trees that majority of community missing.
