Skip to content

Commit

Permalink
Include bishop protection in king Danger evaluation. #2118
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Vizvezdenec authored and mcostalba committed Apr 27, 2019
1 parent e89bc30 commit 9a11a29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/evaluate.cpp
Expand Up @@ -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<QUEEN>(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)
Expand Down

0 comments on commit 9a11a29

Please sign in to comment.