1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Penalty for Knight when enemy pawns are few

This seems more a material imbalance topic,
anyhow test is good and so patch is applied
as is.

Passed both short TC:
LLR: 2.96 (-2.94,2.94) [-1.50,4.50]
Total: 17391 W: 3548 L: 3393 D: 10450

And long TC:
LLR: 3.00 (-2.94,2.94) [0.00,6.00]
Total: 34660 W: 5972 L: 5700 D: 22988

bench: 8291883
This commit is contained in:
Jörg Oster 2013-10-20 20:59:48 +02:00 committed by Marco Costalba
parent 67b0da83da
commit f011a5af11

View file

@ -172,6 +172,7 @@ namespace {
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);
@ -529,6 +530,10 @@ Value do_evaluate(const Position& pos, Value& margin) {
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