Skip to content

Commit

Permalink
Bonus for rook on same file as their queen
Browse files Browse the repository at this point in the history
This patch creates a simple bonus for a rook that is on the same file as the
opponent's queen.

STC 10+0.1 th 1 :
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 45609 W: 10120 L: 9733 D: 25756
http://tests.stockfishchess.org/tests/view/5d79895a0ebc5902d385484a

LTC 60+0.6 th 1 :
LLR: 2.96 (-2.94,2.94) [0.00,3.50]
Total: 51651 W: 8606 L: 8288 D: 34757
http://tests.stockfishchess.org/tests/view/5d79a0850ebc5902d3854d27

Many thanks to @noobpwnftw for providing the extra cpu resources for fishtest,
which led to me doing these tests.

Closes #2297

Bench: 4024461
  • Loading branch information
xoto10 authored and snicolet committed Sep 12, 2019
1 parent 270b241 commit 36e4a86
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/evaluate.cpp
Expand Up @@ -140,6 +140,7 @@ namespace {
constexpr Score PawnlessFlank = S( 17, 95);
constexpr Score RestrictedPiece = S( 7, 7);
constexpr Score RookOnPawn = S( 10, 32);
constexpr Score RookOnQueenFile = S( 11, 4);
constexpr Score SliderOnQueen = S( 59, 18);
constexpr Score ThreatByKing = S( 24, 89);
constexpr Score ThreatByPawnPush = S( 48, 39);
Expand Down Expand Up @@ -346,6 +347,10 @@ namespace {
if (relative_rank(Us, s) >= RANK_5)
score += RookOnPawn * popcount(pos.pieces(Them, PAWN) & PseudoAttacks[ROOK][s]);

// Bonus for rook on same file as their queen
if (file_bb(s) & pos.pieces(Them, QUEEN))
score += RookOnQueenFile;

// Bonus for rook on an open or semi-open file
if (pos.is_on_semiopen_file(Us, s))
score += RookOnFile[bool(pos.is_on_semiopen_file(Them, s))];
Expand Down

0 comments on commit 36e4a86

Please sign in to comment.