From f922c1c8b6cc7d5925fc3fbc1a99a28ec95ed784 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sat, 6 Jun 2020 23:36:41 +0200 Subject: [PATCH] Adjust pawn value based on promotion type shatranj STC LLR: 2.98 (-2.94,2.94) [0.00,10.00] Total: 3802 W: 386 L: 311 D: 3105 http://www.variantfishtest.org:6543/tests/view/5ed4336b6e23db36d55f2cf9 shatranj LTC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 2686 W: 230 L: 164 D: 2292 http://www.variantfishtest.org:6543/tests/view/5ed81b436e23db36d55f2d3b sittuyin STC LLR: 2.98 (-2.94,2.94) [0.00,10.00] Total: 1820 W: 168 L: 105 D: 1547 http://www.variantfishtest.org:6543/tests/view/5ed73f8b6e23db36d55f2d19 sittuyin LTC LLR: 2.96 (-2.94,2.94) [0.00,10.00] Total: 2435 W: 158 L: 97 D: 2180 http://www.variantfishtest.org:6543/tests/view/5ed81bb86e23db36d55f2d3e --- src/psqt.cpp | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/psqt.cpp b/src/psqt.cpp index 6b7fe5f..f904238 100644 --- a/src/psqt.cpp +++ b/src/psqt.cpp @@ -130,6 +130,10 @@ void init(const Variant* v) { if (PieceValue[MG][pt] > PieceValue[MG][strongestPiece]) strongestPiece = pt; + Value maxPromotion = VALUE_ZERO; + for (PieceType pt : v->promotionPieceTypes) + maxPromotion = std::max(maxPromotion, PieceValue[EG][pt]); + for (PieceType pt = PAWN; pt <= KING; ++pt) { Piece pc = make_piece(WHITE, pt); @@ -139,6 +143,10 @@ void init(const Variant* v) { Score score = make_score(PieceValue[MG][pc], PieceValue[EG][pc]); + // Consider promotion types in pawn score + if (pt == PAWN) + score -= make_score(0, (QueenValueEg - maxPromotion) / 100); + // Scale slider piece values with board size const PieceInfo* pi = pieceMap.find(pt)->second; bool isSlider = pi->sliderQuiet.size() || pi->sliderCapture.size() || pi->hopperQuiet.size() || pi->hopperCapture.size(); -- 1.7.0.4