]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Simplify attackUnits formula
[stockfish] / src / evaluate.cpp
index 18f5adc4084c9f9132d59230f76a24eccf297416..7ff7dfc18f343f5f47a67f068a106fba545eba89 100644 (file)
@@ -414,10 +414,10 @@ namespace {
         // attacked and undefended squares around our king and the quality of
         // the pawn shelter (current 'score' value).
         attackUnits =  std::min(74, ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them])
         // attacked and undefended squares around our king and the quality of
         // the pawn shelter (current 'score' value).
         attackUnits =  std::min(74, ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them])
-                     + 8 * ei.kingAdjacentZoneAttacksCount[Them]
+                     +  8 * ei.kingAdjacentZoneAttacksCount[Them]
                      + 25 * popcount<Max15>(undefended)
                      + 25 * popcount<Max15>(undefended)
-                     +  11 * (ei.pinnedPieces[Us] != 0)
-                     - mg_value(score) * 31 / 256
+                     + 11 * (ei.pinnedPieces[Us] != 0)
+                     - mg_value(score) / 8
                      - !pos.count<QUEEN>(Them) * 60;
 
         // Analyse the enemy's safe queen contact checks. Firstly, find the
                      - !pos.count<QUEEN>(Them) * 60;
 
         // Analyse the enemy's safe queen contact checks. Firstly, find the