Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Unity AI Programming Essentials
Unity AI Programming Essentials

Unity AI Programming Essentials: Use Unity3D, a popular game development ecosystem, to add realistic AI to your games quickly and effortlessly

Arrow left icon
Profile Icon Bennett
Arrow right icon
S$24.99 S$35.99
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.8 (8 Ratings)
eBook Dec 2014 162 pages 1st Edition
eBook
S$24.99 S$35.99
Paperback
S$44.99
Subscription
Free Trial
Arrow left icon
Profile Icon Bennett
Arrow right icon
S$24.99 S$35.99
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.8 (8 Ratings)
eBook Dec 2014 162 pages 1st Edition
eBook
S$24.99 S$35.99
Paperback
S$44.99
Subscription
Free Trial
eBook
S$24.99 S$35.99
Paperback
S$44.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

Unity AI Programming Essentials

Chapter 1. Pathfinding

Probably the most useful game AI is pathfinding. Pathfinding is all about making your way from one point to another while navigating around obstacles. Unity excels at linking the worlds of designers and programmers. AI is no different, and we'll see how to make simple pathfinding AIs without ever touching the code. Pathfinding is probably the most common AI game task, and there are many Unity plugins for it. We will be looking at three different ones.

In this chapter, you will learn:

  • Working with pathfinding
  • Applying pathfinding in Quick Path, React, and RAIN AI packages
  • Behavior trees
  • Applying characters to Character Controller
  • Unity's NavMesh

An overview

Pathfinding is a way to get an object from point A to point B. Assuming that there are no obstacles, the object can just be moved in the direction of the target. But the AI part of it is all about navigating the obstacles.

A poor AI might try walking a Non-Player Character (NPC) directly to the target. Then, if it is blocked, it randomly tries to go to the right or left to look for a space that might help. The character can get caught in different areas and become permanently stuck.

A better AI will walk an NPC in an intelligent way to a target, and will never get stuck in different areas. To compute a good path for the NPC to walk, the AI system will use a graph that represents the game level, and a graph search algorithm is used to find the path. The industry-standard algorithm for pathfinding is A* (A Star), a quick graph search algorithm that uses a cost function between nodes—in pathfinding usually the distance—and the algorithm tries to minimize the overall cost (distance) of the path. If you want to learn to code your own pathfinding AI, try A* because it is simple to implement and has a lot of simple improvements that you can apply for your game's needs.

The AIs we are about to discuss will take care of the pathfinding algorithms for you, and ultimately reduce the time it takes to breathe AI life into your game. Now let's look at Quick Path AI.

Quick Path AI

Alekhine Games' Quick Path is a $10 AI that you can pick up from the Unity Asset Store. Although the next two AIs have more features, this AI is added because of its blocky nature. This block approach creates a grid-based path and is used with many types of games, but this AI works especially well with the excitement in the voxel game genre; it is suited for cubed topography.

To start with, perform the following steps:

  1. Create a new 3D scene and import the Quick Path AI from the Asset Store.
  2. Next, set up some cubes, planes, or other objects as your terrain, and then place all of these game objects into an empty game object. Name this game object Terrain.
  3. Next, on the Inspector panel, add a component, QuickPath | Grid. Immediately, you should see a series of blue lines that show up on the cubes. These indicate all the points where a character can move in the AI.
    Quick Path AI
  4. Now, we need a character to move around the scene. Create a sphere, or any object, and name it NPC.
  5. Then, we'll add a Component, QuickPath | AI | Follow Mouse Object.
  6. Now, when you run the scene, assuming it is lit up and has the camera pointing where you want it to, you'll see NPC on Terrain.
  7. Click somewhere on the Terrain object, and watch the NPC object move to that point.
    Quick Path AI
  8. Although we might say that the pathfinding in this is clearly working, we should also add an obstacle to the scene: something that shouldn't be stepped on. To do this, add another cube somewhere. Go to the Inspector panel for the obstacle and tag it with Obstacle by selecting that tag from the drop-down, or if it is not an option select Add Tag... and add Obstacle to the tag list.
  9. Next, in the Terrain game object, in the Grid component, expand Disallowed Tags, increase the size to 1 and enter Obstacle for the new element.
  10. Next, click on the Bake button at the top of the Grid component. Now you will see that the grid markers skipped the cube as an option. If you want to test more, click somewhere else on the Terrain object and watch the NPC object move to the clicked point avoiding the obstacle.
    Quick Path AI

Now, we've seen how to set up pathfinding with Quick Path, so let's look at another way to set up pathfinding with React AI.

React AI

Different Methods' React, a $45 AI, introduces a behavior tree and the use of a navigation mesh, or NavMesh. A NavMesh is a series of interconnected polygons forming a complex area used for travel. It creates a simplified graph of the level that is inputted into the pathfinding system. This simplified graph that it creates is smoother and tends to have characters that travel better than a grid-based graph. A behavior tree is a parent-child structure used for making decisions in many AIs. We will look at behavior trees and navigation meshes in more detail in the later chapters. NavMesh is a basic feature available in Unity, but the behavior tree is not. Unlike the other two AIs shown, this AI requires a bit more coding to get started, but not much.

To begin with, you'll need a new scene, as well as to import React AI from the Asset Store. Perform the following steps:

  1. Add a plane or another ground type. Then add several obstacle objects, such as cubes. Make sure that each of the objects we just created are marked static at the top of the Inspector, or the NavMesh won't identify them later on. The scene should look like this:
    React AI
  2. Next, find the Window menu and select Navigation. At the bottom of the Navigation tab, click on the Bake command. You have now generated a simple navigation mesh for your characters to navigate. It will highlight the areas that NavMesh AIs can walk, as seen here:
    React AI
  3. Let's add a player who can move around the world now. Add a capsule and name it Player. Fortunately, the demo contains a simple script for controlling a player who you can find (and add) by navigating to Add Component | Scripts | Simple Player Control. Now, this doesn't move the object around on its own; instead it drives a Character Controller object.

    Note

    Character Controller is a type of an object that you can inherit in your code classes that many AIs can operate. In this case, there is a basic Character Controller type to simply move a given object around.

  4. When adding the component, just start typing Character Controller in the search box, and it will show you all the similar component names. Add Character Controller. Now, the player should be controllable. You will probably need to increase the speed to 1 to detect the player movement.

    Note

    Make sure that the game object, and any body parts, do not have collider components. Controllers detect colliders to determine whether or not they can move to a given place.

  5. Next, we'll add an enemy in the same way, with Capsule. The enemy needs a component called Nav Mesh Agent, which is a component capable of using a NavMesh to move around, so add it. Now, the game object has the ability to walk around, but it has nowhere to go. To get it moving, we need to add the enemy AI agent.
  6. Next, we get to the AI for the enemy agent. In React, a behavior tree is called a Reactable. To add a reactor, we start the Project explorer, in a folder of our choice, by navigating to Create | Reactable.
  7. Once created, rename it to EnemyMovement. In the Inspector, it has a list of behaviors for it. We'll need to add a script, which can be found in the book's contents: \Scripts\React AI\FollowThePlayer.cs. Without going in-depth in the code, let me explain the following key points:
    • The C# file was copied from a sample script provided with React AI that made a character move away from a target.
    • It was rebuilt to make the player the target destination, and also to turn seeking on and off by using a button. It is not hard to adapt these scripts.
    • Unlike normal mono behaviors, you use a special Go method. The go method is called by React AI only if it is selected to be used.
    • In the Start method, we see it obtain the NavMeshAgent that we attached to the enemy in the Inspector panel.
    • In the Go method, we see it feeding the destination to the NavMeshAgent, and then checking to see whether it has already found a path. Once it does, it just goes.
    • All uses of that agent are still following standard Unity calls to use NavMesh, and can be applied without using the AI, by placing this code in a traditional behavior Update method.

    This script needs to be added to the Inspector for the EnemyMovement asset, and also to the Enemy game object.

  8. Once the script is attached to the enemy, the Inspector will reveal that it has a target. Drag the player from the Hierarchy panel into the player attribute on the Inspector panel.
  9. Finally, we have the behavior tree to set up. In the Project panel, right-click on the EnemyMovement asset, and click on Edit Reactable. A behavior tree pops up an editor, which is how we train our AI.

For this chapter, we'll just give it a one track mind to follow the player. With Root selected, click on the Action button under Leaf, as shown in the following screenshot:

React AI

Since we only have one action in the behavior list, it selects it by default. What makes the behavior tree nice is that we can make decisions, or check whether the target is within X distance then try to follow, otherwise do something else–all from the designer. The next section on RAIN also uses a behavior tree, and most of the same basic types are used in both RAIN and React.

This took more steps than the previous AI, but there is also more going on. It is playable now.

Tip

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

RAIN AI

Rival Theory's RAIN AI is a very full-featured AI to use and it is free. It includes a behavior tree with similar functionality to React, but has more features built in. In fact, this one won't require any additional scripting to go from point A to point B.

To get this going, we'll need the following bases:

  • A map to move around on
  • A character to move around in the map
  • A route (series of waypoints) for the character to follow
  • A navigation mesh that knows what to avoid
  • An AI to control the character
  • A behavior tree to tell the AI what to do

To start with, you'll need to start a new Unity project, import Unity's Character Controller, and import the RAIN AI package.

Note

Don't get the RAIN AI package that is found in the Asset store. The current release (at the time of writing this book) can be found at the Rival Theory site, rivaltheory.com/rain/.

Perform the following steps:

  1. To create our map, add a plane. Then, add a couple of objects to act as obstacles. It is best if they create a U or V shape to potentially trap the player:
    RAIN AI
  2. Next, drag the predefined character found in Project | Standard Assets | Character Controllers | Sources | Prototype Character | "constructor" into the scene. From the scene depicted in the preceding screenshot, I recommend placing him (the character) on the back left-hand side of the plane.
  3. Next, we need a route. Although there is more than one waypoint system in RAIN, I found that the route will be the fastest for this demo. In the RAIN menu, click on Create Waypoint Route. Name it's game object GreenPath. We will need to call this later, so we want simple, easy names to remember.
  4. In the Inspector panel for GreenPath, click on the Add (Ctrl W) button. This adds a waypoint. In fact, we need to add three. Place the first one on the inside of the V, the second on the tip of the V, and the last on the far edge of the plane, as shown in the following screenshot:
    RAIN AI
  5. Just as in React AI and Unity NavMesh, we need a navigation mesh for this as well. We clearly defined the route, but as you can see, the path is blocked. In the RAIN menu, click on Create Navigation Mesh. Align and stretch it so that it surrounds the area where you want the paths to be determined.

    The Inspector panel for the NavMesh has a property called Ignored Tags. Add Player to this list. (You might need to make sure that the player object actually has that tag selected as well.) Otherwise, the NavMesh will not generate where the player stands, and will prevent its ability to find a path. Then click on Generate Navigation Mesh at the bottom of the Inspector panel. The result should look like this:

    RAIN AI
  6. Next, we need to add an AI to control the character. Select the player object in the Hierarchy panel, and from the RAIN menu, click on Create AI.
  7. Next, select the middle button of the character running in the AI Inspector panel, then click on the Add Existing Animations button at the bottom. This will add all the player's animations: idle, walk, jump, pose, and run. You can refer to the following screenshot:
    RAIN AI
  8. Next, we need to add a behavior tree. Behavior trees are a way to define decisions and actions for AI characters. We will discuss them in more detail in Chapter 3, Behavior Trees. For now, add one by clicking on the head/brain icon in the Inspector panel and then click on the Open Behaviour Editor button. On the right-hand side is a behavior tree drop-down selector, so click on it and choose Create New Behaviour Tree.
  9. Name it FollowGreenRoad. It will already have one element, SEQ (Sequence), under the root BT (behavior tree) node. Sequence it means that it will run any child nodes in order. Right-click on the SEQ node and navigate to Switch To | Parallel, which means that it will run all its child nodes simultaneously.
  10. Let's add the child nodes and then set them up. Right-click on the PAR node, then navigate to Create | Actions | Animations. Right-click on PAR again and navigate to Create | Actions | Choose Patrol Waypoints. Then right-click on the new WAY node and navigate to Create | Actions | Move.
    RAIN AI

    Because the decision is to run things in parallel, it will animate the character and follow the waypoints at the same time.

  11. Click on the green animate node, and set its animation state to walk. It is case sensitive, but you can select which animation the character should use.
  12. Next, select the WAY node. Here, you need to set Waypoint Route to use. This was the navigation route we created earlier with the three waypoints. We called it GreenPath.
  13. For the loop type, we'll make it One Way so that the character only travels to the end and stops there. Also, change the name of the loop to Follow Green Path. This shows up next to the WAY node, and helps explain what is happening.
  14. Finally, set the Move Target Variable to NextWayPoint. This is a variable that we are setting with the next waypoint in the path. When it is reached, the patrol route will set the variable to the next location in the path. We use this in the Move node.
    RAIN AI
  15. Select the move node, and in the properties, set the Move Target to NextWayPoint, the variable that is being set by the patrol route we just configured. And set the Move Speed to a number, such as 3. This is how fast the character will move.
  16. Now that we have created the behavior tree, we need to set the Character AI to use it. Select the AI object under the player object in the Hierarchy panel. On the Mind icon, for the Behavior Tree Asset, set it to FollowGreenRoad. This can be found by navigating to Project | AI | Behavior Trees, or from the selector in the Inspector panel, choose the Assets tab, and it should be right on top.

The demo should be able to run now. The character will move around the block and walk to the last waypoint in the path.

Comparing AI solutions

Each AI has its own strengths and weaknesses, ranging from price to flexibility to designer friendliness. Also, each AI has more than one way to accomplish this chapter's task of moving a character from point A to point B. We selected paths that were faster and easier to start with, but keep in mind that each of them has plenty of flexibility. All three proved to work well as terrain/trees as well as simple planes and cubes.

Experiences of working with all three:

  • Quick Path is a good choice for a beginner. It has the fewest steps to do to get going, and works easily. Quick Path is focused on just pathfinding and the others are larger AI systems that can be expanded to many more areas because of their use of behavior trees.
  • RAIN has many features beyond pathfinding that we will discuss in future chapters. The learning curve for RAIN is higher than Quick Path and unlike other AI solutions, the source code is unavailable, but it is a good all-round solution for game AI. And while RAIN has the ability to be customized through user-defined scripts, the focus is on easy AI setup through the Unity GUI without needing to write scripts often.
  • React includes a behavior, but requires more code to get it running, which is good if you are interested in coding more. You build all the actions it can use, and let the designers focus on the tree. RAIN can do this too, but with React, you are building the blocks from square one.

Overall, the best AI for you is the one best suited for your game and that you enjoy using. We will be looking at these three and other AI systems in detail throughout this book.

Summary

Our AI characters need to be able to move between different points in our scene in an intelligent way, and we looked at pathfinding AI systems that helped us do that. We tried three different ones: Quick Path, React, and RAIN. But our characters need to be able to do more than just walk from one point to a second one in our levels. In the next chapter, we will extend what we have learned about pathfinding here by seeing how to set up patrolling behaviors for our characters. This will be the start for having characters walk around a level in a realistic way.

Left arrow icon Right arrow icon

Description

This book is aimed at developers who know the basics of game development with Unity and want to learn how to add AI to their games. You do not need any previous AI knowledge; this book will explain all the essential AI concepts and show you how to add and use them in your games.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 22, 2014
Length: 162 pages
Edition : 1st
Language : English
ISBN-13 : 9781783553563
Vendor :
Unity Technologies
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want

Product Details

Publication date : Dec 22, 2014
Length: 162 pages
Edition : 1st
Language : English
ISBN-13 : 9781783553563
Vendor :
Unity Technologies
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just S$6 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just S$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total S$ 186.97
Unity Game Development Scripting
S$66.99
Unity AI Programming Essentials
S$44.99
Mastering Unity Scripting
S$74.99
Total S$ 186.97 Stars icon

Table of Contents

12 Chapters
1. Pathfinding Chevron down icon Chevron up icon
2. Patrolling Chevron down icon Chevron up icon
3. Behavior Trees Chevron down icon Chevron up icon
4. Crowd Chaos Chevron down icon Chevron up icon
5. Crowd Control Chevron down icon Chevron up icon
6. Sensors and Activities Chevron down icon Chevron up icon
7. Adaptation Chevron down icon Chevron up icon
8. Attacking Chevron down icon Chevron up icon
9. Driving Chevron down icon Chevron up icon
10. Animation and AI Chevron down icon Chevron up icon
11. Advanced NavMesh Generation Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.8
(8 Ratings)
5 star 12.5%
4 star 25%
3 star 12.5%
2 star 25%
1 star 25%
Filter icon Filter
Top Reviews

Filter reviews by




brian Williams Mar 02, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I began programming a few years back, when the iOS sdk first came out; I haven't done any programming in a few years, so this book was a good catchup for me to refresh myself on working in Unity, as well as all the new stuff that has been added since I last used it.This may not be for the most advanced Unity programmer, but then again I wouldn't think anyone who's that advanced with the program would really need a book like this. There were times that I was reading things I already knew, and wanted to skip ahead, but I know that the book is aimed at many different levels of programmers, so I can't expect it only to be aimed solely at me.It was useful, and the examples were pretty relevant to the type of AI that I was looking to use in my own game.
Amazon Verified review Amazon
Heleen Durston Mar 04, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
There are many assets available for Unity that implement Artificial Intelligence (AI). Simple AIs can also be created by coding a state machine. Unity also provides Navigation Meshes which help with developing pathfinding AIs. “Unity AI Programming Essentials” by Curtis Bennett and Dan Violet Sagmiller covers 6 different AI’s that are available in Unity’s asset store. Each of the following AI solutions are presented in the form of a project that you can download from Packt Publishing’s website.Quick Path AI by Alkehine Games is available for $10 at Unity’s asset store. Its main focus is on pathfinding. The manual and a demo are available on Alkehine Games’ website. This solution is covered in Chapter one in the book and is great for beginners.React AI is by Different Methods and is available for $45 at the asset store. This asset provides a way of building behavior trees that make use of Mecanim animation and allow you to code items such as chain-of-command AIs and NPC behavior. The book discusses how to use React in chapters one, four and seven. If you enjoy coding and want to use an AI for behavior trees than this is a great choice. For more information on React visit their website. Car AI is by Bonecracker Games and is available for $10 on the asset store. All of chapter 9 is dedicated to using this AI and creating a car game demo. Smart Car allows you to set all different sorts of properties for cars. The book provides a lot of information on modifying and using this AI. You can find more information on Smart Car AI at Bonecracker Games’ website.In chapter 5 crowd control APIs are discussed. Crowd Simulation API by TechBizAccelerator is available for $45 on the asset store. ANT-Op by Gray Lake Studios is available for $75 in the asset store. Both solutions provide ways of controlling groups and defining behavior in your games. These are very specific behavior AI and the chapter provides a good overview of them. Both companies have websites that provide more information on these AI solutions.The bulk of the book covers the RAIN AI by Rival Theory which is available for free on the asset store. Their website provides excellent documentation and examples. “Unity AI Programming Essentials” provides great information on RAIN and shows you how to set-up several different AI situations that you will come across in the creation of your games. Behavior trees, attacking situations and advanced navigation meshes are all discussed and explanations are provided on how to set-up RAIN in these situations.“Unity AI Programming Essentials” is a wonderful book on implementing artificial intelligence in games created with Unity. Very little explanation is provided on AI’s in general; but for the specific situation of programming in Unity this book is great.
Amazon Verified review Amazon
Don Mar 04, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
As a pragmatist, I enjoy learning by jumping directly into features of an application like Unity 3D. This book was approachable and easy to understand--a big plus. When learning complex concepts, like AI and pathfinding, I consider approachability important for having fun and therefore avoiding the barriers that painful subjects can present.I was grateful that RAIN was free and replete with powerful features; however, RAIN does not include source code. The other assets compared within this book, Quick Path and React, offer limited capabilities, the comparison reveals key issues that Unity 3D developers should understand. I was particularly interested in an asset mentioned in the book called "ANT-Op, which simulates food searching Ant behaviors. I was disappointed to learn ANT-Op is not a asset that can be used to actually implement in my games, but rather just a learning simulator. I did appreciate the discussion and contrasts of managing driver/automobile pathfinding introductions and the other AI approaches discussed in the book. I was also grateful that a discussion of using Unity's Mecanim system works with the RAIN asset. The books introduces the basics: pathfinding, patrolling, crowds, behavior trees, sensors, adaptation, attacking, driving, animation, and NavMeshes--all important subjects in game development.My development needs are more simple than a massive, multi-user game set of tools. As a result, the simple, step-by-step approach presented in this book was perfect for my needs. The book set the course for more advanced AI and pathfinding approaches. Although I hoped for more theoretical background and mathematical constructs, it eased my way into the next level of studies. This book offers a first addition introduction to AI and an opportunity for two additional publications to augment AI development efforts with theoretical background and advanced topics.
Amazon Verified review Amazon
Chev Mar 17, 2015
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Overall the book was ok, the writing style was a little too dry for my taste. The content covered in this book was good, all about AI and its different parts. I did like how the author used different assets to do/accomplish the same thing. That way you can get a feel for how each asset handles everything and can better make a decision on what suites your needs best. Nav mesh and pathfinding was pretty straight forward as was patrolling and behavior trees. After chapter 3 things got a little more interesting, same writing style but the topics were ones I haven’t dealt with a whole lot before, and seems more interesting then the previous ones. The chapters on crowd control and patrolling were cool because I never knew how to approach these, and always thought of them to be really complicated. The chapter on driving was my favorite, I had one of those ah-ha moments and things clicked for me. When I had approached driving AI in the past I had never look into nav meshes as I thought that was only for enemies/NPC on foot lol. If it wasn’t enough to go over waypoints this chapter also hits on drifting and break zones and explains how this is AI differs from other AI due to the physics invloved. Overall the book was a little dry, but it may be due to the large topics being covered in such a fast pace. The content does have some depth, its more then click here and do this, the author explains why things are done a certain way. The topics are good and should more then cover your basic AI, and get you started with a good fundamental understanding of AI.
Amazon Verified review Amazon
K. McNamara Feb 14, 2016
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
This book is a classic example of what is wrong with many coding/technical books being put out today. I dont know if it was the writers or publishers but assumptions are made that kill the content of the book. On example is in the first two chapters, in chapter one, you create a simple pathfinding route to move back and forth on. The options it shows you to stack in the behavior tree are:PARANIMATEWAYMOVEThen in chapter two after it has you create a method that picks a random location, it tells you to build the next part yourself just like you did in the first chapter only it does not work and is NOT what they show in the picture. The picture they show is stacked like this:WAYANIMATEPARMOVEBut it does not show you how to configure it this way. I have tried to redo this part over and over several times and asked several of my college friends to take a look at this and no one has been able to make it work. If a second year college student can not make it work, what good is it? I am very disappointed in this book. I dont know if the issue is with the author or due to it being 2 years old and the software changing. I have had this issue with several of the PacktPub books and will stay away from them in the future.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.