Game Development Reference
In-Depth Information
React AI
Different Methods' React, a $45 AI, introduces a behavior tree and the use of a navig-
ation 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 input-
ted 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 beha-
vior 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 stat-
ic at the top of the Inspector, or the NavMesh won't identify them later on. The
scene should look like this:
2. Next, findthe Window menuandselect Navigation .At thebottom ofthe Nav-
igation 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:
Search WWH ::




Custom Search