This article was published for AiGameDev.com PREMIUM members, available by subscription. You can join here in a minute or less. If you're already a member, log-in from the top right menu.

Premium Teaser
BehaviorsByExample.medium

Behaviors By Example: Patrolling and Hiding in Cover

Alex J. Champandard on January 27, 2010

Building behaviors for a game or simulation is an incremental process involving both the building blocks at the C++ level, and the way they are combined to create the AI. A key part of this process is reviewing and improving the code and the behaviors — and figuring out what the next iteration should be.

This tutorial looks into the behaviors inside the recent release of the Sandbox, in particular the patrol sequence of the red bots and the seeking cover and hiding behaviors of the yellow bots. Both of these are implemented using a behavior tree, and you'll see how these were built and how they can be improved.