Steering Behaviours

Steering behaviors work by computing a desired velocity (where the entity wants to go, at full speed) and comparing it to the current velocity, producing a steering force — the adjustment needed to close that gap. This is then clamped to a maximum force so the entity accelerates smoothly rather than snapping direction instantly, which is what gives steering-based movement its organic feel compared to directly setting position.

  • Steering - Seek: desired velocity always points straight at the target at max speed.
  • Steering - Arrive (seek with slowdown): same as seek, but desired speed is scaled down linearly as the entity enters a "slow radius" near the target — this is just a lerp of speed from 0 to max based on distance / slowRadius, and it's what prevents entities from overshooting and jittering around their destination.
  • Steering - Wander: projects an imaginary circle out in front of the entity and picks a point on that circle's edge, perturbed slightly each frame by a random jitter angle. Feeding that point into seek produces movement that curves unpredictably but continuously, because the target point only changes a little between frames rather than teleporting randomly.