Penalty for inaccessible king ring squares
authorFabian Fichter <ianfab@users.noreply.github.com>
Fri, 1 May 2020 18:25:05 +0000 (20:25 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Fri, 1 May 2020 18:25:05 +0000 (20:25 +0200)
janggi
LLR: 2.99 (-2.94,2.94) [0.00,10.00]
Total: 610 W: 330 L: 226 D: 54

xiangqi
Total: 400 W: 113 L: 115 D: 172

src/evaluate.cpp

index 900a8a8..d8de620 100644 (file)
@@ -563,7 +563,7 @@ namespace {
     kingDanger +=        kingAttackersCount[Them] * kingAttackersWeight[Them]
                  +       kingAttackersCountInHand[Them] * kingAttackersWeight[Them]
                  +       kingAttackersCount[Them] * kingAttackersWeightInHand[Them]
-                 + 185 * popcount(kingRing[Us] & weak) * (1 + pos.captures_to_hand() + pos.check_counting())
+                 + 185 * popcount(kingRing[Us] & (weak | ~pos.board_bb(Us, KING))) * (1 + pos.captures_to_hand() + pos.check_counting())
                  + 148 * popcount(unsafeChecks)
                  +  98 * popcount(pos.blockers_for_king(Us))
                  +  69 * kingAttacksCount[Them] * (2 + 8 * pos.check_counting() + pos.captures_to_hand()) / 2