by Pedro Castro » 01 Jun 2008, 02:55
If you want to connect your engine to a GUI, you need a protocol, xboard or uci.
To send information of the evaluation to GUI, you have to do in centipawns, this is simply multiplied by 100.
So the values of material you have to take are:
Queen: 800, Knigt: 250, rook: 400, bishop: 300, pawn: 100
Now if it makes sense to eval the bishops pair with 40, as otherwise this is worth more than all the material together.
Build for each type of piece a table of positions PST, even for each piece can take 2 boards, one for the opening-midlegame and one for the endgame. The best thing in the middle game is that the king is castled and in the endgame the best thing is that the king go to the middle of the board.
int king_pcsq[64] = {
-30,-30,-30,-30,-30,-30,-30,-30,
-30,-30,-30,-30,-30,-30,-30,-30,
-30,-30,-30,-30,-30,-30,-30,-30,
-30,-30,-30,-30,-30,-30,-30,-30,
-30,-30,-30,-30,-30,-30,-30,-30,
-30,-30,-30,-30,-30,-30,-30,-30,
-3, -2, -5,-10,-10, -5, -2, -3,
-5, 20, 40, -5, -5, 0, 40, -5
};
int king_endgame_pcsq[64] = {
-5, 0, 0, 1, 1, 0, 0, -5,
-4, 7, 10, 10, 10, 10, 7, -4,
0, 10, 15, 20, 20, 15, 10, 0,
1, 10, 20, 30, 30, 20, 10, 1,
1, 10, 20, 30, 30, 20, 10, 1,
0, 10, 15, 20, 20, 15, 10, 0,
-4, 7, 10, 10, 10, 10, 7, -4,
-5, 0, 0, 1, 1, 0, 0, -5
};
The connection of the rooks has its importance in the seventh and eighth rows (maybe here too queen and rook). Other pieces not.
Passed pawns are very dangers and more as they are closer to the seventh row, rate more, you can make an eval by rows, for example passedpawn[] = {0, 0, 0, 20, 40, 70, 110, 0}
Best wishes,
Pedro Castro