mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
Add min pawn-king distance to endgame evaluation
At endgame time push the king near his pawns (actually one of them). Original idea is from Critter (although slightly different), implementation is mine and is completely different from the original, in particular it is different the algorithm to compute the minimum distance from pawns. After 19895 games at 15"+0.05 Mod vs Orig 3638 - 3248 - 13009 ELO +7 Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
9793fa1906
commit
4f5680950a
1 changed files with 2 additions and 2 deletions
|
@ -268,7 +268,7 @@ Score PawnEntry::update_safety(const Position& pos, Square ksq) {
|
|||
while (!(DistanceRingsBB[ksq][minKPdistance[Us]++] & pawns)) {}
|
||||
|
||||
if (relative_rank(Us, ksq) > RANK_4)
|
||||
return kingSafety[Us] = SCORE_ZERO;
|
||||
return kingSafety[Us] = make_score(0, -16 * minKPdistance[Us]);
|
||||
|
||||
Value bonus = shelter_storm<Us>(pos, ksq);
|
||||
|
||||
|
@ -279,7 +279,7 @@ Score PawnEntry::update_safety(const Position& pos, Square ksq) {
|
|||
if (pos.can_castle(make_castle_right(Us, QUEEN_SIDE)))
|
||||
bonus = std::max(bonus, shelter_storm<Us>(pos, relative_square(Us, SQ_C1)));
|
||||
|
||||
return kingSafety[Us] = make_score(bonus, 0);
|
||||
return kingSafety[Us] = make_score(bonus, -16 * minKPdistance[Us]);
|
||||
}
|
||||
|
||||
// Explicit template instantiation
|
||||
|
|
Loading…
Add table
Reference in a new issue