← Back to Technical Work

Autonomous Agent Steering Behaviors

11 steering behaviors for character animation based on Craig Reynolds

Date March 2025
Tags
c++opengleigenimgui
Autonomous Agent Steering Behaviors - media 1
Seek behavior preview
0:00 / 0:00
Avoid
0:00 / 0:00
Leader Following
0:00 / 0:00
Flocking
0:00 / 0:00
Alignment
0:00 / 0:00
Seek
0:00 / 0:00
Flee
0:00 / 0:00
Arrival
0:00 / 0:00
Departure
0:00 / 0:00
Wander
0:00 / 0:00
Separation
0:00 / 0:00
Cohesion

Overview

This project implements autonomous agent steering behaviors for character animation, commonly used in games and crowd simulations. It is based on Craig Reynolds’ influential 1999 paper “Steering Behaviors for Autonomous Characters”, the same foundational work behind the flocking behaviors seen in many games and films.

The system enables virtual characters to navigate environments in a lifelike, reactive way without scripted paths. Each agent operates as a simple 2D vehicle that can accelerate, turn, and respond to its surroundings in real time. A feedback control system smoothly adjusts each agent’s speed and heading to match its behavioral goals.

The project includes 11 steering behaviors split into two categories.

Individual Behaviors

  • Seek: Move directly toward a target
  • Flee: Move directly away from a target
  • Arrival: Approach a target and smoothly decelerate to a stop
  • Departure: Push away from a position with stronger repulsion when closer
  • Wander: Generate natural-looking random meandering motion
  • Obstacle Avoidance: Detect and steer around obstacles in the agent’s path

Group Behaviors

  • Separation: Prevent agents from crowding together
  • Cohesion: Pull agents toward the center of their local group
  • Alignment: Match velocity with nearby neighbors
  • Flocking: Combine separation, cohesion, and alignment to produce classic “boids” behavior
  • Leader Following: Create formations where agents follow behind a designated leader

System Design

The system uses a sense-control-act loop, a classic reactive control pattern. Each frame, agents sense their environment, including target position, nearby obstacles, and neighboring agents. They then compute a desired velocity based on their active behavior and apply forces to move toward that goal. This creates smooth, responsive motion that adapts to changing conditions.

Built in C++ with OpenGL visualization. The standalone viewer allows real-time behavior testing with adjustable parameters and debug visualization showing current versus desired velocities.

Tools Used

C++, OpenGL, CMake, Eigen, ImGui