From: Fabian Fichter Date: Tue, 30 Jun 2020 17:27:58 +0000 (+0200) Subject: Tweak endgame scale factor X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=a271a10e4fdded05a852d84e6191351504d77b29;p=fairystockfish.git Tweak endgame scale factor makruk STC LLR: 2.99 (-2.94,2.94) [0.00,10.00] Total: 2918 W: 272 L: 203 D: 2443 http://www.variantfishtest.org:6543/tests/view/5ef3c19a6e23db104fb88c5f makruk LTC LLR: 2.95 (-2.94,2.94) [0.00,10.00] Total: 8027 W: 495 L: 416 D: 7116 http://www.variantfishtest.org:6543/tests/view/5ef3c8db6e23db104fb88c68 --- diff --git a/src/material.cpp b/src/material.cpp index 46de4b1..e65c9cc 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -222,12 +222,12 @@ Entry* probe(const Position& pos) { // advantage. This catches some trivial draws like KK, KBK and KNK and gives a // drawish scale factor for cases such as KRKBP and KmmKm (except for KBBKN). if (!pos.count(WHITE) && npm_w - npm_b <= BishopValueMg) - e->factor[WHITE] = uint8_t(npm_w < RookValueMg ? SCALE_FACTOR_DRAW : - npm_b <= BishopValueMg ? 4 : 14); + e->factor[WHITE] = uint8_t(npm_w < RookValueMg && pos.count(WHITE) <= 2 ? SCALE_FACTOR_DRAW : + npm_b <= BishopValueMg && pos.count(WHITE) <= 3 ? 4 : 14); if (!pos.count(BLACK) && npm_b - npm_w <= BishopValueMg) - e->factor[BLACK] = uint8_t(npm_b < RookValueMg ? SCALE_FACTOR_DRAW : - npm_w <= BishopValueMg ? 4 : 14); + e->factor[BLACK] = uint8_t(npm_b < RookValueMg && pos.count(BLACK) <= 2 ? SCALE_FACTOR_DRAW : + npm_w <= BishopValueMg && pos.count(BLACK) <= 3 ? 4 : 14); } // Evaluate the material imbalance. We use PIECE_TYPE_NONE as a place holder