X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=40d59648f2ed10edf6660befbf0c2eb035feec35;hp=822be015bdf6395c6a66f34ebf926f7849f4415e;hb=44a571c1c7494503ee431ef6f974d030bf96af0d;hpb=18b08096399c0e316baa1999f8cc6ce56bc7f616 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 822be015..40d59648 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -559,7 +559,7 @@ namespace { & pos.pieces(Them) & ~ei.attackedBy[Us][PAWN]; - if(b) + if (b) score += popcount(b) * PawnAttackThreat; if (Trace) @@ -912,14 +912,14 @@ namespace Eval { void init() { - const double MaxSlope = 8.7; - const double Peak = 1280; - double t = 0.0; + const int MaxSlope = 87; + const int Peak = 12800; + int t = 0; - for (int i = 1; i < 400; ++i) + for (int i = 0; i < 400; ++i) { - t = std::min(Peak, std::min(0.027 * i * i, t + MaxSlope)); - KingDanger[i] = apply_weight(make_score(int(t), 0), Weights[KingSafety]); + t = std::min(Peak, std::min(i * i * 27 / 100, t + MaxSlope)); + KingDanger[i] = apply_weight(make_score(t / 10, 0), Weights[KingSafety]); } }