X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=275d7ae16ae33681013ab6fc76f6fab23c39a1c5;hp=c98a83fc81a777806b111d80200946eaeb271da7;hb=5a7cdadfb31db2e8dcaf7be4ecc7953698cd7eef;hpb=213166ba225bcefbbe7dbecdacfd726dfb6c34f9 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index c98a83fc..275d7ae1 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -162,7 +162,7 @@ namespace { constexpr Score KingProtector[] = { S(3, 5), S(4, 3), S(3, 0), S(1, -1) }; // Assorted bonuses and penalties - constexpr Score BishopPawns = S( 8, 12); + constexpr Score BishopPawns = S( 3, 5); constexpr Score CloseEnemies = S( 7, 0); constexpr Score Connectivity = S( 3, 1); constexpr Score CorneredBishop = S( 50, 50); @@ -293,7 +293,8 @@ namespace { template template Score Evaluation::pieces() { - constexpr Color Them = (Us == WHITE ? BLACK : WHITE); + constexpr Color Them = (Us == WHITE ? BLACK : WHITE); + constexpr Direction Down = (Us == WHITE ? SOUTH : NORTH); constexpr Bitboard OutpostRanks = (Us == WHITE ? Rank4BB | Rank5BB | Rank6BB : Rank5BB | Rank4BB | Rank3BB); const Square* pl = pos.squares(Us); @@ -349,8 +350,12 @@ namespace { if (Pt == BISHOP) { - // Penalty according to number of pawns on the same color square as the bishop - score -= BishopPawns * pe->pawns_on_same_color_squares(Us, s); + // Penalty according to number of pawns on the same color square as the + // bishop, bigger when the center files are blocked with pawns. + Bitboard blocked = pos.pieces(Us, PAWN) & shift(pos.pieces()); + + score -= BishopPawns * pe->pawns_on_same_color_squares(Us, s) + * (1 + popcount(blocked & CenterFiles)); // Bonus for bishop on a long diagonal which can "see" both center squares if (more_than_one(Center & (attacks_bb(s, pos.pieces(PAWN)) | s)))