Increase king danger for nCheck endgames
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 28 Jul 2019 15:11:27 +0000 (17:11 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Mon, 29 Jul 2019 19:09:58 +0000 (21:09 +0200)
3check STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 1085 W: 569 L: 456 D: 60
http://35.161.250.236:6543/tests/view/5d3dcc106e23db34f4206d19

3check LTC
LLR: 2.94 (-2.94,2.94) [0.00,10.00]
Total: 1107 W: 587 L: 473 D: 47
http://35.161.250.236:6543/tests/view/5d3de4a46e23db34f4206d1e

src/evaluate.cpp

index 95174d7..c469a85 100644 (file)
@@ -566,6 +566,9 @@ namespace {
     // King tropism bonus, to anticipate slow motion attacks on our king
     score -= FlankAttacks * kingFlankAttacks * (1 + 5 * pos.captures_to_hand() + !!pos.max_check_count());
 
+    if (pos.max_check_count())
+        score += make_score(0, mg_value(score) / 2);
+
     // For drop games, king danger is independent of game phase
     if (pos.captures_to_hand())
         score = make_score(mg_value(score), mg_value(score)) / (1 + !pos.shogi_doubled_pawn());