From bd8f463b7e93e1a0a8c8be07b0c022326f507722 Mon Sep 17 00:00:00 2001 From: Tom Vijlbrief Date: Tue, 13 Aug 2013 14:19:42 +0200 Subject: [PATCH] Bonus for a pawn in front of knight/bishop Idea originated from a post of Don Dailey on talkchess and reported by Eelco. This is the last succesful attempt of a long series of trials (as usually happens, the 'idea' alone is not enough). Passed both short 15secs TC LLR: 2.97 (-2.94,2.94) Total: 7629 W: 1645 L: 1515 D: 4469 And long 60secs TC LLR: 2.96 (-2.94,2.94) Total: 10218 W: 1932 L: 1775 D: 6511 bench: 4944581 --- src/evaluate.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 70c91f8a..b6085b73 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -530,10 +530,17 @@ Value do_evaluate(const Position& pos, Value& margin) { if (Piece == BISHOP) score -= BishopPawns * ei.pi->pawns_on_same_color_squares(Us, s); - // Bishop and knight outposts squares - if ( (Piece == BISHOP || Piece == KNIGHT) - && !(pos.pieces(Them, PAWN) & pawn_attack_span(Us, s))) - score += evaluate_outposts(pos, ei, s); + if (Piece == BISHOP || Piece == KNIGHT) + { + // Bishop and knight outposts squares + if (!(pos.pieces(Them, PAWN) & pawn_attack_span(Us, s))) + score += evaluate_outposts(pos, ei, s); + + // Pawn in front of knight/bishop + if ( relative_rank(Us, s) < RANK_5 + && (pos.pieces(PAWN) & (s + pawn_push(Us)))) + score += make_score(16, 0); + } if ( (Piece == ROOK || Piece == QUEEN) && relative_rank(Us, s) >= RANK_5) -- 2.39.2