// 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 };
-
// Assorted bonuses and penalties
constexpr Score BishopPawns = S( 3, 7);
constexpr Score CloseEnemies = S( 6, 0);
// Assorted bonuses and penalties
constexpr Score BishopPawns = S( 3, 7);
constexpr Score CloseEnemies = S( 6, 0);
constexpr Score MinorBehindPawn = S( 16, 0);
constexpr Score Overload = S( 13, 6);
constexpr Score PawnlessFlank = S( 19, 84);
constexpr Score MinorBehindPawn = S( 16, 0);
constexpr Score Overload = S( 13, 6);
constexpr Score PawnlessFlank = S( 19, 84);
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 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 WeakQueen = S( 50, 10);
constexpr Score WeakUnopposedPawn = S( 15, 19);
constexpr Score WeakQueen = S( 50, 10);
constexpr Score WeakUnopposedPawn = S( 15, 19);
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.