From: Fabian Fichter Date: Mon, 21 Dec 2020 11:45:23 +0000 (+0100) Subject: Skip king proximity malus when attacking king ring X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=32f617026ea9c181a88bb15280ebcaf50d5ab043;p=fairystockfish.git Skip king proximity malus when attacking king ring shogi STC LLR: 2.95 (-2.94,2.94) [0.00,10.00] Total: 2087 W: 1103 L: 971 D: 13 http://www.variantfishtest.org:6543/tests/view/5fdf764f6e23db221d9e95fa shogi LTC LLR: 2.96 (-2.94,2.94) [0.00,10.00] Total: 950 W: 531 L: 415 D: 4 http://www.variantfishtest.org:6543/tests/view/5fe05bac6e23db221d9e961d crazyhouse STC LLR: 2.98 (-2.94,2.94) [-10.00,5.00] Total: 1699 W: 855 L: 800 D: 44 http://www.variantfishtest.org:6543/tests/view/5fdf83966e23db221d9e9606 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index d53b1d0..14f5912 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -506,7 +506,10 @@ namespace { // Penalty if the piece is far from the kings in drop variants if ((pos.captures_to_hand() || pos.two_boards()) && pos.count(Them) && pos.count(Us)) - score -= KingProximity * distance(s, pos.square(Us)) * distance(s, pos.square(Them)); + { + if (!(b & (kingRing[Us] | kingRing[Them]))) + score -= KingProximity * distance(s, pos.square(Us)) * distance(s, pos.square(Them)); + } else if (pos.count(Us) && (Pt == FERS || Pt == SILVER)) score -= EndgameKingProximity * (distance(s, pos.square(Us)) - 2);