Bonus for promoted pieces in drop variants
authorFabian Fichter <ianfab@users.noreply.github.com>
Thu, 3 Jan 2019 21:33:10 +0000 (22:33 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Thu, 3 Jan 2019 21:33:10 +0000 (22:33 +0100)
Since they demote when being captured, promoted pieces
are more valuable than the promotion piece type itself.

minishogi
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 666 W: 375 L: 266 D: 25

shogi
LLR: 2.97 (-2.94,2.94) [-10.00,5.00]
Total: 1020 W: 529 L: 469 D: 22

src/evaluate.cpp

index 345b1e1..e544705 100644 (file)
@@ -355,6 +355,9 @@ namespace {
                 score += make_score(PieceValue[MG][pos.promoted_piece_type(Pt)] - PieceValue[MG][Pt],
                                     PieceValue[EG][pos.promoted_piece_type(Pt)] - PieceValue[EG][Pt]) / 10;
         }
+        else if (pos.captures_to_hand() && pos.unpromoted_piece_on(s))
+            score += make_score(PieceValue[MG][Pt] - PieceValue[MG][pos.unpromoted_piece_on(s)],
+                                PieceValue[EG][Pt] - PieceValue[EG][pos.unpromoted_piece_on(s)]) / 8;
 
         // Penalty if the piece is far from the king
         if (pos.count<KING>(Us))