// RookOnFile[semiopen/open] contains bonuses for each rook when there is
// no (friendly) pawn on the rook file.
// RookOnFile[semiopen/open] contains bonuses for each rook when there is
// no (friendly) pawn on the rook file.
- constexpr Score RookOnFile[] = { S(20, 7), S(45, 20) };
+ constexpr Score RookOnFile[] = { S(18, 7), S(44, 20) };
// ThreatByMinor/ByRook[attacked PieceType] contains bonuses according to
// which piece type attacks which one. Attacks on lesser pieces which are
// ThreatByMinor/ByRook[attacked PieceType] contains bonuses according to
// which piece type attacks which one. Attacks on lesser pieces which are
S(-30,-14), S(-9, -8), S( 0, 9), S( -1, 7)
};
S(-30,-14), S(-9, -8), S( 0, 9), S( -1, 7)
};
- // PassedDanger[Rank] contains a term to weight the passed score
- constexpr int PassedDanger[RANK_NB] = { 0, 0, 0, 3, 7, 11, 20 };
-
- constexpr Score BishopPawns = S( 3, 7);
- constexpr Score CloseEnemies = S( 6, 0);
+ constexpr Score BishopPawns = S( 3, 8);
+ constexpr Score CloseEnemies = S( 7, 0);
- constexpr Score Hanging = S( 57, 32);
- constexpr Score KingProtector = S( 6, 6);
- constexpr Score KnightOnQueen = S( 21, 11);
- constexpr Score LongDiagonalBishop = S( 46, 0);
+ constexpr Score Hanging = S( 62, 34);
+ constexpr Score KingProtector = S( 6, 7);
+ constexpr Score KnightOnQueen = S( 20, 12);
+ constexpr Score LongDiagonalBishop = S( 44, 0);
- constexpr Score Overload = S( 13, 6);
- constexpr Score PawnlessFlank = S( 19, 84);
- constexpr Score RookOnPawn = S( 10, 30);
- constexpr Score SliderOnQueen = S( 42, 21);
- constexpr Score ThreatByKing = S( 22, 78);
- constexpr Score ThreatByPawnPush = S( 45, 40);
- constexpr Score ThreatByRank = S( 16, 3);
- constexpr Score ThreatBySafePawn = S(173,102);
- constexpr Score TrappedRook = S( 92, 0);
- constexpr Score WeakQueen = S( 50, 10);
- constexpr Score WeakUnopposedPawn = S( 15, 19);
+ constexpr Score Overload = S( 12, 6);
+ constexpr Score PawnlessFlank = S( 18, 94);
+ constexpr Score RookOnPawn = S( 10, 28);
+ constexpr Score SliderOnQueen = S( 49, 21);
+ constexpr Score ThreatByKing = S( 21, 84);
+ constexpr Score ThreatByPawnPush = S( 48, 42);
+ constexpr Score ThreatByRank = S( 14, 3);
+ constexpr Score ThreatBySafePawn = S(169, 99);
+ constexpr Score TrappedRook = S( 98, 5);
+ constexpr Score WeakQueen = S( 51, 10);
+ constexpr Score WeakUnopposedPawn = S( 14, 20);
attackedBy[Us][ALL_PIECES] = attackedBy[Us][KING] | attackedBy[Us][PAWN];
attackedBy2[Us] = attackedBy[Us][KING] & attackedBy[Us][PAWN];
attackedBy[Us][ALL_PIECES] = attackedBy[Us][KING] | attackedBy[Us][PAWN];
attackedBy2[Us] = attackedBy[Us][KING] & attackedBy[Us][PAWN];
// Init our king safety tables only if we are going to use them
if (pos.non_pawn_material(Them) >= RookValueMg + KnightValueMg)
{
// Init our king safety tables only if we are going to use them
if (pos.non_pawn_material(Them) >= RookValueMg + KnightValueMg)
{
kingAttackersCount[Them] = popcount(kingRing[Us] & pe->pawn_attacks(Them));
kingAttacksCount[Them] = kingAttackersWeight[Them] = 0;
}
kingAttackersCount[Them] = popcount(kingRing[Us] & pe->pawn_attacks(Them));
kingAttacksCount[Them] = kingAttackersWeight[Them] = 0;
}
Bitboard kingFlank, weak, b, b1, b2, safe, unsafeChecks;
// King shelter and enemy pawns storm
Bitboard kingFlank, weak, b, b1, b2, safe, unsafeChecks;
// King shelter and enemy pawns storm
assert(!(pos.pieces(Them, PAWN) & forward_file_bb(Us, s + Up)));
int r = relative_rank(Us, s);
assert(!(pos.pieces(Them, PAWN) & forward_file_bb(Us, s + Up)));
int r = relative_rank(Us, s);
// Scale down bonus for candidate passers which need more than one
// pawn push to become passed, or have a pawn in front of them.
// Scale down bonus for candidate passers which need more than one
// pawn push to become passed, or have a pawn in front of them.