X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=5ceb9ae145cab0234ac8127c7ec3ea7868670bc5;hp=2fb0e55a9d47b08ed61fa7319aca386200140390;hb=41bc0d56608c01adf104d2bd0213342c82fa4ab5;hpb=2ac35027d5900a641559fae7b22a994f8b4c2d72 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 2fb0e55a..5ceb9ae1 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -154,20 +154,17 @@ namespace { // PassedDanger[Rank] contains a term to weight the passed score constexpr int PassedDanger[RANK_NB] = { 0, 0, 0, 3, 7, 11, 20 }; - // KingProtector[knight/bishop] contains a penalty according to distance from king - constexpr Score KingProtector[] = { S(5, 6), S(6, 5) }; - // Assorted bonuses and penalties constexpr Score BishopPawns = S( 3, 7); constexpr Score CloseEnemies = S( 6, 0); - constexpr Score Connectivity = S( 3, 1); constexpr Score CorneredBishop = S( 50, 50); constexpr Score Hanging = S( 52, 30); constexpr Score HinderPassedPawn = S( 4, 0); + constexpr Score KingProtector = S( 6, 6); 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 Overload = S( 16, 7); constexpr Score PawnlessFlank = S( 20, 80); constexpr Score RookOnPawn = S( 8, 24); constexpr Score SliderOnQueen = S( 42, 21); @@ -342,7 +339,7 @@ namespace { score += MinorBehindPawn; // Penalty if the piece is far from the king - score -= KingProtector[Pt == BISHOP] * distance(s, pos.square(Us)); + score -= KingProtector * distance(s, pos.square(Us)); if (Pt == BISHOP) { @@ -609,10 +606,6 @@ namespace { score += SliderOnQueen * popcount(b & safeThreats & attackedBy2[Us]); } - // Connectivity: ensure that knights, bishops, rooks, and queens are protected - b = (pos.pieces(Us) ^ pos.pieces(Us, PAWN, KING)) & attackedBy[Us][ALL_PIECES]; - score += Connectivity * popcount(b); - if (T) Trace::add(THREAT, Us, score);