HTN Planning

AI Programmer

For my Graduation Project (half a year) I decided to dive more into an AI controlling architecture, as I am very interested in creating behavior for the AI’s. Looking into games such as “Horizon Zero Dawn” and “Transformers: Fall of Cybertron” I first heard about HTN Planning.
From there it caught my interest and I decided I wanted to learn more about this, therefore I created a simple implementation of HTN Planning with as intended outcome to learn about the architecture such as its possibilities and limits.

Project Information

Development time

20 Weeks (Ongoing)

Made in

Unreal Engine 4 C++

Team Size

1 Person

Supported Platforms

PC

Released on

N/A

The code for this project can be found on my Github

Blueprint Network Defining

For this project I wanted to be able to easily create networks. Unreal’s blueprinting system is perfect for quick creation and iteration of code. Because the network consist out of only two arrays that hold the composite and primitive tasks, we can use the blueprint for easily defining our network.

Blueprint Operators

In HTN Planning, executed actions are expressed in an operator paired with a parameter that is passed in to the operator.

On the right you can see a simple NavigateTo Operator. Depending on the passed in parameter (which is a worldstate enum value) we tell the agent to move to the corresponding location.

Testing

To ensure the functionality of the planner throughout development, I have written numerous tests that test different aspects of the planner.