Saturday, January 26, 2008

Classic Dots Release Candidate

The release candidate for Classic Dots has been posted to the repository so anybody who knows how to compile Java and use a subversion repository can download and play with one of February's games. Tomorrow afternoon I plan on getting the modern version to a releasable state (also for February). I have made a slight change to the AI to make it play a much better game. Still, there is a lot more that could be done with the AI to improve the game even more and the best part is the additional changes would still not require using recursion! I have no intention of making the changes myself (at least not for the 1.0 version, though if I ever overhaul the series in the future I might) though the code is open source so anybody who thinks it might be a worthy challenge can. Lets take a look at what I would do.

Right now the AI looks at every square in the game and counts how many walls there are. 3 walls means that you are completing a square. 2 walls is a danger as you will be giving your opponent a square. 0 and 1 walled squares are relatively safe places to place lines. The problem is that it does not look at how the line would affect the neighbor, so the computer will occasionally draw a line that while is safe for the square it is looking at, results in the adjacent square having 3 walls. A more advanced AI would look at each line instead of each square to prevent this mistake. A really advanced AI would also run traces to count how many squares the opponent would earn if the wall of 3 was created so that at the end game the computer would be smart enough to give its opponent the least valuable run of squares.

No comments: