From fed3e752aec8a43f65b07d0efae0900b942b9c16 Mon Sep 17 00:00:00 2001 From: uriblass Date: Mon, 22 Sep 2014 01:32:47 +0800 Subject: [PATCH] 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 --- src/evaluate.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index a0e22516..ce98af6f 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -221,7 +221,7 @@ namespace { 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 - if (pos.count(Us) && pos.non_pawn_material(Us) > QueenValueMg + PawnValueMg) + if (pos.non_pawn_material(Us) > QueenValueMg + PawnValueMg) { ei.kingRing[Them] = b | shift_bb(b); b &= ei.attackedBy[Us][PAWN]; @@ -414,7 +414,8 @@ namespace { attackUnits = std::min(20, (ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them]) / 2) + 3 * (ei.kingAdjacentZoneAttacksCount[Them] + popcount(undefended)) + 2 * (ei.pinnedPieces[Us] != 0) - - mg_value(score) / 32; + - mg_value(score) / 32 + - !pos.count(Them) * 15; // Analyse the enemy's safe queen contact checks. Firstly, find the // undefended squares around the king that are attacked by the enemy's -- 2.39.2