X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=f1bb861dcca629e08de695df7bb0c8ff4ccf0b2f;hp=c7b9f894bf0b9a6f3e034eb90a815972b26becd7;hb=79e3710fd224e6e052f6bc5420a8f8f03bf41e18;hpb=cf5d683408a2ef8a1c80be9bf7d6790a38b16277 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index c7b9f894..f1bb861d 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -160,8 +160,8 @@ namespace { constexpr Score KnightOnQueen = S( 20, 12); constexpr Score LongDiagonalBishop = S( 44, 0); 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); @@ -474,7 +474,7 @@ namespace { + 69 * kingAttacksCount[Them] + 185 * popcount(kingRing[Us] & weak) + 150 * popcount(pos.blockers_for_king(Us) | unsafeChecks) - + 4 * tropism + + tropism * tropism / 4 - 873 * !pos.count(Them) - 6 * mg_value(score) / 8 + mg_value(mobility[Them] - mobility[Us]) @@ -508,7 +508,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 @@ -552,12 +552,18 @@ namespace { if (weak & attackedBy[Us][KING]) score += ThreatByKing; - score += Hanging * popcount(weak & ~attackedBy[Them][ALL_PIECES]); - - b = weak & nonPawnEnemies & attackedBy[Them][ALL_PIECES]; - score += Overload * popcount(b); + b = ~attackedBy[Them][ALL_PIECES] + | (nonPawnEnemies & attackedBy2[Us]); + score += Hanging * popcount(weak & 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);