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

What this book covers

Chapter 1, The Basics of AI in Games, gets the reader up to speed with the basic terminology we'll be working with. In order to build up to the more advanced concepts in the book, we first lay the groundwork and expectations for the following chapters. This introductory chapter provides a preview of some of the concepts covered and prepares the reader with the necessary knowledge to be successful in the sample projects and code to follow.

Chapter 2, Finite State Machines and You, jumps right into one of the most essential concepts in game AI--the finite state machine. The chapter starts with a conceptual overview and then dives into an implementation of a state machine in Unity using the built-in features, such as Mecanim and StateMachineBehaviours. This chapter is the first to take the user through an actual example and sets the tone for how future chapters will explain the concepts they cover.

Chapter 3, Implementing Sensors, builds on the concept of the AI agent by providing the reader the knowledge and techniques to make their AI more believable. In this chapter, the reader learns how to implement sensing for their agents, allowing them to collect data and information from their virtual surroundings, thus enabling more complex interactions with their environment. The output of the agent is only as good as the input, and this chapter ensures that the reader can implement sensing mechanisms to give AI behaviors solid inputs to base their algorithms on.

Chapter 4, Finding Your Way, takes the reader's knowledge to the next level. With the skills from the previous three chapters to build on, the reader is now given the tools to have their AI agent navigate the game world. A few different alternatives are explained in detail, such as node-based pathfinding, the near-standard A* algorithm approach, and finally, Unity's NavMesh system. Examples are provided for each, and the user is given the necessary knowledge to pick the right approach for each situation.

Chapter 5, Flocks and Crowds, covers the history and implementation of a standard flocking algorithm. Along with some history on the topic, the user is walked through a sample project that implements flocking to create convincing boid systems to model birds, fish, locusts, or any other flocking behavior. In the later portion of the chapter, the reader is introduced to implementing simple crowd dynamics using Unity's NavMesh system. Once again, sample scenes are provided to illustrate the different implementations.

Chapter 6, Behavior Trees, showcases another handy tool in the AI game programmer's tool belt: the behavior tree. The chapter teaches readers the concepts behind behavior trees, walks them through a custom implementation, and applies the knowledge learned in two examples: a simple math-based example and a more fun and frankly silly example we call HomeRock, which emulates a popular online card game to showcase behavior trees in action.

Chapter 7, Using Fuzzy Logic to Make Your AI Seem Alive, sets the stage with a long and descriptive title, right? This chapter covers the fundamental concepts in fuzzy logic and the approach for converting fuzzy values to concrete values and explains a simple approach for implementing fuzzy logic in Unity. The first example illustrates the simplest possible version of the concepts, and the second example illustrates a morality/faction system like you'd find in an RPG to illustrate the usefulness of fuzzy logic.

Chapter 8, How It All Comes Together, takes concepts the reader has learned throughout the book and throws them into a sample tower defense example project. This chapter illustrates how, by taking a handful of AI techniques, you can quickly throw together a game that implements AI NPCs and enemies and gives them rudimentary decision-making abilities.

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