Tweak material evaluation for 3check
authorFabian Fichter <ianfab@users.noreply.github.com>
Wed, 23 Dec 2020 11:46:48 +0000 (12:46 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 23 Dec 2020 11:46:48 +0000 (12:46 +0100)
3check STC
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 12578 W: 6069 L: 5791 D: 718
http://www.variantfishtest.org:6543/tests/view/5fe224a06e23db221d9e9665

3check LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 6552 W: 3187 L: 2996 D: 369
http://www.variantfishtest.org:6543/tests/view/5fe274226e23db221d9e966f

src/material.cpp

index bdf22bc..1318ba3 100644 (file)
@@ -109,13 +109,18 @@ namespace {
         int v = QuadraticOurs[pt1][pt1] * pieceCount[Us][pt1];
 
         for (int pt2 = NO_PIECE_TYPE; pt2 < pt1; ++pt2)
-            v +=  QuadraticOurs[pt1][pt2] * pieceCount[Us][pt2] * (pos.must_capture() && pt1 == KNIGHT && pt2 == PAWN ? 2 : pos.check_counting() && pt1 <= BISHOP ? 0 : 1)
+            v +=  QuadraticOurs[pt1][pt2] * pieceCount[Us][pt2]
                 + QuadraticTheirs[pt1][pt2] * pieceCount[Them][pt2];
 
         bonus += pieceCount[Us][pt1] * v;
     }
 
-    return bonus * (1 + pos.must_capture());
+    if (pos.must_capture())
+        bonus += bonus + 2 * QuadraticOurs[KNIGHT][PAWN] * pieceCount[Us][KNIGHT] * pieceCount[Us][PAWN];
+    else if (pos.check_counting())
+        bonus -= 2 * QuadraticOurs[PAWN][PAWN] * pieceCount[Us][PAWN] * pieceCount[Us][PAWN];
+
+    return bonus;
   }
 
 } // namespace