const Score RookOpenFile = make_score(43, 21);
const Score RookSemiopenFile = make_score(19, 10);
const Score BishopPawns = make_score( 8, 12);
+ const Score KnightPawns = make_score( 8, 4);
const Score MinorBehindPawn = make_score(16, 0);
const Score UndefendedMinor = make_score(25, 10);
const Score TrappedRook = make_score(90, 0);
if (Piece == BISHOP)
score -= BishopPawns * ei.pi->pawns_on_same_color_squares(Us, s);
+ // Penalty for knight when there are few enemy pawns
+ if (Piece == KNIGHT)
+ score -= KnightPawns * std::max(5 - pos.count<PAWN>(Them), 0);
+
if (Piece == BISHOP || Piece == KNIGHT)
{
// Bishop and knight outposts squares