From: Vizvezdenec Date: Mon, 25 Nov 2019 23:56:53 +0000 (+0300) Subject: Simplify king danger X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=df340a839c4d223c3053dc95dca02547ed83acee;ds=sidebyside Simplify king danger This patch is a cleanup/simplification of king flank defenders patch, removing king flanks attacks linear dependance in kingdanger. Result of experiments with quadratic kingflank defenders scaling. Rebased on the latest master. passed STC http://tests.stockfishchess.org/tests/view/5ddc2b99e0b4af579302bacf LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 19660 W: 4309 L: 4184 D: 11167 passed LTC http://tests.stockfishchess.org/tests/view/5ddc3168e0b4af579302bade LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 24362 W: 3974 L: 3859 D: 16529 Closes https://github.com/official-stockfish/Stockfish/pull/2428 bench 5742013 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 4c876820..116d5d66 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -449,13 +449,13 @@ namespace { + 148 * popcount(unsafeChecks) + 98 * popcount(pos.blockers_for_king(Us)) + 69 * kingAttacksCount[Them] - + 4 * (kingFlankAttack - kingFlankDefense) + 3 * kingFlankAttack * kingFlankAttack / 8 + mg_value(mobility[Them] - mobility[Us]) - 873 * !pos.count(Them) - 100 * bool(attackedBy[Us][KNIGHT] & attackedBy[Us][KING]) - 6 * mg_value(score) / 8 - - 7; + - 4 * kingFlankDefense + + 37; // Transform the kingDanger units into a Score, and subtract it from the evaluation if (kingDanger > 100)