Penalty for undroppable shogi pawns
authorFabian Fichter <ianfab@users.noreply.github.com>
Mon, 14 Sep 2020 19:32:15 +0000 (21:32 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Mon, 14 Sep 2020 19:32:15 +0000 (21:32 +0200)
shogi STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 5265 W: 2710 L: 2532 D: 23
http://www.variantfishtest.org:6543/tests/view/5f5a95fa6e23db221d9e9120

shogi LTC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 3730 W: 1932 L: 1776 D: 22
http://www.variantfishtest.org:6543/tests/view/5f5c8fec6e23db221d9e9154

src/evaluate.cpp
src/psqt.cpp

index 5000df0..90de684 100644 (file)
@@ -471,6 +471,9 @@ namespace {
         // Reduce score if there is a deficit of gates
         if (pos.seirawan_gating() && !pos.piece_drops() && pos.count_in_hand(Us, ALL_PIECES) > popcount(pos.gates(Us)))
             score -= make_score(200, 900) / pos.count_in_hand(Us, ALL_PIECES) * (pos.count_in_hand(Us, ALL_PIECES) - popcount(pos.gates(Us)));
+
+        if (pt == SHOGI_PAWN && !pos.shogi_doubled_pawn())
+            score -= make_score(50, 20) * std::max(pos.count_with_hand(Us, SHOGI_PAWN) - pos.max_file() - 1, 0);
     }
 
     return score;
index 67b8bdb..d7f4a08 100644 (file)
@@ -213,7 +213,7 @@ void init(const Variant* v) {
           psq[~pc][rank_of(s) <= v->maxRank ? flip_rank(s, v->maxRank) : s] = -psq[pc][s];
       }
       // pieces in pocket
-      psq[ pc][SQ_NONE] = score + make_score(35, 10) * (1 + !(isSlider || pt == SHOGI_PAWN));
+      psq[ pc][SQ_NONE] = score + make_score(35, 10) * (1 + !isSlider);
       psq[~pc][SQ_NONE] = -psq[pc][SQ_NONE];
   }
 }