Skip to content

Commit

Permalink
Pawn Center Bind Bonus
Browse files Browse the repository at this point in the history
Bonus for two pawns controlling the same central square

STC:

LLR: 3.14 (-2.94,2.94) [-1.50,4.50]
Total: 15974 W: 3291 L: 3133 D: 9550

LTC:

LLR: 3.24 (-2.94,2.94) [0.00,6.00]
Total: 10449 W: 1837 L: 1674 D: 6938

Idea from Lyudmil Tsvetkov.

Bench: 7699138

Resolves #248
  • Loading branch information
Joona Kiiski authored and zamar committed Feb 8, 2015
1 parent 170bdf4 commit e118570
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/pawns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ namespace {
// Unsupported pawn penalty
const Score UnsupportedPawnPenalty = S(20, 10);

// Center bind bonus: Two pawns controlling the same central square
const Bitboard CenterBindMask[COLOR_NB] = {
(FileDBB | FileEBB) & (Rank5BB | Rank6BB | Rank7BB),
(FileDBB | FileEBB) & (Rank4BB | Rank3BB | Rank2BB)
};

const Score CenterBind = S(16, 0);

// Weakness of our pawn shelter in front of the king by [distance from edge][rank]
const Value ShelterWeakness[][RANK_NB] = {
{ V( 99), V(20), V(26), V(54), V(85), V( 92), V(108) },
Expand Down Expand Up @@ -195,6 +203,10 @@ namespace {
b = e->semiopenFiles[Us] ^ 0xFF;
e->pawnSpan[Us] = b ? int(msb(b) - lsb(b)) : 0;

// Center binds: Two pawns controlling the same central square
b = shift_bb<Right>(ourPawns) & shift_bb<Left>(ourPawns) & CenterBindMask[Us];
score += popcount<Max15>(b) * CenterBind;

return score;
}

Expand Down

0 comments on commit e118570

Please sign in to comment.