Fix Up the Mini-Chess Evaluator
Deep search can make even a bad scoring function look good. Just scoring on piece value has a problem, though. There are many states that are tied. When few captures are about to happen, the search will sort of choose a move randomly from a lot of equal choices. It would be good to break those ties (in a way that makes sense) to give the search a better sense of preference.
Things that are often used to adjust the score include
- A bonus for Knight, Rook, or Bishop being "developed" (off its home square).
- An increase for pieces that attack a lot of squares.
- An increase for pieces near the center.
- An increase for pieces "attacked" (protected) by their own pieces.
- Lots of pawn things: a decrease for isolated Pawns; an increase for advanced Pawns, etc.
- Piece-specific things: an increase for a protected King, an increase for a Rook on opponent's second row, etc.
The problem with this is, as always, do-undo. If you calculate, for example, an extra score for a piece that attacks more than 5 squares, you have to recalculate every time that piece moves, but also when any other piece in its way moves. Often, the adjustment is fudged in a way that makes do-undo possible—for example, "x-ray" attacks.
Scale your scores up by 10x so that you have some room for adjustments. Add a bonus for each side for each piece attacking a center square. Then try some of the other adjustments listed above.