From ddd4224640e04463c62b5896660f6f6abe4cc1a5 Mon Sep 17 00:00:00 2001 From: Vizvezdenec Date: Tue, 4 Feb 2020 20:41:58 +0300 Subject: [PATCH] Reintroduce king infiltration This patch reintroduces the recently simplified king infiltration bonus in initiative calculation, doubling its effect, and compensating more. passed STC http://tests.stockfishchess.org/tests/view/5e3476f630ae32da08941d5c LLR: 2.94 (-2.94,2.94) {-0.50,1.50} Total: 75323 W: 14434 L: 14140 D: 46749 Ptnml(0-2): 1231, 8729, 17528, 8826, 1331 passed LTC http://tests.stockfishchess.org/tests/view/5e377353e70d848499f638c1 LLR: 2.94 (-2.94,2.94) {0.25,1.75} Total: 171466 W: 22223 L: 21561 D: 127682 Ptnml(0-2): 1204, 15951, 50831, 16397, 1312 closes https://github.com/official-stockfish/Stockfish/pull/2545 Brench: 4869669 --- src/evaluate.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 17597648..df7ff5ea 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -708,14 +708,18 @@ namespace { && outflanking < 0 && !pawnsOnBothFlanks; + bool infiltration = rank_of(pos.square(WHITE)) > RANK_4 + || rank_of(pos.square(BLACK)) < RANK_5; + // Compute the initiative bonus for the attacking side int complexity = 9 * pe->passed_count() + 11 * pos.count() + 9 * outflanking + 21 * pawnsOnBothFlanks + + 24 * infiltration + 51 * !pos.non_pawn_material() - 43 * almostUnwinnable - - 95 ; + -110 ; // Give more importance to non-material score Value mg = mg_value(score); -- 2.39.2