Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity AI Programming Essentials

You're reading from   Unity AI Programming Essentials Use Unity3D, a popular game development ecosystem, to add realistic AI to your games quickly and effortlessly

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781783553556
Length 162 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Curtis Bennett Curtis Bennett
Author Profile Icon Curtis Bennett
Curtis Bennett
Arrow right icon
View More author details
Toc

An overview of behavior trees

For game AI, we need to define logic for the different AI entity characters in the game, that is, how they will act and react to different things in the game environment. The traditional and simpler way to do this is to use Finite State Machines (FSMs). In this approach, each character can be in a distinct state, and an FSM is a graph that defines states (nodes) and their transitions (edges). A simple example would be an enemy entity with two states, patrol and attack. The FSM will start in a patrol state, and when it gets close to a player, it transitions to an attack state. FSMs work for very simple state setups such as this, but they don't scale well, as the states and transitions have to be manually configured, usually through code. What if instead of the two states, our enemy character was more realistic and had 10 or even 100 different states, with many transitions between each? This becomes very difficult to manage and implement.

The popular alternative...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime