1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

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
This commit is contained in:
MJZ1977 2018-05-01 07:12:17 +02:00 committed by Stéphane Nicolet
parent 213166ba22
commit 5a7cdadfb3
2 changed files with 10 additions and 4 deletions

View file

@ -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)

View file

@ -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<Tracing T> template<Color Us, PieceType Pt>
Score Evaluation<T>::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<Pt>(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<Down>(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<BISHOP>(s, pos.pieces(PAWN)) | s)))