XML Behaviour Trees

Whilst working on Relative Disruption, I decided to improve the gameplay experience by creating Behaviour Trees for the AI. I developed this as a third party tool which could be added to the engine, and utilised reflection within C# to allow information about the trees to be serialised as XML and run. In short, I made the trees flexible enough to be run with any Unity game.

The tool is currently available on the Unity asset store, and recently had some bug fixes and updates to the UI to ensure that users could modify the XML using a GUI in the Unity Editor.

The video demonstrates behaviour trees being used to show a piece of AI running through hurdles and performing multiple laps, before proceeding to celebrate their finish. This behaviour tree supported the following nodes.

  • Selector
  • Sequence
  • Parallel
  • Inverter
  • Repeat
  • Leaf
  • Conditional

Where a conditional node is a custom type of leaf node that would fail if a boolean returns false.