skip to content

Steering and Crowd Movement

Turning a path into motion: desired-velocity steering (seek, arrive, wander), boids flocking and RVO/ORCA local avoidance. Interviews probe where path planning ends and avoidance begins.

on this pageshow

explore

questions

6

In Reynolds-style steering, what is a desired velocity, and how does seek turn it into a capped steering force?

level: juniorimportance: must knowfreq 65%

answer

  1. want minus have
  2. full speed straight at the target
  3. truncate force, then truncate speed
  4. force limit sets the turning radius

basics

~20 s

Seek's desired velocity points from the agent straight at the target at maximum speed. The steering force is desired velocity minus current velocity, truncated to a maximum force, so the agent bends onto the new heading instead of snapping.

solid answer

~40 s

A **desired velocity** is the velocity the agent would adopt if it could change velocity instantly. For seek it is `normalize(target - position) * maxSpeed`; flee simply negates the direction. The **steering force** is the correction `desired - velocity`, truncated to `maxForce`; dividing by mass gives an acceleration, and the movement layer integrates velocity, truncated to `maxSpeed`, and then position. The two caps are what make the result read as a body rather than a cursor: the velocity can only bend a little per tick, so the agent carves curves no tighter than a radius of about `speed^2 / maxAcceleration`. Pursue and evade reuse seek and flee on a predicted target position. The output is a request, an acceleration, that a character controller or physics body then carries out.

code

pseudocode · 17 lines
pseudocode
function seek(agent, target):
    toTarget = target - agent.position
    if length(toTarget) < EPSILON:
        return (0, 0)                      // on the target: no direction to seek
    desired = normalize(toTarget) * agent.maxSpeed
    steering = desired - agent.velocity
    return truncate(steering, agent.maxForce)

function pursue(agent, quarry):
    T = length(quarry.position - agent.position) / agent.maxSpeed
    predicted = quarry.position + quarry.velocity * T
    return seek(agent, predicted)

function step(agent, steering, dt):           // minimal point-mass locomotion
    acceleration = steering / agent.mass
    agent.velocity = truncate(agent.velocity + acceleration * dt, agent.maxSpeed)
    agent.position = agent.position + agent.velocity * dt

go deeper

for a junior

Recall the formula: desired velocity is full speed toward the target, steering is desired minus current, and the result is truncated to a maximum force before use.

for a middle

Explain how the force and speed caps produce a turning radius, why seek overshoots, and how pursue, evade and wander reuse the same desired-minus-current pattern.

for a senior

Show you keep steering separate from locomotion and decision making, and can say which layer owns a symptom such as instant turns, overshoot or an agent pushing into a wall.

for a principal

Frame steering as one layer of a movement stack and its tuning numbers as a shared contract between design, animation and physics, not as per-agent tweaks.

## Where steering sits Reynolds described the motion of autonomous characters as three layers, and keeping them apart is the first thing an interviewer listens for: - **Action selection** decides *what* the agent wants: chase the intruder, head for the exit, flee the explosion. A state machine, behavior tree or planner lives here. - **Steering** turns that wish into a **steering force**: a small correction to the current velocity, recomputed every tick. - **Locomotion** carries it out: a point-mass integrator in a prototype, a character controller or physics body in a game, often with an animation layer on top. Steering never moves the body and never plans a route. It answers one question: given where I am, how fast I am going and where I want to be, which way should I push right now? ## Seek, step by step **Seek** is the simplest behaviour and the template for the others. Each tick: 1. Compute the offset to the target: `toTarget = target - position`. 2. Build the **desired velocity**: the offset's direction at full speed, `normalize(toTarget) * maxSpeed`. This is the velocity the agent would take if it could change velocity instantly. 3. Compute the **steering force** as the difference between what it wants and what it has: `steering = desired - velocity`. 4. **Truncate** the steering force to `maxForce` and divide by mass to get an acceleration. 5. Hand the acceleration to locomotion, which integrates velocity (truncated to `maxSpeed`) and then position. **Flee** is seek with the desired velocity reversed: `normalize(position - target) * maxSpeed`. ## Why the two limits matter The two truncations are what make the output look like a moving body: - **Maximum force** limits how much the velocity can change per tick, so a sudden change of goal produces a curve rather than a snap. - **Maximum speed** caps how fast the agent travels however long it keeps accelerating. - Together they set the **turning radius**. A body moving at speed `v` around a circle of radius `R` needs a sideways acceleration of `v^2 / R`. If the most the agent can apply is `aMax = maxForce / mass`, the tightest circle it can hold at speed `v` is `R = v^2 / aMax`. Doubling the speed quadruples that radius; doubling the force limit halves it. That is why tuning happens on these numbers rather than in the behaviour: a nimble drone and a lumbering tank can run the same seek code with different limits. ## The family built on seek | Behaviour | Desired velocity | Typical use | |---|---|---| | Seek | toward the target at full speed | chase a point, steer to a waypoint | | Flee | away from the target at full speed | escape a threat | | Pursue | seek toward a **predicted** target position | intercept a moving target | | Evade | flee from a predicted position | escape a pursuer | | Wander | seek a jittered point on a circle ahead | idle roaming that looks purposeful | | Arrive | seek, slowing inside a radius | stop at a destination | **Pursue** predicts where the target will be `T` seconds ahead, `target.position + target.velocity * T`, and seeks that point; a simple estimate of `T` is the distance divided by the pursuer's speed. A drone chasing a moving target with plain seek aims where the target *is*, so it trails behind and curls into a tail chase; pursue aims where the target *will be* and cuts across its path. **Wander** keeps a point on a circle projected in front of the agent and nudges it by a small random amount each tick, so the heading drifts smoothly instead of jittering. ## Common mistakes - Treating the desired velocity as the output and assigning it straight to the velocity. The agent then turns instantly and the force limit does nothing. - Expecting seek to stop. It reaches the target at full speed and overshoots; stopping is the arrive behaviour's job. - Normalising a zero vector when the agent sits exactly on the target, which produces invalid numbers that then spread into position. - Mixing units: if the steering force is treated as an acceleration in one place and divided by mass in another, every tuning value quietly changes meaning. - Expecting steering to get around a wall. Seek pushes straight at its target; finding the way around obstacles is the route planner's job, and steering then follows the waypoints it hands over.

  • How does pursue choose where to aim, and when does that prediction fail?
    Pursue seeks `target.position + target.velocity * T`, where `T` is commonly the distance divided by the pursuer's speed. It is a straight-line extrapolation, so it misleads when the target turns or accelerates, and more so the larger `T` is. An exact lead solves for the intercept time with a quadratic, still assuming the target keeps its velocity; if that equation has no positive root, no straight-line intercept at that speed exists.
  • Why does wander move a point on a circle ahead of the agent instead of picking a random direction each tick?
    A fresh random direction every tick produces jittery, aimless motion, because the desired velocity jumps around faster than the agent can follow. Wander keeps a target on a circle projected ahead and moves it by a small random step per tick, so the desired heading drifts smoothly. The circle's distance, its radius and the jitter size tune how often and how sharply the agent turns.

  • The steering force is the desired velocity itself, assigned straight to the agent.
  • Seek slows down on its own as the distance to the target shrinks.
  • Capping speed is enough; the force limit does not change the path taken.
  • Pursue is seek on the target's current position, only at a higher speed.
  • Steering behaviours find a way around walls to reach the target.
open as a page

Why does a steering agent using seek overshoot and orbit its destination, and how does arrive with a slowing radius fix it?

level: middleimportance: must knowfreq 58%

basics

~20 s

Seek always asks for full speed toward the target, so the agent arrives fast and cannot brake in time. Arrive ramps the desired speed down to zero inside a slowing radius, which must be at least the agent's braking distance.

open as a page

In Reynolds' boids flocking, what do separation, alignment and cohesion each compute, and what decides which flockmates a boid reacts to?

level: middleimportance: should knowfreq 55%

basics

~20 s

Separation steers away from flockmates that are too close, alignment toward their average heading, cohesion toward their average position. A boid reacts only to neighbours inside a radius, often within a view angle, so the flock emerges from local rules.

open as a page

Why steer a crowd of thousands sharing one goal with a flow field instead of one path per agent, and how is the field built?

level: middleimportance: should knowfreq 42%

basics

~20 s

A flow field is built once per goal: a wavefront from the goal gives each cell its cost-to-goal and a downhill direction. Any number of agents then read their cell in constant time instead of each running its own search.

open as a page

A drone summing weighted seek and obstacle-avoidance forces stalls in front of a pillar or jitters beside it; why, and how do priority arbitration or context steering fix it?

level: seniorimportance: should knowfreq 45%

basics

~20 s

Weighted blending adds vectors, so avoidance pointing back against seek cancels it and the drone stalls, or the sum flips as avoidance grows. Priority arbitration lets the most urgent behaviour win; context steering chooses among directions before building one vector.

open as a page

Agents using ORCA local avoidance jam and stand still at a stadium's single exit gate; why does reciprocal avoidance deadlock there, and how would you fix it?

level: seniorimportance: should knowfreq 48%

basics

~20 s

ORCA targets collision avoidance, not progress: each agent takes the allowed velocity nearest its preferred one, and a dense, symmetric press at one gate leaves only near-zero options. Break symmetry, spread goals across the gate, shorten the horizon.

open as a page