Scale piece values with board size
authorFabian Fichter <ianfab@users.noreply.github.com>
Mon, 14 Oct 2019 11:51:55 +0000 (13:51 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Fri, 18 Oct 2019 21:02:21 +0000 (23:02 +0200)
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

index 9f9f1af..4b78b5f 100644 (file)
@@ -21,6 +21,7 @@
 #include <algorithm>
 
 #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)),