From 9a11a291942a8a7b1ebb36282c666ca8d1be1892 Mon Sep 17 00:00:00 2001 From: Michael Chaly Date: Sat, 27 Apr 2019 12:31:55 +0300 Subject: [PATCH] Include bishop protection in king Danger evaluation. #2118 Same idea as fisherman's knight protection. passed STC LLR: 2.96 (-2.94,2.94) [0.50,4.50] Total: 17133 W: 3952 L: 3701 D: 9480 http://tests.stockfishchess.org/tests/view/5cc3550b0ebc5925cf02dada passed LTC LLR: 2.95 (-2.94,2.94) [0.00,3.50] Total: 37316 W: 6470 L: 6188 D: 24658 http://tests.stockfishchess.org/tests/view/5cc3721d0ebc5925cf02dc90 Looking at this 2 ideas being recent clean elo gainers I have a feeling that we can add also rook and queen protection bonuses or overall move this stuff in pieces loop in the same way as we do pieces attacking bonuses on their kingring... :) Thx fisherman for original idea. Bench 3429173 --- src/evaluate.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 566eba6d..7e6260c8 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -467,12 +467,13 @@ namespace { + 69 * kingAttacksCount[Them] + 185 * popcount(kingRing[Us] & weak) - 100 * bool(attackedBy[Us][KNIGHT] & attackedBy[Us][KING]) + - 35 * bool(attackedBy[Us][BISHOP] & attackedBy[Us][KING]) + 150 * popcount(pos.blockers_for_king(Us) | unsafeChecks) - 873 * !pos.count(Them) - 6 * mg_value(score) / 8 + mg_value(mobility[Them] - mobility[Us]) + 5 * kingFlankAttacks * kingFlankAttacks / 16 - - 15; + - 7; // Transform the kingDanger units into a Score, and subtract it from the evaluation if (kingDanger > 100) -- 2.39.2