Skip to content

Commit

Permalink
Give bonus for rooks that are alligned with enemy kingring
Browse files Browse the repository at this point in the history
The idea of this patch is that if rooks are not directly attacking the opponent king,
they can support king attacks staying behind pawns or minor pieces and be really
deadly if position slightly opens up at enemy king ring ranks. Loosely based on
some stockfish games where it underestimated attacks on it king when enemy has one
or two rooks supporting pawn pushes towards it king.

passed STC
https://tests.stockfishchess.org/tests/view/5ecb093680f2c838b96550f9
LLR: 2.93 (-2.94,2.94) {-0.50,1.50}
Total: 53672 W: 10535 L: 10265 D: 32872
Ptnml(0-2): 952, 6210, 12258, 6448, 968

passed LTC
https://tests.stockfishchess.org/tests/view/5ecb639f80f2c838b9655117
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 62424 W: 8094 L: 7748 D: 46582
Ptnml(0-2): 426, 5734, 18565, 6042, 445

closes #2700

Bench: 4663220
  • Loading branch information
Vizvezdenec authored and vondele committed May 25, 2020
1 parent 7f2c8a2 commit d40d04c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/evaluate.cpp
Expand Up @@ -143,6 +143,7 @@ namespace {
constexpr Score PassedFile = S( 11, 8);
constexpr Score PawnlessFlank = S( 17, 95);
constexpr Score RestrictedPiece = S( 7, 7);
constexpr Score RookOnKingRing = S( 16, 0);
constexpr Score RookOnQueenFile = S( 5, 9);
constexpr Score SliderOnQueen = S( 59, 18);
constexpr Score ThreatByKing = S( 24, 89);
Expand Down Expand Up @@ -287,6 +288,8 @@ namespace {
kingAttackersWeight[Us] += KingAttackWeights[Pt];
kingAttacksCount[Us] += popcount(b & attackedBy[Them][KING]);
}
else if (Pt == ROOK && (file_bb(s) & kingRing[Them]))
score += RookOnKingRing;

int mob = popcount(b & mobilityArea[Us]);

Expand Down

0 comments on commit d40d04c

Please sign in to comment.