Saturday, July 14, 2007

AI

Before summer break, I started working on the AI. I'd been thinking to present the various options in the order of importanct, then scroll through them with the various possible moves until I found something that worked. Here's an example of what that would have looked like for preventing your opponent from kinging to the right:

Photo Sharing and Video Hosting at Photobucket
Click on the image for a closer look!


However, as I continued working, I realized that we had no way of dealing with multiple-jump scenarios. The way we had it set up, the list of possible moves the AI was going to be working with--which it was receiving from the hightlighting--only accounted for one or no jumps. If there was a multi-jump, it would create the highlighting list a second time, meaning that the next best possible jump calculated by the AI might not necessarily be the next jump in the multi-jump series, which is against the rules.

So Alan wrote class Command to enforce the multi-jump rule. However, that meant I was going to have to rewrite the AI. Also, the idea of weighting the possible moves finally made sense to me; for some reason, when we'd discussed in the past, it didn't sink in that the AI would add up the points for each criteria the move qualified for. I'm thinking the point values s are going to look something like this:

King piece: 150
Prevent opponent kinging: 85
Capture opponent king: 80
Move king out of harm's way: 40
Capture opponent pawn: 20
Move pawn out of harm's way: 10
Set up for a jump next turn: 5
Move with no consequences: 1
Put pawn in danger: -5
Put king in danger: -10

Each possible move will be assigned a point value based on how many of these criteria it meets. Then each move's point value will be compared, and the move with the highest point value will be the one selected.


--jess