mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 17:19:36 +00:00
Further simplify unstoppable (#938)
By finally moving it into passed pawns eval. Tested for no regression: STC LLR: 3.25 (-2.94,2.94) [-3.00,1.00] Total: 57109 W: 10023 L: 9947 D: 37139 LTC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 21511 W: 2800 L: 2680 D: 16031 Bench: 5255881
This commit is contained in:
parent
3728e833aa
commit
8765f9ce16
1 changed files with 4 additions and 11 deletions
|
@ -197,7 +197,6 @@ namespace {
|
||||||
const Score WeakQueen = S(50, 10);
|
const Score WeakQueen = S(50, 10);
|
||||||
const Score Hanging = S(48, 27);
|
const Score Hanging = S(48, 27);
|
||||||
const Score ThreatByPawnPush = S(38, 22);
|
const Score ThreatByPawnPush = S(38, 22);
|
||||||
const Score Unstoppable = S( 0, 45);
|
|
||||||
const Score PawnlessFlank = S(20, 80);
|
const Score PawnlessFlank = S(20, 80);
|
||||||
const Score HinderPassedPawn = S( 7, 0);
|
const Score HinderPassedPawn = S( 7, 0);
|
||||||
const Score ThreatByRank = S(16, 3);
|
const Score ThreatByRank = S(16, 3);
|
||||||
|
@ -678,6 +677,10 @@ namespace {
|
||||||
mbonus += rr + r * 2, ebonus += rr + r * 2;
|
mbonus += rr + r * 2, ebonus += rr + r * 2;
|
||||||
} // rr != 0
|
} // rr != 0
|
||||||
|
|
||||||
|
// Assign a small bonus when no pieces left (unstoppable)
|
||||||
|
if (!pos.non_pawn_material(Us) && !pos.non_pawn_material(Them))
|
||||||
|
ebonus += 20;
|
||||||
|
|
||||||
score += make_score(mbonus, ebonus) + PassedFile[file_of(s)];
|
score += make_score(mbonus, ebonus) + PassedFile[file_of(s)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -852,16 +855,6 @@ Value Eval::evaluate(const Position& pos) {
|
||||||
score += evaluate_passed_pawns<WHITE, DoTrace>(pos, ei)
|
score += evaluate_passed_pawns<WHITE, DoTrace>(pos, ei)
|
||||||
- evaluate_passed_pawns<BLACK, DoTrace>(pos, ei);
|
- evaluate_passed_pawns<BLACK, DoTrace>(pos, ei);
|
||||||
|
|
||||||
// If both sides have only pawns, score for potential unstoppable pawns
|
|
||||||
if (!pos.non_pawn_material(WHITE) && !pos.non_pawn_material(BLACK))
|
|
||||||
{
|
|
||||||
if (ei.pi->passed_pawns(WHITE))
|
|
||||||
score += Unstoppable;
|
|
||||||
|
|
||||||
if (ei.pi->passed_pawns(BLACK))
|
|
||||||
score -= Unstoppable;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Evaluate space for both sides, only during opening
|
// Evaluate space for both sides, only during opening
|
||||||
if (pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK) >= 12222)
|
if (pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK) >= 12222)
|
||||||
score += evaluate_space<WHITE>(pos, ei)
|
score += evaluate_space<WHITE>(pos, ei)
|
||||||
|
|
Loading…
Add table
Reference in a new issue