Kicker Bots

Agent Algorithm

A kicker agent chooses a visible ball at random and accelerates towards it. If no ball is visible the agent sets his acceleration to zero.

Pseudocode

visibleBalls = {}
for all visibleObjects
   if visibleObject is ball
      visibleBalls <-- visibleObject
if visibleBalls is not empty
   ball = selectRandom(visibleBalls)
   accelerate towards ball
else
   set acceleration to zero

Observed Behavior

Since a kicker agent doesn't remember which ball he's accelerating towards from one moment to the next, if he can see multiple balls (e.g. if Number of Balls or Agent Sight is set high), he will appear to have a pretty short attention span, since the ball he will chose balls randomly each time.

The ceasing to accelerate strategy works well when a ball goes out of sight, because chances are the agent was accelerating in the same direction as the ball at last sighting, and an agent without acceleration will bounce around the board just like the ball. To see this, turn down the Agent Sight to around 10 or 15, so that if there's another agent between him and the ball, an agent probably won't be able to see the ball.

If there are too many agents or too few balls, the agents will end up trapping the balls in the corners and the game ceases to be interesting.

The Applet

If you see this, you need to either enable java, or install the Sun Java Virtual Machine in your browser. To do so, click here.

Source Code

Back to the Applet Bots Home
The official version of this file is at applet-bots.sourceforge.net