Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

readme.md

Get started with Behavior Trees

In this tutorial, you’ll learn how to implement a basic behavior tree in Unity

You will need Unity 2020.1.13f1 to follow along. This tutorial assumes knowledge of C# and Unity.

This tutorial uses Behavior Tree Visualizer, an open source tool to help view and debug trees.

Writing a good AI is challenging for many reasons. Not only do you need it to be believable but also easy to maintain. It can grow along side your game, getting more complex as each new feature is added. Behavior trees are an AI technique designed for just that! It is a modular AI framework that works great for more complex AI logic.

You will write an AI that will pick up all objects in the scene by navigating to random way points. At the end of this tutorial you will have fundamental knowledge of how a behavior tree works and will have created foundational nodes that can be reused in all your future projects.

BTG Example

Learning Outcomes

You will learn:

  • What a Behavior Tree is.
  • About the guiding principles of a Behavior Tree.
  • The different types of nodes and their purposes.
  • How to create the fundamental nodes using inheritance.
  • How to drive the AI behavior within Unity.

Prerequisites

  1. Knowledge of C#.
  2. Unity 2020.1.0f1 should be installed.
  3. Download the starter project from the GitHub repository.

Table of Contents

  1. Getting started
  2. Understanding Behavior Trees
  3. Creating the base node
  4. Creating general composites
  5. Creating general decorators
  6. A closer look at the demo project
  7. Creating conditions
  8. Creating actions
  9. Building and running the Tree

Resources

  1. Behavior Tree Visualizer