mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
Merge 'passed_pawns' tweaks
Good at both short and long TC 15+0.05 LLR: 2.96 (-2.94,2.94) Total: 28220 W: 5531 L: 5349 D: 17340 TC 60+0.05 LLR: 2.95 (-2.94,2.94) Total: 12612 W: 2221 L: 2057 D: 8334 bench: 4857939
This commit is contained in:
commit
02606a8c83
1 changed files with 24 additions and 10 deletions
|
@ -899,16 +899,30 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||||
else
|
else
|
||||||
unsafeSquares = squaresToQueen & (ei.attackedBy[Them][ALL_PIECES] | pos.pieces(Them));
|
unsafeSquares = squaresToQueen & (ei.attackedBy[Them][ALL_PIECES] | pos.pieces(Them));
|
||||||
|
|
||||||
// If there aren't enemy attacks or pieces along the path to queen give
|
// Default bonus for the empty square in front
|
||||||
// huge bonus. Even bigger if we protect the pawn's path.
|
int bonusMultiplier = 3;
|
||||||
|
|
||||||
|
if ((defendedSquares & SquareBB[blockSq]) != 0)
|
||||||
|
{
|
||||||
|
// Defending the square in front
|
||||||
|
bonusMultiplier += 2;
|
||||||
|
if ((unsafeSquares & defendedSquares) == unsafeSquares)
|
||||||
|
// Defending all the attacked squares
|
||||||
|
// bigger bonus if we are defending everything
|
||||||
|
bonusMultiplier += (squaresToQueen == defendedSquares) ? 4 : 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((unsafeSquares & SquareBB[blockSq]) == 0)
|
||||||
|
{
|
||||||
|
// The square infront isn't attacked
|
||||||
|
bonusMultiplier += 6;
|
||||||
if (!unsafeSquares)
|
if (!unsafeSquares)
|
||||||
ebonus += Value(rr * (squaresToQueen == defendedSquares ? 17 : 15));
|
bonusMultiplier += 6;
|
||||||
else
|
}
|
||||||
// OK, there are enemy attacks or pieces (but not pawns). Are those
|
|
||||||
// squares which are attacked by the enemy also attacked by us ?
|
Value bonus = Value(rr * bonusMultiplier);
|
||||||
// If yes, big bonus (but smaller than when there are no enemy attacks),
|
ebonus += bonus;
|
||||||
// if no, somewhat smaller bonus.
|
mbonus += bonus;
|
||||||
ebonus += Value(rr * ((unsafeSquares & defendedSquares) == unsafeSquares ? 13 : 8));
|
|
||||||
}
|
}
|
||||||
} // rr != 0
|
} // rr != 0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue