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

The behavior tree demo

Now that we know about the different nodes we can use, we'll create a demo that shows how to use the action and decision nodes. The demo will show how to have a character perform multiple tasks. We will have an entity, an enemy spaceship, patrolling an area, but only for a given amount of time; then, the ship will return to its home base. The steps for this example might seem overly complicated and we could do a similar AI ourselves without behavior trees with a simple script by hardcoding the different states. However, remember that behavior trees are easily extendible and scalable. With this demo, instead of two behaviors, we could take time to create a more complex character, going up to about 30 behaviors easily, but extending a script to do that would be pretty complicated and hard to maintain.

The start of this is similar to the pathfinding and patrol RAIN demos, except we will use a spaceship model instead of a walking character. You'll need to create...

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 $19.99/month. Cancel anytime