From 9957ca2f998472de19d5616c7fb86786cecf88b6 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Thu, 3 Jan 2019 22:33:10 +0100 Subject: [PATCH] Bonus for promoted pieces in drop variants 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 | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 345b1e1..e544705 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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(Us)) -- 1.7.0.4