]> git.sesse.net Git - stockfish/commitdiff
Tweak RestrictedPiece bonus
authorLolligerhans <lolligerhans@gmx.de>
Fri, 24 Jan 2020 22:04:35 +0000 (23:04 +0100)
committerLolligerhans <lolligerhans@gmx.de>
Sat, 25 Jan 2020 08:44:09 +0000 (09:44 +0100)
Double the "RestrictedPiece" bonus for restricted moves targeting
occupied squares.

STC LLR: 3.58 (-2.94,2.94) {-1.00,3.00}
    Total: 25504 W: 4887 L: 4697 D: 15920
    Ptnml(0-2): 387, 2935, 5947, 3051, 422
    https://tests.stockfishchess.org/tests/view/5e2aa15dab2d69d58394f94d

LTC LLR: 2.94 (-2.94,2.94) {0.00,2.00}
    Total: 28572 W: 3826 L: 3621 D: 21125
    Ptnml(0-2): 224, 2609, 8403, 2791, 239
    https://tests.stockfishchess.org/tests/view/5e2ae7f4ab2d69d58394f9a6

Bench: 4719086

src/evaluate.cpp

index fad0771db4aa3e04f1be929f70443f34c7d8b536..a1a3b4ed267c6293f135e9fdef1b2c5beea3a82d 100644 (file)
@@ -520,11 +520,11 @@ namespace {
     }
 
     // Bonus for restricting their piece moves
+    // Greater bonus when landing square is occupied
     b =   attackedBy[Them][ALL_PIECES]
        & ~stronglyProtected
        &  attackedBy[Us][ALL_PIECES];
-
-    score += RestrictedPiece * popcount(b);
+    score += RestrictedPiece * (popcount(b) + popcount(b & pos.pieces()));
 
     // Protected or unattacked squares
     safe = ~attackedBy[Them][ALL_PIECES] | attackedBy[Us][ALL_PIECES];