Use your basic knowledge of Unity3D to add effective artificial intelligence to your games. This tutorial will take you through all the essentials, from flocking to pathfinding, from navigation graphs to behavior trees. Overview In Detail This book fills the gap between artificial intelligence (AI) books designed to learn underlying AI algorithms and general Unity3D books written to cover basic scene setup and scripting in Unity3D. Game AI Scripting in Unity3D covers implementing AI techniques such as flocking, pathfinding, path following, and behavior trees in Unity3D with example projects. Game AI Scripting in Unity3D will show you how to apply AI techniques to your Unity3D projects using C# as the scripting language. Unlike other AI books and Unity3D books, this book tries to focus more on the application of AI techniques in the Unity3D engine, with sample projects that demonstrate finite state machines (FSMs), pathfinding, steering, navigation graphs, and behavior trees techniques. This book shows how to implement various AI techniques in Unity3D by implementing the algorithm from scratch using C#, applying Unity3D built-in features, or using available scripts and plugins from the Unity Asset Store. For example, we’ll be implementing our own A* algorithm to do pathfinding but will also explore the Unity3D navigation graphs feature. Then we’ll use the Behave plugin to construct behavior trees for intelligent AI character behaviors. Game AI Scripting in Unity3d covers other AI techniques such as flocking behavior, building a sensory system for taking inputs from the environment and other AI agents, and so on. In the final chapter this book will show you how to build a racing game AI project using Unity3D and applying the techniques described in earlier chapters. What you will learn from this book Approach Step-by-step practical tutorial Who this book is written for Are you are a programmer with basic knowledge of Unity3D who would like to add AI features to your game? Are you looking for a reference on implementing AI in Unity3D with simple to follow instructions, and lots of sample code and projects? Then this book is for you. You should have some background in C# language as this book will use C# for scripting. However if you know any other language you should be able to follow this book fairly easily.
I have read this book and recommend it to anyone who needs to create and implement an AI system for games. The AI systems' examples show how to create intelligent systems that are based on research papers presented at international conferences like SIGGRAPH and the Game Developers Conference (GDC). This includes Steering Behaviours for car or road vehicle type games and sims, distributed behaviour of flocks, schools and herds for animal movement patterns.
The ideas are reasonably easy to understand but to properly grasp how the AI concepts are implemented in the book, requires at least an intermediate level understanding of Unity's scripting language and C# syntax - there's no explanation for C# constructs like classes and interfaces, for example. Thus, not recommended for beginners, but nice for designers and programmers who already have that knowledge under their belt and are ready for learning and discussion about AI concepts. Additionally, advanced AI systems that use techniques like Neural networks and Genetic algorithms have been omitted since this book really focuses on the core AI methods that most games would use.
The example projects are adequate for demonstrating the techniques described in the text with decent comments added to code fragments explaining what each line of code does. The introduction in the book claims that the projects work in version 3.5+ but I found that at most half of the example projects do not actually work in that version without making changes to the codebase of the respective example. If you use Unity 3.x Pro, you would need to download Unity 4.x to see all the examples working/running. To generate Navigation Meshes in a project, you would need Unity Pro, so the book has provided pre-built a nav-mesh for the examples if you are using the limited standard version.
In the text, each C# class is described and partially listed showing the key lines of code that perform the critical operations of each respective class involved in implementation of working game AI. The formulas and diagrams are pretty good at showing how the theory in the book works, and is on par with other AI books that I have read that cover pure artificial system theory.
Lastly, chapter 9 describes Behaviour Trees and their use in Unity 3D using the Behave plugin. Workflows, screen shots, diagrams, and scripting very nicely set out for the reader in a straight forward manner with code explanations blended in between sections of code examples in the book. This is by far the best way to explain how code works in this book.
For readers who need AI in their Unity projects, I do recommend this text as a helpful reference and guide to get it going in your games or simulations.
While the book is not impressive in Game AI content compared to some of the more specialized Game AI books that i read in the past, it does contain some code snippets which show how the game agent should behavior, as well as useful tips for physics and animation. Moreover the book is rather easy to follow.
Interesting concepts covered, but felt like it was written in a rush due to grammar errors, code of dubious quality, poor editing, and brevity of coverage of some topics. Not a great book.