Behaviour Trees (BTs) are an A.I. architecture that provide game characters with the ability to select behaviours and carry them out, through a tree-like architecture that defines simple but powerful logic operations. It can be used across a wide range of game genres from first-person shooters to real-time strategies and developing intelligent characters capable of making smart decisions. The codebase is deceptively simple and yet logical, reusable and extremely powerful. The library is written in C# and implemented in Unity 2020, however will easily port to other applications.
Behaviour Trees (BTs) are an A.I. architecture that provide game characters with the ability to select behaviours and carry them out, through a tree-like architecture that defines simple but powerful logic operations. It can be used across a wide range of game genres from first-person shooters to real-time strategies and developing intelligent characters capable of making smart decisions. The codebase is deceptively simple and yet logical, reusable and extremely powerful. The library is written in C# and implemented in Unity 2020, however will easily port to other applications.
The project has been tested in Unity 6.
In this course, Penny demystifies the advanced A.I. technique of BTs used for creating believable and intelligent game characters in games, using her internationally acclaimed teaching style and knowledge from almost 30 years working with games, graphics, and having written two award-winning books on games AI. Throughout, you will follow along with hands-on workshops designed to take you through every step of putting together your own BT API. You will build the entire BT library from the ground up, while building an art gallery simulation scenario in parallel, to test the API as you go.
Learn how to program and work with:
A Behaviour Tree Library and API that's reusable across a wide range of game projects.
Tree architectures, nodes, leaves, sequences, and selectors that define the behaviour of individual non-player characters (NPCs).
Navigation Meshes and Agents that provide advanced path planning and navigation capabilities for characters.
A Blackboard System that acts as a global inventory for world states and allows characters to communicate with each other.
Contents and Overview
Throughout the course, you will follow along while a BT library and API are constructed from the ground up, to allow you intimate knowledge of the codebase. Alongside this, a simple art gallery simulation will be constructed to test out the functionality of the library as it is put together. The simulation will also rely on Unity's NavMesh System for navigation and path planning.
The course begins with an overview of Behaviour Trees and covers all the fundamental elements (including trees, nodes, leaves, sequences, selectors, and other logical constructs). Code will be developed to navigate the Behaviour Tree and used to drive non-player characters in the art gallery including a robber, cop, visitors and workers. Throughout this, students will gain a solid knowledge of how Behaviour Trees are constructed and can be traversed, to apply actions to game characters.
At the completion of this course, students will have a fully-fledged BT library and API that they can reuse in their own game projects, to provide game characters with complex intelligent behaviours.
What students are saying about Penny's courses:
Turns out, the hardest part of this course for me is finding the words to describe how glad I am to have enrolled in it.
I honestly love Hollistic's teaching approach and I've never learned so much within a few hours about coding effectively with such detailed explanations.
Penny is an excellent instructor and she does a great job of breaking down complex concepts into smaller, easy-to-understand topics.
While this course was developed in a previous version of Unity, we've tested the projects and they work with Unity 6. This video is a guide to help you adjust your learning in this course to use Unity 6.
In this lecture Penny will give a brief overview of the content of the course.
H3D has a bustling online student community. Here's how to get involved.
How to contact us
Important Reading on Common Issues students have and how to ask for help.
In this video students will learn how to setup the AI Navigation package for the versions of Unity that it is not automatically included with. This package will be used later in this course.
In this lecture students will learn about the structure of behaviour trees and the fundamental elements that are used to construct them.
In this lecture students will write the first class for the behaviour tree system that will underwrite the majority of the functionality for the technique.
In this lecture students will learn how to write code to traverse a behaviour tree and print out the structure.
In this lecture students will work begin writing the code for leaf nodes and get their NavMeshAgent character moving.
In this lecture students will create a helpful method to assist in moving an agent around on the navmesh and reduce repetitive code.
In this lecture students will learn how to construct the logic to implement a sequence node.
In this lecture students will learn how to create a selector node and insert it into the behaviour tree.
In this lecture students will learn how to integrate game engine specifics such as navmesh commands with the behaviour tree.
In this lecture students will learn how to create a condition node to add extra logic and functionality to a sequence.
In this lecture students will learn how to create a new node type that switches around a nodes return status such that a failure becomes a success and vice versa.
In this lecture we will create a generic behaviour tree agent that can be inherited from to create different agent types.
In this lecture students will learn how to replace the BTAgent update loop with a coroutine to better the system's performance.
In this lecture students will discover the agent is able to repeat actions from the behaviour tree but several other elements of the code need to be tweaked.
In this lecture students will learn how to return a fail state if a game object is no longer active and use a variable to hold onto a game object that is being used.
In this lecture students will learn how to add in extra code to a selector node to sort the children before executing a process.
In this lecture students will learn about two approaches they could make to create dynamic updating of the sort order in the PSelector class.
In this lecture students will be challenged to create a random selector node, the result of which will reveal a little floor in the sorting and prioritisation code.
In this lecture students will learn how to control when shuffling and sorting children occurs.
In this lecture students will learn how to create multiple leaf nodes from an array of items.
In this lecture students will learn how to integrate traditional AI algorithms into the nodes starting with the fleeing behaviour.
In this lecture student will complete coding and testing a small behaviour tree for fleeing.
In this lecture students will be challenged to integrate the steal and runAway behaviours into the same tree and then will discover some issues that may occur thereafter.
In this lecture we will examine how to use extra conditions throughout a behaviour tree to guide an agent's sequence of actions.
In this lecture students will add in a second behaviour tree to provide codependent conditions that must be true for another part of a tree to execute.
In this lecture students will be challenged to modify the structure of the steal behaviour tree to include the money amount as a co-dependency instead of an initial trigger.
In this lecture students will be challenged to modify the behaviour tree to add in different behaviours when one sequence fails.
In this lecture students will be challenged to add a new agent that is an art gallery patron who will view artworks.
In this lecture students will put together a simple behaviour tree to get the agent to get the patron to react to boredom.
In this lecture students will learn to integrate coroutines with the behaviours of the agents to adjust the values of agent properties.
In this lecture students will learn how to create a loop decorator node to force agents to repeat a behaviour while another tree returns success.
In this lecture students will learn how to create a blackboard which acts as a global inventory system for world states.
In this lecture students will discover how a blackboard state can be integrated into a behaviour tree.
In this lecture students will discover how to integrate the opening hours of the gallery into the robber's behaviour.
In this lecture students will learn how to determine when agents need to communicate with each other and how to begin coding for an interaction.
In this lecture students will learn how one agent can be used to control the behaviour of another agent.
In this lecture students will learn how to create a communication channel between individual agents so they can work together.
In this lecture students will examine ways to integrate logic using nodes instead of adding too much logical code into one leaf.
In this lecture students will add a new dependency into the worker behaviour to ensure the quit an action when the environment changes.
In this lecture students will be challenged to turn the cop into a BTAgent and have him patrol around the gallery.
In this lecture students will be challenged to code the cop to chase after the robber if the cop sees the robber while on patrol.
In this lecture students will learn about a couple of techniques to help them debug their behaviour trees in Unity.
In this video Penny will wrap up the course and suggest other topics you might be interested in.
This link provides further information on the courses you can look at taking based on your interests and skill level.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.