From: Vizvezdenec Date: Thu, 27 Jun 2019 07:21:50 +0000 (+0200) Subject: Introduce attacks on space area X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=dab66631e8e31b86f91475f4245c4be6b36a37de Introduce attacks on space area This patch introduces a small malus for every square in our space mask that is attacked by enemy. The value of the malus is completely arbitrary and is something we can tweak, also maybe we can gain some elo with tweaking space threshold after this addition. Passed STC http://tests.stockfishchess.org/tests/view/5d10ce590ebc5925cf0af30b LLR: 2.96 (-2.94,2.94) [0.50,4.50] Total: 7082 W: 1648 L: 1449 D: 3985 Passed LTC http://tests.stockfishchess.org/tests/view/5d10d2d80ebc5925cf0af3fd LLR: 2.96 (-2.94,2.94) [0.00,3.50] Total: 79494 W: 13727 L: 13324 D: 52443 Closes https://github.com/official-stockfish/Stockfish/pull/2207 bench 3516460 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index da76de10..f2e822d0 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -133,6 +133,7 @@ namespace { }; // Assorted bonuses and penalties + constexpr Score AttacksOnSpaceArea = S( 4, 0); constexpr Score BishopPawns = S( 3, 7); constexpr Score CorneredBishop = S( 50, 50); constexpr Score FlankAttacks = S( 8, 0); @@ -711,6 +712,8 @@ namespace { int weight = pos.count(Us) - 1; Score score = make_score(bonus * weight * weight / 16, 0); + score -= AttacksOnSpaceArea * popcount(attackedBy[Them][ALL_PIECES] & behind & safe); + if (T) Trace::add(SPACE, Us, score);