Skip to content

Commit e9c52bd

Browse files
Vizvezdenecmstembera
authored andcommitted
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 official-stockfish#2207 bench 3516460
1 parent be0d05d commit e9c52bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/evaluate.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ namespace {
133133
};
134134

135135
// Assorted bonuses and penalties
136+
constexpr Score AttacksOnSpaceArea = S( 4, 0);
136137
constexpr Score BishopPawns = S( 3, 7);
137138
constexpr Score CorneredBishop = S( 50, 50);
138139
constexpr Score FlankAttacks = S( 8, 0);
@@ -711,6 +712,8 @@ namespace {
711712
int weight = pos.count<ALL_PIECES>(Us) - 1;
712713
Score score = make_score(bonus * weight * weight / 16, 0);
713714

715+
score -= AttacksOnSpaceArea * popcount(attackedBy[Them][ALL_PIECES] & behind & safe);
716+
714717
if (T)
715718
Trace::add(SPACE, Us, score);
716719

0 commit comments

Comments
 (0)