Monday, February 25, 2008

Laser Tactics - CPU v CPU

One of the best ways of testing your AI is to get it to play against itself. Often this isn't possible as most computer AI is very simplistic, involving standing still and shooting at the player, or following a set route and waiting for the player to trigger some change.

However, the AI in Laser Tactics is quite advanced (IMHO), and there is AI available for both sides in nearly all the various missions and objectives. So I quickly added the code so it's possible to select AI for both sides (previously you could only choose it for one side). The game also has a "Ghost" mode, which allows a player to view the game through the eyes of a unit that is CPU-controlled.

Once I'd set all this up, it's actually great fun watching the computer play against itself, especially when the missions actually have objectives (meaning it's not just a case of watching the units wander around shooting on-sight). And of course, it's ideal for checking that the AI works well and doesn't have any of the usual problems that AI suffers from (like get stuck in a loop or end up wandering in the wrong direction). Add to this the "randomly-generated map" option and it almost feels like I'm watching two humans battle each other. Place your bets now!

No comments: