]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Tweak capture scoring formula
[stockfish] / src / evaluate.cpp
index da76de100f00fcd8fb6326506f95356cb204cf86..f2e822d0b6b9f1dd65e70ff911880516bf05753c 100644 (file)
@@ -133,6 +133,7 @@ namespace {
   };
 
   // Assorted bonuses and penalties
+  constexpr Score AttacksOnSpaceArea = S(  4,  0);
   constexpr Score BishopPawns        = S(  3,  7);
   constexpr Score CorneredBishop     = S( 50, 50);
   constexpr Score FlankAttacks       = S(  8,  0);
@@ -711,6 +712,8 @@ namespace {
     int weight = pos.count<ALL_PIECES>(Us) - 1;
     Score score = make_score(bonus * weight * weight / 16, 0);
 
+    score -= AttacksOnSpaceArea * popcount(attackedBy[Them][ALL_PIECES] & behind & safe);
+
     if (T)
         Trace::add(SPACE, Us, score);