Decrease passed pawn bonus for antichess variants
authorFabian Fichter <ianfab@users.noreply.github.com>
Tue, 18 Dec 2018 23:41:24 +0000 (00:41 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Tue, 18 Dec 2018 23:41:24 +0000 (00:41 +0100)
giveaway STC
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 343 W: 166 L: 82 D: 95
http://35.161.250.236:6543/tests/view/5c1792fc6e23db24728955ae

giveaway LTC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 555 W: 219 L: 137 D: 199
http://35.161.250.236:6543/tests/view/5c1950cb6e23db24728955b4

src/evaluate.cpp

index 3d3b068..5826d12 100644 (file)
@@ -718,13 +718,17 @@ namespace {
         {
             Square blockSq = s + Up;
 
-            // Adjust bonus based on the king's proximity
-            bonus += make_score(0, (  king_proximity(Them, blockSq) * 5
-                                    - king_proximity(Us,   blockSq) * 2) * w);
+            // Skip bonus for antichess variants
+            if (pos.extinction_value() != VALUE_MATE)
+            {
+                // Adjust bonus based on the king's proximity
+                bonus += make_score(0, (  king_proximity(Them, blockSq) * 5
+                                        - king_proximity(Us,   blockSq) * 2) * w);
 
-            // If blockSq is not the queening square then consider also a second push
-            if (r != RANK_7)
-                bonus -= make_score(0, king_proximity(Us, blockSq + Up) * w);
+                // If blockSq is not the queening square then consider also a second push
+                if (r != RANK_7)
+                    bonus -= make_score(0, king_proximity(Us, blockSq + Up) * w);
+            }
 
             // If the pawn is free to advance, then increase the bonus
             if (pos.empty(blockSq))