steerkit Reynolds' steering behaviors, small and engine-agnostic

Cohesion

Each agent is pulled toward the center of the neighbors it sees, harder the farther it is: none on the center itself, maxSpeed at the radius. What keeps a group together. A pull rather than a seek, so the agents don't overshoot the center and circle it: the groups travel. On its own, cohesion clumps the agents into knots; flocking balances it with separation. Here it is blended with wander, so the groups keep moving.

  • velocity
  • desired velocity
  • steering force

TypeScript