From: Marco Costalba Date: Wed, 30 Sep 2009 15:04:51 +0000 (+0100) Subject: Don't increase mobility if attacked piece is defended by a pawn X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=3713bb26efa7466e8eed1bd6361b9cca8b16b449 Don't increase mobility if attacked piece is defended by a pawn If an enemy piece is defended by a pawn don't give the extra mobility bonus in case we attack it. Joona says that "Paralyzing pawn" is usually worth of nothing. On Joona QUAD after 964 games: Orig - Patch_2: 191 - 218 - 555 (+ 10 elo) On my PC after 999 games at 1+0: Mod vs Orig +227 =550 -222 50.25% 502.0/999 +2 ELO In both cases we tested against the original version (without increased mobility), not against the previous patch that instead seems to fail on Joona QUAD: Orig vs. Prev.Patch: 237 - 217 - 627 (-6 elo) Signed-off-by: Marco Costalba --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 0bf64631..168b9961 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -550,16 +550,15 @@ namespace { ei.kingAdjacentZoneAttacksCount[Us] += count_1s_max_15(bb); } - // The squares occupied by enemy pieces will be counted two times instead - // of one. The shift (almost) guarantees that intersection with b is zero - // so when we 'or' the two bitboards togheter and count we get the correct - // sum of '1' in b and attacked bitboards. - Bitboard attacked = Us == WHITE ? ((b & pos.pieces_of_color(Them)) >> 1) - : ((b & pos.pieces_of_color(Them)) << 1); - // Remove squares protected by enemy pawns or occupied by our pieces b &= ~(ei.attackedBy[Them][PAWN] | pos.pieces_of_color(Us)); + // The squares occupied by enemy pieces (not defended by pawns) will be + // counted two times instead of one. The shift (almost) guarantees that + // intersection with b is zero so when we 'or' the two bitboards togheter + // and count we get the correct sum of '1' in b and attacked bitboards. + Bitboard attacked = Us == WHITE ? ((b & pos.pieces_of_color(Them)) >> 1) + : ((b & pos.pieces_of_color(Them)) << 1); // Mobility int mob = (Piece != QUEEN ? count_1s_max_15(b | attacked) : count_1s(b | attacked));