From: Fabian Fichter Date: Sun, 1 Dec 2019 22:24:35 +0000 (+0100) Subject: Boost piece value of strongest piece X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=4a4c41170e3c18afb86a0d62d1fc99a4e2b69a6a;p=fairystockfish.git Boost piece value of strongest piece shatranj STC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 3168 W: 375 L: 300 D: 2493 http://www.variantfishtest.org:6543/tests/view/5de29de76e23db1ffe4a285e shatranj LTC LLR: 2.96 (-2.94,2.94) [0.00,10.00] Total: 2416 W: 226 L: 160 D: 2030 http://www.variantfishtest.org:6543/tests/view/5de3007f6e23db1ffe4a2864 --- diff --git a/src/psqt.cpp b/src/psqt.cpp index cf8dfba..3242a8f 100644 --- a/src/psqt.cpp +++ b/src/psqt.cpp @@ -125,6 +125,11 @@ Score psq[PIECE_NB][SQUARE_NB + 1]; // tables are initialized by flipping and changing the sign of the white scores. void init(const Variant* v) { + PieceType strongestPiece = NO_PIECE_TYPE; + for (PieceType pt : v->pieceTypes) + if (PieceValue[MG][pt] > PieceValue[MG][strongestPiece]) + strongestPiece = pt; + for (PieceType pt = PAWN; pt <= KING; ++pt) { Piece pc = make_piece(WHITE, pt); @@ -147,6 +152,9 @@ void init(const Variant* v) { if (v->capturesToHand || !v->checking) score = make_score(mg_value(score) * int(EndgameLimit) / (2 * EndgameLimit + mg_value(score)), eg_value(score) * int(EndgameLimit) / (2 * EndgameLimit + eg_value(score))); + else if (pt == strongestPiece) + score += make_score(std::max(QueenValueMg - PieceValue[MG][pt], VALUE_ZERO) / 20, + std::max(QueenValueEg - PieceValue[EG][pt], VALUE_ZERO) / 20); // For antichess variants, use negative piece values if ( v->extinctionValue == VALUE_MATE