Tweak shogi piece promotion bonus
authorFabian Fichter <ianfab@users.noreply.github.com>
Fri, 2 Oct 2020 09:31:14 +0000 (11:31 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Fri, 2 Oct 2020 09:33:35 +0000 (11:33 +0200)
shogi STC (failed)
LLR: -2.97 (-2.94,2.94) [0.00,10.00]
Total: 7135 W: 3552 L: 3552 D: 31
http://www.variantfishtest.org:6543/tests/view/5f51377b6e23db221d9e9065

shogi LTC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 14354 W: 7294 L: 6985 D: 75
http://www.variantfishtest.org:6543/tests/view/5f65a4de6e23db221d9e91cc

src/evaluate.cpp

index 68f0b0f..04a57c1 100644 (file)
@@ -352,9 +352,10 @@ namespace {
         // Piece promotion bonus
         if (pos.promoted_piece_type(Pt) != NO_PIECE_TYPE)
         {
-            if (promotion_zone_bb(Us, pos.promotion_rank(), pos.max_rank()) & (b | s))
+            Bitboard zone = promotion_zone_bb(Us, pos.promotion_rank(), pos.max_rank());
+            if (zone & (b | s))
                 score += make_score(PieceValue[MG][pos.promoted_piece_type(Pt)] - PieceValue[MG][Pt],
-                                    PieceValue[EG][pos.promoted_piece_type(Pt)] - PieceValue[EG][Pt]) / 10;
+                                    PieceValue[EG][pos.promoted_piece_type(Pt)] - PieceValue[EG][Pt]) / (zone & s && b ? 6 : 12);
         }
         else if (pos.piece_demotion() && pos.unpromoted_piece_on(s))
             score -= make_score(PieceValue[MG][Pt] - PieceValue[MG][pos.unpromoted_piece_on(s)],