]> git.sesse.net Git - stockfish/commitdiff
Simplify passed pawns logic
authorMarco Costalba <mcostalba@gmail.com>
Sat, 12 Nov 2011 08:03:18 +0000 (09:03 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 12 Nov 2011 08:09:41 +0000 (09:09 +0100)
Remove the bonus for no *friendly* pieces in the pawn's path and
reduce a bit the bonus based on kings proximity.

This patch is part of to the ongoing effort to remove form evaluation
all the terms that do not add value.

After 16284 games:

Mod vs Orig 2728 - 2651 - 10911 ELO +1 (+- 3.1)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/evaluate.cpp

index 558f05b06ee4292bca48c5af3fc7d834866af315..445ba9cb00b3dcd49565962c5c3cb0c6209f5902 100644 (file)
@@ -813,8 +813,8 @@ namespace {
             Square blockSq = s + pawn_push(Us);
 
             // Adjust bonus based on kings proximity
-            ebonus += Value(square_distance(pos.king_square(Them), blockSq) * 6 * rr);
-            ebonus -= Value(square_distance(pos.king_square(Us), blockSq) * 3 * rr);
+            ebonus += Value(square_distance(pos.king_square(Them), blockSq) * 5 * rr);
+            ebonus -= Value(square_distance(pos.king_square(Us), blockSq) * 2 * rr);
 
             // If blockSq is not the queening square then consider also a second push
             if (rank_of(blockSq) != (Us == WHITE ? RANK_8 : RANK_1))
@@ -845,11 +845,6 @@ namespace {
                     // If yes, big bonus (but smaller than when there are no enemy attacks),
                     // if no, somewhat smaller bonus.
                     ebonus += Value(rr * ((unsafeSquares & defendedSquares) == unsafeSquares ? 13 : 8));
-
-                // At last, add a small bonus when there are no *friendly* pieces
-                // in the pawn's path.
-                if (!(squaresToQueen & pos.pieces(Us)))
-                    ebonus += Value(rr);
             }
         } // rr != 0
 
@@ -858,6 +853,7 @@ namespace {
         supportingPawns = pos.pieces(PAWN, Us) & neighboring_files_bb(s);
         if (supportingPawns & rank_bb(s))
             ebonus += Value(r * 20);
+
         else if (supportingPawns & rank_bb(s - pawn_push(Us)))
             ebonus += Value(r * 12);