Simplify king danger for non-standard board sizes
authorFabian Fichter <ianfab@users.noreply.github.com>
Thu, 3 Jan 2019 22:22:45 +0000 (23:22 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Thu, 3 Jan 2019 22:22:45 +0000 (23:22 +0100)
Turns out to be a big improvement for small board sizes.

losalamos
LLR: 3.06 (-2.94,2.94) [-10.00,5.00]
Total: 56 W: 50 L: 1 D: 5

minishogi
LLR: 2.97 (-2.94,2.94) [-10.00,5.00]
Total: 104 W: 84 L: 18 D: 2

src/evaluate.cpp

index a1d5839..a607a08 100644 (file)
@@ -555,7 +555,7 @@ namespace {
         kingDanger +=        kingAttackersCount[Them] * kingAttackersWeight[Them]
                      + 102 * kingAttacksCount[Them] * (1 + pos.captures_to_hand() + !!pos.max_check_count())
                      + 191 * popcount(kingRing[Us] & weak) * (1 + pos.captures_to_hand() + !!pos.max_check_count())
-                     + 143 * popcount(pos.blockers_for_king(Us) | unsafeChecks) * 64 / popcount(pos.board_bb())
+                     + 143 * popcount(pos.blockers_for_king(Us) | unsafeChecks)
                      - 848 * !(pos.count<QUEEN>(Them) || pos.captures_to_hand())
                      -   9 * mg_value(score) / 8
                      +  40;