
Managing AI in Gigantic - forrestthewoods
https://gamedevdaily.io/managing-ai-in-gigantic-523dc84763cf#.gsumjo9oj
======
whitten
They state that Behavior Trees provide the same functionality as Finite State
Machines, however since there appear to be no loops (remember they are a tree)
how would you handle iteration or recursion ?

Finite State Machines don't have memory per se, but duplication of states can
create the illusion of memory. if you have five states in a row that expect a
particular situation/sequence, then this could emulate a counter up to five. I
think this could be done with multiple states in a behavior tree. But a FSM
could have a physical loop back to a previous state which would emulate an
unknown number of states. I don't see how to do this with Behaviour trees.

I'd like to see more details, and of course, if anyone actually has used
these, I'd like to hear how repetition is supported, or even time varying
values.

~~~
forrestthewoods
To handle loops I believe most implementations have a "restart on complete"
flag on trees or nodes. So if the first node was a sequence node you could set
it to start back at the first node after the last is done.

There's a second post that may answer some of your other questions. "Advanced
Behavior Tree Structures" [https://gamedevdaily.io/advanced-behavior-tree-
structures-4b...](https://gamedevdaily.io/advanced-behavior-tree-
structures-4b9dc0516f92#.djupivlag)

Unity has a decent behavior tree plugin called Behavior Designer. I've only
used it a tiny bit so I'm still getting a grasp on what it does and does not
handle well. Poking at it, or simply it's documentation, may also help.
[https://www.assetstore.unity3d.com/en/#!/content/15277](https://www.assetstore.unity3d.com/en/#!/content/15277)
[http://www.opsive.com/assets/BehaviorDesigner/](http://www.opsive.com/assets/BehaviorDesigner/)

