Skip to content

Commit

Permalink
Introduce attacks on space area
Browse files Browse the repository at this point in the history
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 #2207

bench 3516460
  • Loading branch information
Vizvezdenec authored and snicolet committed Jun 27, 2019
1 parent 8b4521d commit dab6663
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/evaluate.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -711,6 +712,8 @@ namespace {
int weight = pos.count<ALL_PIECES>(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);

Expand Down

0 comments on commit dab6663

Please sign in to comment.