Implementing steering behaviors

The strategies that we will cover here have been taken from Craig Reynolds's paper Steering Behaviors for Autonomous Characters, written in 1999. It has become a well-known reference for implementing autonomous motion in an easy manner for non-playable characters.

You can check out the online version at http://www.red3d.com/cwr/steer/gdc99/. In this section, you will learn how to implement the following kinds of behavior:

  • Seek and flee
  • Arrival
  • Pursuit and evade
  • Wander
  • Obstacle avoidance

Seek and flee

The seek behavior moves the character towards a specific position in the space. This behavior is based on the combination of two forces: the character's velocity and the steering force. This force is calculated as the difference ...

Get Python Game Programming By Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.