Game Development Reference
In-Depth Information
Chapter 2. Patrolling
Patrolling is a simple extension to pathfinding. Instead of just having a single target in
mind, we might have two or more points. We might go back and forth between them,
or travel in a never-ending loop.
In this chapter, you will learn about:
• How patrolling works
• Patrolling in Quick Path, React, and RAIN AI packages
• Getting to know more about behavior trees
• Creating patrols that go to different points in a level by not always following
the same path
Patrolling is a way to get an object from point A to point B and then to point C, and
so on. Pathfinding is still required to get from one waypoint to another, but here, we
daisy-chain them into a larger, more meaningful path.
Quick Path AI
Quick Path is back again, with built-in capabilities to handle patrol. With its simple
approach to AI, only a few straightforward steps are needed to get a scene finished.
Here is a breakdown of these steps:
• Making the world ready for patrol
• Setting up the patrol script
We'll start by expanding on our world from Chapter 1 , Pathfinding the quick path
demo. Stretch out a couple of the blocks to make a larger surface area. Then, click
on the terrain object (the parent of all the cubes forming the terrain), and in the In-
spector , click on the Bake button. You can see what happens next in the following
screenshot:
Search WWH ::




Custom Search