Improving the AI logic


I’ve been tweaking the logic of the computer-controlled players.

To avoid giving bots an unfair advantage, the AI logic controls the bees in the same way as the players do: by feeding game controller inputs into the code that animates the bees. Pico-8 does not support analogue game controllers: directional controls are either on or off. A directional input accelerates the bee in that direction, rather than move it by a fixed amount. As a result, the AI bots would sometimes overshoot their targets, accelerate too much the other way, overshoot again, and again, and again, and end up circling their target, never able to reach it.

I changed the AI to not accelerate the bee when it was close enough that it could “glide” to its target point. It’s not perfect – I used a heuristic instead of working out the proper maths – but seems to have eliminated the circling problem.

Leave a comment

Log in with itch.io to leave a comment.