From 31343092024b21e62be46d741ed46356a1bb6817 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Thu, 4 Jun 2020 22:13:40 +0200 Subject: [PATCH] Evaluate endgame king proximity makruk STC LLR: 2.98 (-2.94,2.94) [0.00,10.00] Total: 1496 W: 171 L: 107 D: 1218 http://www.variantfishtest.org:6543/tests/view/5ed10e526e23db36d55f2c70 makruk LTC LLR: 2.99 (-2.94,2.94) [0.00,10.00] Total: 1810 W: 154 L: 92 D: 1564 http://www.variantfishtest.org:6543/tests/view/5ed36b986e23db36d55f2cc3 --- src/evaluate.cpp | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index a11be4b..675ab8e 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -136,6 +136,7 @@ namespace { // KingProximity contains a penalty according to distance from king constexpr Score KingProximity = S(1, 3); + constexpr Score EndgameKingProximity = S(0, 10); // Assorted bonuses and penalties constexpr Score BishopPawns = S( 3, 7); @@ -344,6 +345,9 @@ namespace { 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)); + else if (pos.count(Us) && (Pt == FERS || Pt == SILVER)) + score -= EndgameKingProximity * (distance(s, pos.square(Us)) - 2); + if (Pt == BISHOP || Pt == KNIGHT) { // Bonus if piece is on an outpost square or can reach one -- 1.7.0.4