Apr 13 2011

SKYNET

Until today, Fight Back’s AI ships were simple creatures. They operated by blindly pressing buttons at random. They weren’t easy to beat, sure, but they were stupid.

Now they are smart like fox. I’ve developed the new AI by building it to play the game against the old ones. It’s now better than I am. Here it is taking the current level 20 boss on, with some debug visualisation:

I’m using a sort of heat map approach – a combination of long term planning and short term reflex avoidance. Green squares are places it wants to be. Red squares are places it doesn’t. That’s how it gets around, lines up in a shooting position and dodges bullets.

The first step in writing an AI is making it perfect. This guy’s still a long way off, but it won’t be long! The second step is making it human – giving it human failings like reaction times and a longer decision loop, then teaching it to compensate for those with smarter, fuzzier decision-making. That’s the stuff I’ve got to get onto next, because if I use this AI for all the enemy ships right now the game is hell.