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>
Square blockSq = s + pawn_push(Us);
// Adjust bonus based on kings proximity
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))
// If blockSq is not the queening square then consider also a second push
if (rank_of(blockSq) != (Us == WHITE ? RANK_8 : RANK_1))
// 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));
// 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);
supportingPawns = pos.pieces(PAWN, Us) & neighboring_files_bb(s);
if (supportingPawns & rank_bb(s))
ebonus += Value(r * 20);
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);
else if (supportingPawns & rank_bb(s - pawn_push(Us)))
ebonus += Value(r * 12);