Game playing AI, how to find a good board evaluation function?

490 Views Asked by At

I'm working on an AI to play a fairly simple game, using minimax and genetic algorithms to find weights to score board states with.

The game resembles 4x4 tictactoe, but a turn can be spent to move a piece to an adjacent space, pieces come in different sizes, and larger pieces can cover up smaller pieces.

I want to score the board by looking at a variety of factors, such as how close they are to completing a 4 in a row, and how many adjacent enemy pieces could potentially be moved onto, but I have no idea what these factors should specifically be.

My ideas: For each line, making a scoring expression based on number of friendly pieces, number of empty spaces, and number of enemy pieces, but I can't think of a simple expression to score that with weights, since the value probably won't be a linear function.

For each line, making a piecewise scoring expression split based on the number of enemy pieces in the row, and an expression based on the number of allies. Hence having 1 piece in an empty row might be worth more than having 1 piece in a row full of enemies, thus blocking them off, and the inverse would be true for having 3 in a row in a row that is already blocked.

Some complications I've noticed: Having 3 pieces in a row, but then one of the enemy large pieces also in the row, is virtually worthless for anything except preventing their piece's movement.

Having 3 pieces in a row, with a small enemy piece in that row is almost a win, if you can place a large piece adjacent to their small piece to move onto it. This seems particularly hard to detect. It's also possible if this is worked into a factor, the above "number of adjacent enemies that can be moved onto" won't be necessary.

Thanks for any help. I have no clue how to proceed.

0

There are 0 best solutions below