Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity 2017 Game AI Programming - Third Edition

You're reading from   Unity 2017 Game AI Programming - Third Edition Leverage the power of Artificial Intelligence to program smart entities for your games

Arrow left icon
Product type Paperback
Published in Jan 2018
Publisher Packt
ISBN-13 9781788477901
Length 254 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Raymundo Barrera Raymundo Barrera
Author Profile Icon Raymundo Barrera
Raymundo Barrera
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. The Basics of AI in Games 2. Finite State Machines and You FREE CHAPTER 3. Implementing Sensors 4. Finding Your Way 5. Flocks and Crowds 6. Behavior Trees 7. Using Fuzzy Logic to Make Your AI Seem Alive 8. How It All Comes Together 9. Other Books You May Enjoy

Setting up the environment

As our tank uses a NavMeshAgent component to traverse the environment, we need to set up our scene using static game objects for the bake process to work properly, as we learned in Chapter 4, Finding Your Way. The maze is set up in a way so that towers are spread out fairly reasonably and the tank has plenty of space to maneuver around easily. The following screenshot shows the general layout of the maze:

The gauntlet our tank must run through

As you can see, there are seven towers spread out through the maze and a few twists and turns for our tank to break line of sight. In order to avoid having our tank graze the walls, we adjust the settings in the navigation window to our liking. By default, the example scene has the agent radius set to 1.46 and the step height to 1.6. There are no hard rules for how we arrived at these numbers; it is just trial...

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
Banner background image