Hierarchical Finite State Machine for Abilities

Hi, Justin,

Looking through the Ability system, it makes me realize that it's is actually the same thing as HFSM.
Abilities can have several dependencies and require a certain order in which it needs to execute but without HFSM visual representation, it's really hard to follow what's going on.

I guess, it may not be that difficult to maintain right now but it seems to me already getting a bit too complicated.

I can see that you want to have many new abilities in the future and I'm sure it will break stuff very easily if you are not using it a certain way, let alone for users to figure out what's going on.

So, to share my opinions and for future development, I think it's will be much easier to solve Ability system by HFSM.

HFSM basically has layers of state machine. At the bottom, you will have the common states such as Damage, Death, Idle, Walk, Run, Jump. This layer handles high priority event independent of what state you are currently in, therefore it simplifies each state to handle the common events.
And you add new functionalities to layers on top of them.

I guess it's not that hard to see what HFSM does and what gets interesting is that you can have both HFSM and Behavior Tree to work together.

Each state sometimes needs to have sequences of State if it needs to execute certain state in-order. BT can be used handling such sequences of actions.

Therefore, BT can be embedded into one of the State. Not only that but HFSM system can be embedded into one of the BT Task.

This will create a very powerful system that can represent almost anything and I've successfully been able to create such a system in the past.

It will also let you make very complicated melee combo action games.

You already have BT framework(BD) and adding HFSM would not be that difficult. And then perhaps add BD lite version for UCC users to use it and for more functionality user will have to buy normal BD.

It's something to think about and I'm sure it will save you lots of time down the road adding new Abilities and bring additional sales.



Staff member
This is an interesting idea but realistically I don't think that I'll be able to look at it for at least a couple of years. Our internal roadmap is pretty full right now :)
Sure. That's fine but trust me, it will help you save many hours down the road. Having 20 or 30 future Abilities interacting with each other and executing in a certain order will become unmanageable without having some visualization tools, just like writing BT only in code.