From 16022f174bd7ea309cf85dad9eb180e12c4d1135 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Mon, 14 Oct 2019 13:51:55 +0200 Subject: [PATCH] Scale piece values with board size losalamos STC LLR: 2.98 (-2.94,2.94) [0.00,10.00] Total: 786 W: 242 L: 164 D: 380 http://35.161.250.236:6543/tests/view/5da456e16e23db3768ec0928 losalamos LTC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 480 W: 161 L: 87 D: 232 http://35.161.250.236:6543/tests/view/5da4790a6e23db3768ec092a courier STC LLR: 2.98 (-2.94,2.94) [0.00,10.00] Total: 1971 W: 550 L: 459 D: 962 http://35.161.250.236:6543/tests/view/5da4f9696e23db3768ec0938 courier LTC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 755 W: 231 L: 154 D: 370 http://35.161.250.236:6543/tests/view/5da4fa306e23db3768ec093b --- src/psqt.cpp | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/src/psqt.cpp b/src/psqt.cpp index 9f9f1af..4b78b5f 100644 --- a/src/psqt.cpp +++ b/src/psqt.cpp @@ -21,6 +21,7 @@ #include #include "types.h" +#include "piece.h" #include "variant.h" Value PieceValue[PHASE_NB][PIECE_NB] = { @@ -129,6 +130,15 @@ void init(const Variant* v) { Score score = make_score(PieceValue[MG][pc], PieceValue[EG][pc]); + // Scale slider piece values with board size + const PieceInfo* pi = pieceMap.find(pt)->second; + if (pi->sliderQuiet.size() || pi->sliderCapture.size()) + { + int offset = pi->stepsQuiet.size() || pi->stepsCapture.size() ? 16 : 6; + score = make_score(mg_value(score) * (v->maxRank + v->maxFile + offset) / (14 + offset), + eg_value(score) * (v->maxRank + v->maxFile + offset) / (14 + offset)); + } + // For drop variants, halve the piece values if (v->capturesToHand || !v->checking) score = make_score(mg_value(score) * int(MidgameLimit / 2) / (MidgameLimit + mg_value(score)), -- 1.7.0.4