X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fevaluate.cpp;h=bf1eee9b9c6cd5385631dd419bdd28c1aba4ae5b;hb=c390b734c451b3d976b331244e281d261b26ac3a;hp=a1a3b4ed267c6293f135e9fdef1b2c5beea3a82d;hpb=0ae00454ba6928d181b46103e5c83e6d58fcebe5;p=stockfish diff --git a/src/evaluate.cpp b/src/evaluate.cpp index a1a3b4ed..bf1eee9b 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -145,7 +145,7 @@ namespace { constexpr Score ThreatByKing = S( 24, 89); constexpr Score ThreatByPawnPush = S( 48, 39); constexpr Score ThreatBySafePawn = S(173, 94); - constexpr Score TrappedRook = S( 52, 30); + constexpr Score TrappedRook = S( 52, 10); constexpr Score WeakQueen = S( 49, 15); #undef S @@ -524,7 +524,7 @@ namespace { b = attackedBy[Them][ALL_PIECES] & ~stronglyProtected & attackedBy[Us][ALL_PIECES]; - score += RestrictedPiece * (popcount(b) + popcount(b & pos.pieces())); + score += RestrictedPiece * popcount(b); // Protected or unattacked squares safe = ~attackedBy[Them][ALL_PIECES] | attackedBy[Us][ALL_PIECES]; @@ -698,9 +698,6 @@ namespace { template Score Evaluation::initiative(Score score) const { - Value mg = mg_value(score); - Value eg = eg_value(score); - int outflanking = distance(pos.square(WHITE), pos.square(BLACK)) - distance(pos.square(WHITE), pos.square(BLACK)); @@ -724,6 +721,10 @@ namespace { - 43 * almostUnwinnable - 100 ; + // Give more importance to non-material score + Value mg = mg_value(score); + Value eg = eg_value(score); + // Now apply the bonus: note that we find the attacking side by extracting the // sign of the midgame or endgame values, and that we carefully cap the bonus // so that the midgame and endgame scores do not change sign after the bonus.