X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=f2126512413f576417faaed3bb08db28419afb3d;hp=c7b9f894bf0b9a6f3e034eb90a815972b26becd7;hb=39257509452a81db28538462e6581b05d1a4b7fb;hpb=cf5d683408a2ef8a1c80be9bf7d6790a38b16277 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index c7b9f894..f2126512 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -162,6 +162,7 @@ namespace { constexpr Score MinorBehindPawn = S( 16, 0); constexpr Score Overload = S( 12, 6); constexpr Score PawnlessFlank = S( 18, 94); + constexpr Score RestrictedPiece = S( 7, 6); constexpr Score RookOnPawn = S( 10, 28); constexpr Score SliderOnQueen = S( 49, 21); constexpr Score ThreatByKing = S( 21, 84); @@ -508,7 +509,7 @@ namespace { constexpr Direction Up = (Us == WHITE ? NORTH : SOUTH); constexpr Bitboard TRank3BB = (Us == WHITE ? Rank3BB : Rank6BB); - Bitboard b, weak, defended, nonPawnEnemies, stronglyProtected, safe; + Bitboard b, weak, defended, nonPawnEnemies, stronglyProtected, safe, restricted; Score score = SCORE_ZERO; // Non-pawn enemies @@ -558,6 +559,13 @@ namespace { score += Overload * popcount(b); } + // Bonus for restricting their piece moves + restricted = attackedBy[Them][ALL_PIECES] + & ~attackedBy[Them][PAWN] + & ~attackedBy2[Them] + & attackedBy[Us][ALL_PIECES]; + score += RestrictedPiece * popcount(restricted); + // Bonus for enemy unopposed weak pawns if (pos.pieces(Us, ROOK, QUEEN)) score += WeakUnopposedPawn * pe->weak_unopposed(Them);