diff --git a/AUTHORS b/AUTHORS index 8f3e4663..afd2f297 100644 --- a/AUTHORS +++ b/AUTHORS @@ -77,6 +77,7 @@ Lucas Braesch (lucasart) Lyudmil Antonov (lantonov) Matthew Lai (matthewlai) Matthew Sullivan +Mark Tenzer (31m059) Michael Byrne (MichaelB7) Michael Stembera (mstembera) Michel Van den Bergh (vdbergh) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 41c66812..6377faf2 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -171,6 +171,7 @@ namespace { constexpr Score KnightOnQueen = S( 21, 11); constexpr Score LongDiagonalBishop = S( 22, 0); constexpr Score MinorBehindPawn = S( 16, 0); + constexpr Score Overload = S( 10, 5); constexpr Score PawnlessFlank = S( 20, 80); constexpr Score RookOnPawn = S( 8, 24); constexpr Score SliderOnQueen = S( 42, 21); @@ -520,7 +521,7 @@ namespace { Bitboard b, weak, defended, nonPawnEnemies, stronglyProtected, safeThreats; Score score = SCORE_ZERO; - // Non-pawn enemies attacked by a pawn + // Non-pawn enemies nonPawnEnemies = pos.pieces(Them) ^ pos.pieces(Them, PAWN); // Our safe or protected pawns @@ -608,6 +609,12 @@ namespace { b = (pos.pieces(Us) ^ pos.pieces(Us, PAWN, KING)) & attackedBy[Us][ALL_PIECES]; score += Connectivity * popcount(b); + // Bonus for overload (non-pawn enemies attacked and defended exactly once) + b = nonPawnEnemies + & attackedBy[Us][ALL_PIECES] & ~attackedBy2[Us] + & attackedBy[Them][ALL_PIECES] & ~attackedBy2[Them]; + score += Overload * popcount(b); + if (T) Trace::add(THREAT, Us, score);