From a40ded2884b512a84afe9af9ff5782f6634d316f Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 12 Nov 2011 09:03:18 +0100 Subject: [PATCH] Simplify passed pawns logic 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 --- src/evaluate.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 558f05b0..445ba9cb 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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); -- 2.39.2