Unity AI Programming Essentials
Table of Contents
Unity AI Programming Essentials
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Pathfinding
An overview
Quick Path AI
React AI
RAIN AI
Comparing AI solutions
Summary
2. Patrolling
Quick Path AI
React AI
RAIN AI
Summary
3. Behavior Trees
An overview of behavior trees
RAIN node types
The behavior tree demo
Summary
4. Crowd Chaos
An overview of crowd chaos
React AI
Setting up a scene with React
Building behavior trees in React
Setting up wandering characters with React
RAIN AI
RAIN AI custom wander scripts
Putting NPCs in the RAIN demo
Summary
5. Crowd Control
An overview of crowd control
The Fame Crowd Simulation API
Setting up a scene with Fame
Setting up a group
Adding obstacles to Fame
Adding vector fields to Fame
ANT-Op
Summary
6. Sensors and Activities
An overview of sensing
Advanced visual sensor settings
Advanced audio sensor settings
Using senses with RAIN
Setting up aspects in RAIN
Setting up a visual sensor in RAIN
Changing activities based on sensing
RAIN sensor filters
Summary
7. Adaptation
An overview
RAIN's demo
Reacting to game events
Using RAIN's motor directly
Adding large game events
The React AI
Summary
8. Attacking
An overview of attack AI
The attack demo
The chase and attack demo
Creating cover AI
Group attacks
Summary
9. Driving
An overview of driving
Setting up a Smart Car vehicle
The Smart Car AI demo
Setting up a Unity test scene
Using Unity's built-in NavMesh system
Setting up waypoints
Adding obstacles to driving
Additional features
Adding brake zones and drift zones
Integrating with other AI systems
Summary
10. Animation and AI
An overview of animation
The AI animation demo
Configuring RAIN animations
Using the animate node
RAIN and the Mecanim demo
Additional Mecanim nodes
Summary
11. Advanced NavMesh Generation
An overview of a NavMesh
Advanced NavMesh parameters
Culling areas
Multiple navigation meshes
Summary
Index
Unity AI Programming Essentials
Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2014
Production reference: 1151214
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78355-355-6
www.packtpub.com
Authors
Curtis Bennett
Dan Violet Sagmiller
Reviewers
Davide Aversa
Adam Boyce
Jesse Lu
Brent Owens
Angelo Tadres
Francisco Ureña
Commissioning Editor
Akram Hussain
Acquisition Editor
Subho Gupta
Content Development Editor
Prachi Bisht
Technical Editors
Tanvi Bhatt
Siddhi Rane
Copy Editors
Gladson Monteiro
Deepa Nambiar
Rashmi Sawant
Project Coordinator
Sageer Parkar
Proofreaders
Ameesha Green
Jonathan Todd
Indexer
Priya Sane
Graphics
Disha Haria
Production Coordinator
Komal Ramchandani
Cover Work
Komal Ramchandani
Artificial intelligence can be one of the most challenging aspects of video game development. Game AI encompasses difficult concepts such as spatial reasoning, pathfinding, movement, awareness, and decision making, all with the goal of combining these concepts into a realistic and lifelike experience for the player. It's no wonder that so many game developers put off AI development to the end of the project. This is a shame, because good AI can make or break the game experience and great AI can make a player fall in love with your game and keep them coming back again and again.
In recent years, AI has become more important than ever. Although the quality of AI in games has increased steadily over time, the results have come more from added attention and effort on the part of developers, rather than from significant breakthroughs in technology. The impact of this is that "good" AI in games has often been limited to projects and teams with large budgets and access to high-end tools. Unity changed the industry by making high-end game development tools available to all developers, big and small. Today's indie developers are creating player experiences that rival those of AAA companies. Until recently, they lacked the tools, knowledge, and know-how to add AI-driven characters that have the same fidelity as the rest of the game. Now this has changed too, with the very best AI tools becoming accessible to every developer.
This book serves an important role in the rise of AI in Unity. In these pages, you will find the guidance, techniques, and examples you need to become a great A...