Swarm Bots
Agent Algorithm
A swarm agent looks at all the other agents he can see and selects the closest ones to follow. He then averages the velocities of his selected neighbors and accelerates in that direction, with a little bit of randomness added.
Pseudocode
neighborsToFollow = selectNeighbors(visibleAgents) adjustedAverageVelocity = averageVelocities(neighborsToFollow) * (1 - randomizationFactor) randomization = random direction * randomizationFactor acceleration = adjustedAverageVelocity + randomization
Observed Behavior
This really is the simplest algorithm that will produce "life-like" behavior. The agents move around in swarms, at least until a wall stops them. The sliders vary the behavior in many different ways.
Unchecking "Choose Neighbors by Proximity" will change the algorithm to select random neighbors to follow.