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

Evaluate king safety when no queen is present.

LLR: 2.97 (-2.94,2.94) [-1.50,4.50]
Total: 16657 W: 3547 L: 3391 D: 9719

LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 31258 W: 5664 L: 5403 D: 20191

Bench: 8331165

Resolves #51
This commit is contained in:
uriblass 2014-09-22 01:32:47 +08:00 committed by Gary Linscott
parent 766fb9c67d
commit fed3e752ae

View file

@ -221,7 +221,7 @@ namespace {
ei.attackedBy[Us][ALL_PIECES] = ei.attackedBy[Us][PAWN] = ei.pi->pawn_attacks(Us); ei.attackedBy[Us][ALL_PIECES] = ei.attackedBy[Us][PAWN] = ei.pi->pawn_attacks(Us);
// Init king safety tables only if we are going to use them // Init king safety tables only if we are going to use them
if (pos.count<QUEEN>(Us) && pos.non_pawn_material(Us) > QueenValueMg + PawnValueMg) if (pos.non_pawn_material(Us) > QueenValueMg + PawnValueMg)
{ {
ei.kingRing[Them] = b | shift_bb<Down>(b); ei.kingRing[Them] = b | shift_bb<Down>(b);
b &= ei.attackedBy[Us][PAWN]; b &= ei.attackedBy[Us][PAWN];
@ -414,7 +414,8 @@ namespace {
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) + 2 * (ei.pinnedPieces[Us] != 0)
- mg_value(score) / 32; - mg_value(score) / 32
- !pos.count<QUEEN>(Them) * 15;
// Analyse the enemy's safe queen contact checks. Firstly, find the // Analyse the enemy's safe queen contact checks. Firstly, find the
// undefended squares around the king that are attacked by the enemy's // undefended squares around the king that are attacked by the enemy's