From: MJZ1977 <37274752+MJZ1977@users.noreply.github.com> Date: Tue, 1 May 2018 05:12:17 +0000 (+0200) Subject: Penalty for bad bishop with blocked central files X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=5a7cdadfb31db2e8dcaf7be4ecc7953698cd7eef Penalty for bad bishop with blocked central files We increase the penalty for bad bishops by a factor proportional to the number of our blocked pawns in the center files C, D, E or F. STC: LLR: 2.97 (-2.94,2.94) [0.00,5.00] Total: 8868 W: 1870 L: 1700 D: 5298 http://tests.stockfishchess.org/html/live_elo.html?5ae7674f0ebc590e39268b34 LTC: LLR: 2.95 (-2.94,2.94) [0.00,5.00] Total: 5813 W: 950 L: 808 D: 4055 http://tests.stockfishchess.org/html/live_elo.html?5ae77bae0ebc5926dba90dd9 Closes https://github.com/official-stockfish/Stockfish/pull/1573 Bench: 5364190 --- diff --git a/AUTHORS b/AUTHORS index 66ad6b5f..305d8b31 100644 --- a/AUTHORS +++ b/AUTHORS @@ -85,6 +85,7 @@ Michel Van den Bergh (vdbergh) Mikael Bäckman (mbootsector) Mike Whiteley (protonspring) Miroslav Fontán (Hexik) +Moez Jellouli (MJZ1977) Mohammed Li (tthsqe12) Nathan Rugg (nmrugg) Nicklas Persson (NicklasPersson) 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)))