Tweak king PSQT for check and atomic variants
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 18 Apr 2021 19:58:40 +0000 (21:58 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 18 Apr 2021 19:58:40 +0000 (21:58 +0200)
atomic STC
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 1708 W: 617 L: 518 D: 573
http://www.variantfishtest.org:6543/tests/view/606f41666e23db21bb8bcac1

atomic LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 1519 W: 529 L: 435 D: 555
http://www.variantfishtest.org:6543/tests/view/60701de66e23db21bb8bcad0

3check STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 2576 W: 1279 L: 1145 D: 152
http://www.variantfishtest.org:6543/tests/view/606f417d6e23db21bb8bcac6

3check LTC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 2153 W: 1065 L: 938 D: 150
http://www.variantfishtest.org:6543/tests/view/60701dd66e23db21bb8bcacc

karouk STC
LLR: 2.95 (-2.94,2.94) [-10.00,5.00]
Total: 575 W: 293 L: 234 D: 48
http://www.variantfishtest.org:6543/tests/view/6074a1166e23db21bb8bcb07

karouk LTC
LLR: 2.95 (-2.94,2.94) [-10.00,5.00]
Total: 673 W: 323 L: 267 D: 83
http://www.variantfishtest.org:6543/tests/view/607575ee6e23db21bb8bcb1d

src/psqt.cpp

index 48e1d8d..de4187d 100644 (file)
@@ -322,6 +322,9 @@ void init(const Variant* v) {
           // In atomic variants pieces are "self-defending" and should therefore be pushed forward
           if (v->blastOnCapture)
               psq[pc][s] += make_score(40, 0) * (r - v->maxRank / 2);
+          // Safe king squares
+          if (r == RANK_1 && f <= FILE_B && ((pt == KING && v->checkCounting) || (pt == COMMONER && v->blastOnCapture)))
+              psq[pc][s] += make_score(100, 0);
           psq[~pc][rank_of(s) <= v->maxRank ? flip_rank(s, v->maxRank) : s] = -psq[pc][s];
       }
       // Pieces in hand