mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Drop not defended by pawn condition
Passed no-regression test both at STC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 96554 W: 17563 L: 17572 D: 61419 and at LTC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 31891 W: 4905 L: 4801 D: 22185 bench: 7720896
This commit is contained in:
parent
d2caba1f66
commit
0ba814b3ca
1 changed files with 1 additions and 6 deletions
|
@ -204,8 +204,6 @@ namespace {
|
||||||
const int BishopCheck = 2;
|
const int BishopCheck = 2;
|
||||||
const int KnightCheck = 3;
|
const int KnightCheck = 3;
|
||||||
|
|
||||||
const int UnsupportedPinnedPiece = 2;
|
|
||||||
|
|
||||||
// KingDanger[Color][attackUnits] contains the actual king danger weighted
|
// KingDanger[Color][attackUnits] contains the actual king danger weighted
|
||||||
// scores, indexed by color and by a calculated integer number.
|
// scores, indexed by color and by a calculated integer number.
|
||||||
Score KingDanger[COLOR_NB][128];
|
Score KingDanger[COLOR_NB][128];
|
||||||
|
@ -631,6 +629,7 @@ Value do_evaluate(const Position& pos) {
|
||||||
// the pawn shelter (current 'score' value).
|
// the pawn shelter (current 'score' value).
|
||||||
attackUnits = std::min(20, (ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them]) / 2)
|
attackUnits = std::min(20, (ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them]) / 2)
|
||||||
+ 3 * (ei.kingAdjacentZoneAttacksCount[Them] + popcount<Max15>(undefended))
|
+ 3 * (ei.kingAdjacentZoneAttacksCount[Them] + popcount<Max15>(undefended))
|
||||||
|
+ 2 * (ei.pinnedPieces[Us] != 0)
|
||||||
- mg_value(score) / 32;
|
- mg_value(score) / 32;
|
||||||
|
|
||||||
// Analyse the enemy's safe queen contact checks. Firstly, find the
|
// Analyse the enemy's safe queen contact checks. Firstly, find the
|
||||||
|
@ -695,10 +694,6 @@ Value do_evaluate(const Position& pos) {
|
||||||
if (b)
|
if (b)
|
||||||
attackUnits += KnightCheck * popcount<Max15>(b);
|
attackUnits += KnightCheck * popcount<Max15>(b);
|
||||||
|
|
||||||
// Penalty for pinned pieces not defended by a pawn
|
|
||||||
if (ei.pinnedPieces[Us] & ~ei.attackedBy[Us][PAWN])
|
|
||||||
attackUnits += UnsupportedPinnedPiece;
|
|
||||||
|
|
||||||
// To index KingDanger[] attackUnits must be in [0, 99] range
|
// To index KingDanger[] attackUnits must be in [0, 99] range
|
||||||
attackUnits = std::min(99, std::max(0, attackUnits));
|
attackUnits = std::min(99, std::max(0, attackUnits));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue