constexpr Value SpaceThreshold = Value(12222);
// KingAttackWeights[PieceType] contains king attack weights by piece type
- constexpr int KingAttackWeights[PIECE_TYPE_NB] = { 0, 0, 77, 55, 44, 10 };
+ constexpr int KingAttackWeights[PIECE_TYPE_NB] = { 0, 0, 81, 52, 44, 10 };
// Penalties for enemy's safe checks
constexpr int QueenSafeCheck = 780;
// RookOnFile[semiopen/open] contains bonuses for each rook when there is
// no (friendly) pawn on the rook file.
- constexpr Score RookOnFile[] = { S(18, 7), S(44, 20) };
+ constexpr Score RookOnFile[] = { S(21, 4), S(47, 25) };
// ThreatByMinor/ByRook[attacked PieceType] contains bonuses according to
// which piece type attacks which one. Attacks on lesser pieces which are
// pawn-defended are not considered.
constexpr Score ThreatByMinor[PIECE_TYPE_NB] = {
- S(0, 0), S(0, 31), S(39, 42), S(57, 44), S(68, 112), S(62, 120)
+ S(0, 0), S(6, 28), S(39, 42), S(57, 44), S(68, 112), S(62, 120)
};
constexpr Score ThreatByRook[PIECE_TYPE_NB] = {
- S(0, 0), S(0, 24), S(38, 71), S(38, 61), S(0, 38), S(51, 38)
+ S(0, 0), S(3, 44), S(38, 71), S(38, 61), S(0, 38), S(51, 38)
};
// PassedRank[Rank] contains a bonus according to the rank of a passed pawn
constexpr Score PassedFile = S( 11, 8);
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 RookOnQueenFile = S( 7, 6);
constexpr Score SliderOnQueen = S( 59, 18);
constexpr Score ThreatByKing = S( 24, 89);
constexpr Score ThreatByPawnPush = S( 48, 39);
if (Pt == ROOK)
{
- // Bonus for aligning rook with enemy pawns on the same rank/file
- if (relative_rank(Us, s) >= RANK_5)
- score += RookOnPawn * popcount(pos.pieces(Them, PAWN) & PseudoAttacks[ROOK][s]);
-
// Bonus for rook on the same file as a queen
if (file_bb(s) & pos.pieces(QUEEN))
score += RookOnQueenFile;
{ S(-48,-51), S( -3,-40), S(-12,-39), S(-25,-20) }
},
{ // Rook
- { S(-24, -2), S(-13,-6), S(-7, -3), S( 2,-2) },
- { S(-18,-10), S(-10,-7), S(-5, 1), S( 9, 0) },
- { S(-21, 10), S( -7,-4), S( 3, 2), S( 7,-2) },
- { S(-13, -5), S( -5, 2), S(-4, -8), S(-6, 8) },
- { S(-24, -8), S(-12, 5), S(-1, 4), S( 6,-9) },
- { S(-24, 3), S( -4,-2), S( 4,-10), S(10, 7) },
- { S( -8, 1), S( 6, 2), S(10, 17), S(12,-8) },
- { S(-22, 12), S(-24,-6), S(-6, 13), S( 4, 7) }
+ { S(-31, -9), S(-20,-13), S(-14,-10), S(-5, -9) },
+ { S(-21,-12), S(-13, -9), S( -8, -1), S( 6, -2) },
+ { S(-25, 6), S(-11, -8), S( -1, -2), S( 3, -6) },
+ { S(-13, -6), S( -5, 1), S( -4, -9), S(-6, 7) },
+ { S(-27, -5), S(-15, 8), S( -4, 7), S( 3, -6) },
+ { S(-22, 6), S( -2, 1), S( 6, -7), S(12, 10) },
+ { S( -2, 4), S( 12, 5), S( 16, 20), S(18, -5) },
+ { S(-17, 18), S(-19, 0), S( -1, 19), S( 9, 13) }
},
{ // Queen
{ S( 3,-69), S(-5,-57), S(-5,-47), S( 4,-26) },