]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Play turbulent when defending, simpler when attacking
[stockfish] / src / evaluate.cpp
index 728990680f6a1ac9e6fdd8df0e88a29ee327c7b3..54216b97206b24cab5b90ba18601a3e9d5801df9 100644 (file)
@@ -155,8 +155,9 @@ Value Eval::evaluate(const Position& pos) {
   int material =  pos.non_pawn_material(stm) - pos.non_pawn_material(~stm)
                 + 126 * (pos.count<PAWN>(stm) - pos.count<PAWN>(~stm));
 
-  // Blend optimism with nnue complexity and (semi)classical complexity
+  // Blend optimism and eval with nnue complexity and material imbalance
   optimism += optimism * (nnueComplexity + abs(material - nnue)) / 512;
+  nnue     -= nnue     * (nnueComplexity + abs(material - nnue)) / 32768;
 
   v = (  nnue     * (915 + npm + 9 * pos.count<PAWN>())
        + optimism * (154 + npm +     pos.count<PAWN>())) / 1024;