Heirachial Task Networks (HTNs) have long been favoured over more emergent and fully autonomous methods such as GOAP for its ability to apply a more deterministic approach to planning such that it achieves coordinated autonomy but with elements that can vary (in well-defined ways), over approaches such as GOAP that organically behave in whatever way allows a target goal to be solved. Indeed, it could be considered that the extensive autonomy of LLMs is what causes them to be as variable and unpredicatable as they are.

HTNs are composed, as the name suggests, of a heirachy of tasks which decompose the problem to solve. Primative tasks form the leaf nodes in a similar fashion to action nodes in Behavior Trees, and correspondingly they perform actions/tasks which modify the environment during execution.

Like Behavior Trees an aggregate node called a compound task can be composed of multiple nodes forming a subtree. The composition, heirachy and conditional selection of tasks establishes a variable plan but remains within the confines of the expected intention of an overal predefined plan.

HTNs

A key aspect in HTNs is the conditional selection of a sub-tree (often called the method) within the compound task. Methods can be chosen based on the situation the agent is experiencing. This means diffirent selections of the sub-tree (methods) can execute depending on the sitation, providing a variation of the plan based on the situation. The tasks that make up the sub-trees are added to plan which is then carried out.

These algorithms allow for the execution of pre-built plans with internal component variability. This means plans are created with pre-defined alterative methods that can be activated/deactivated such that the enviorment’s circumstances can trigger a specific ways the plan it carried out in various circumstances. The overall plan however remains the same - only its specific method selection varies.