← Iris
Boids: 80
Obstacles: 5
Order: 0.00
Click canvas to add obstacle  •  Right-click to remove nearest
Number of boids80
Obstacle radius30
Avoidance strength3.0

About this lab

Obstacle avoidance extends the basic boids model with an additional steering force. For each obstacle, an agent calculates whether the obstacle lies ahead in its path: if the distance to the obstacle is less than a lookahead distance and the lateral displacement is less than the obstacle radius, the agent steers laterally away, with strength proportional to 1/d².

This produces naturalistic detour behavior: the flock splits around obstacles and reforms on the far side. The challenge is tuning the relative weights so that obstacle avoidance overrides cohesion when necessary, while not fragmenting the flock when obstacles are distant. At high avoidance strength, agents become highly responsive; at low strength, some agents may clip obstacle boundaries.

The same principles apply in robot motion planning, autonomous vehicle navigation, and computer game AI. Reynolds himself extended his work on steering behaviors to include path following, pursuit, evasion, and formation keeping.