X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=6783ffd8595fcaa32f1e584ffdd2fca8362aeb41;hp=56c975945d13d4713a7648db702446dfd6a8568a;hb=c5f6bd517c68e16c3ead7892e1d83a6b1bb89b69;hpb=1093047e7d72ed0c82e143c2cc0af9ef7b0380ed diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 56c97594..6783ffd8 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -165,6 +165,7 @@ namespace { // Assorted bonuses and penalties const Score BishopPawns = S( 8, 12); const Score CloseEnemies = S( 7, 0); + const Score Connectivity = S( 3, 1); const Score Hanging = S( 52, 30); const Score HinderPassedPawn = S( 8, 1); const Score KnightOnQueen = S( 21, 11); @@ -599,6 +600,10 @@ 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); @@ -760,6 +765,7 @@ namespace { + 8 * pe->pawn_asymmetry() + 12 * pos.count() + 16 * pawnsOnBothFlanks + + 48 * !pos.non_pawn_material() -136 ; // Now apply the bonus: note that we find the attacking side by extracting