X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=e8d3834343bc33215357310f3eedf304dce62260;hp=826e860a5c22d3441424f63fd674c2aaa5b624d1;hb=c1be0c68c78793dc6f18bf6c1b1ee078dcc39fcc;hpb=c13052f344e1de69bd824256427fd7e723a79e14 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 826e860a..e8d38343 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -679,11 +679,12 @@ namespace { // status of the players. Score evaluate_initiative(const Position& pos, int asymmetry, Value eg) { - int kingDistance = distance(pos.square(WHITE), pos.square(BLACK)); + int kingDistance = distance(pos.square(WHITE), pos.square(BLACK)) + - distance(pos.square(WHITE), pos.square(BLACK)); int pawns = pos.count(WHITE) + pos.count(BLACK); // Compute the initiative bonus for the attacking side - int initiative = 8 * (pawns + asymmetry + kingDistance - 15); + int initiative = 8 * (asymmetry + kingDistance) + 12 * pawns - 120; // Now apply the bonus: note that we find the attacking side by extracting // the sign of the endgame value, and that we carefully cap the bonus so