Scale endgame danger with checks
authorFabian Fichter <ianfab@users.noreply.github.com>
Fri, 28 Feb 2020 17:52:28 +0000 (18:52 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Fri, 28 Feb 2020 17:52:28 +0000 (18:52 +0100)
3check STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 9256 W: 4385 L: 4157 D: 714
http://www.variantfishtest.org:6543/tests/view/5e564bfc6e23db46beba4ede

3check LTC
LLR: -2.97 (-2.94,2.94) [0.00,10.00]
Total: 11218 W: 5188 L: 5123 D: 907
http://www.variantfishtest.org:6543/tests/view/5e5685976e23db46beba4f00

5check STC
LLR: 2.95 (-2.94,2.94) [-10.00,5.00]
Total: 393 W: 189 L: 134 D: 70
http://www.variantfishtest.org:6543/tests/view/5e564c1d6e23db46beba4ee1

src/evaluate.cpp

index dce81a0..8348904 100644 (file)
@@ -576,7 +576,10 @@ namespace {
     // Penalty if king flank is under attack, potentially moving toward the king
     score -= FlankAttacks * kingFlankAttack * (1 + 5 * pos.captures_to_hand() + pos.check_counting());
 
-    if (pos.check_counting() || pos.king_type() == WAZIR)
+    if (pos.check_counting())
+        score += make_score(0, mg_value(score) * 2 / (2 + pos.checks_remaining(Them)));
+
+    if (pos.king_type() == WAZIR)
         score += make_score(0, mg_value(score) / 2);
 
     // For drop games, king danger is independent of game phase