From 5037ab5b775d6769997c539aa505a2b6eb8edd1a Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Fri, 2 Oct 2020 11:31:14 +0200 Subject: [PATCH] Tweak shogi piece promotion bonus 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 | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 68f0b0f..04a57c1 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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)], -- 1.7.0.4