Use negative piece values for antichess-like variants
authorianfab <ianfab@users.noreply.github.com>
Fri, 10 Aug 2018 22:32:14 +0000 (00:32 +0200)
committerianfab <ianfab@users.noreply.github.com>
Sun, 12 Aug 2018 08:02:04 +0000 (10:02 +0200)
giveaway STC
LLR: 7.17 (-2.94,2.94) [0.00,10.00]
Total: 234 W: 231 L: 2 D: 1
http://35.161.250.236:6543/tests/view/5b6e12d56e23db0fbab0dc73

losers STC
LLR: 0.00 (-2.94,2.94) [0.00,10.00]
Total: 1342 W: 1071 L: 271 D: 0
http://35.161.250.236:6543/tests/view/5b6e12f06e23db0fbab0dc76

src/evaluate.cpp

index a9c8269..e009ba5 100644 (file)
@@ -921,6 +921,13 @@ namespace {
     // the position object (material + piece square tables) and the material
     // imbalance. Score is computed internally from the white point of view.
     Score score = pos.captures_to_hand() ? pos.psq_score() / 2 : pos.psq_score();
+    // For antichess-like variants, use negative piece values
+    if (  (   pos.extinction_value() == VALUE_MATE
+           && pos.extinction_piece_types().find(ALL_PIECES) != pos.extinction_piece_types().end())
+        || pos.bare_king_value() == VALUE_MATE)
+        score = -score / 4;
+    if (T)
+        Trace::add(MATERIAL, score);
     score += me->imbalance() + pos.this_thread()->contempt;
 
     // Probe the pawn hash table
@@ -962,7 +969,6 @@ namespace {
     // In case of tracing add all remaining individual evaluation terms
     if (T)
     {
-        Trace::add(MATERIAL, pos.psq_score());
         Trace::add(IMBALANCE, me->imbalance());
         Trace::add(PAWN, pe->pawn_score(WHITE), pe->pawn_score(BLACK));
         Trace::add(MOBILITY, mobility[WHITE], mobility[BLACK]);