Book Image

Mastering Unity 5.x

By : Alan Thorn
Book Image

Mastering Unity 5.x

By: Alan Thorn

Overview of this book

Mastering Unity 5.x is for developers wishing to optimize the features of Unity 5.x. With an in-depth focus on a practical project, learn all about Unity architecture and impressive animation techniques. With this book, produce fun games with confidence.
Table of Contents (16 chapters)
Mastering Unity 5.x
Credits
About the Author
Acknowledgment
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Planning the zombie Artificial Intelligence


The zombie character needs intelligence, that is, the ability to take appropriate actions and responses in front of the player. Specifically, the zombie should balance actions between idling, chasing, and attacking at appropriate times. To achieve this, we'll need Artificial Intelligence (AI). This essentially involves coding functionality to help the computer make good decisions under specific conditions where multiple outcomes are possible. AI (for video games) is not, however, about coding an inward consciousness or phenomenology; and it's not about replicating the workings of the human mind. Rather, it's about deciding how NPCs behave, creating the illusion or appearance of intelligence, to enhance the experience and realism for the player. For the zombie, we'll code AI by using Finite State Machines (FSMs).

The FSM is essentially a decision-making structure. The simplest example of an FSM is a traffic light. This exists in only one of three...