From ca235d1d24c2a8be223f18444b9af7ade3cf5d79 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Mon, 2 Dec 2019 23:10:15 +0100 Subject: [PATCH] Consider soldiers as pawn-like in evaluation minixiangqi LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 398 W: 186 L: 101 D: 111 --- src/evaluate.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 00d5036..3cf43af 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -249,7 +249,7 @@ namespace { if (pos.must_capture()) mobilityArea[Us] = AllSquares; else - mobilityArea[Us] = ~(b | pos.pieces(Us, KING, QUEEN) | pe->pawn_attacks(Them) | shift(pos.pieces(Them, SHOGI_PAWN))); + mobilityArea[Us] = ~(b | pos.pieces(Us, KING, QUEEN) | pe->pawn_attacks(Them) | shift(pos.pieces(Them, SHOGI_PAWN, SOLDIER))); // Initialize attackedBy[] for king and pawns attackedBy[Us][KING] = pos.count(Us) ? pos.attacks_from(ksq, Us) : Bitboard(0); @@ -626,11 +626,11 @@ namespace { } // Non-pawn enemies - nonPawnEnemies = pos.pieces(Them) & ~pos.pieces(PAWN, SHOGI_PAWN); + nonPawnEnemies = pos.pieces(Them) & ~pos.pieces(PAWN, SHOGI_PAWN) & ~pos.pieces(SOLDIER); // Squares strongly protected by the enemy, either because they defend the // square with a pawn, or because they defend the square twice and we don't. - stronglyProtected = (attackedBy[Them][PAWN] | attackedBy[Them][SHOGI_PAWN]) + stronglyProtected = (attackedBy[Them][PAWN] | attackedBy[Them][SHOGI_PAWN] | attackedBy[Them][SOLDIER]) | (attackedBy2[Them] & ~attackedBy2[Us]); // Non-pawn enemies, strongly protected @@ -681,7 +681,7 @@ namespace { b &= ~attackedBy[Them][PAWN] & safe; // Bonus for safe pawn threats on the next move - b = (pawn_attacks_bb(b) | shift(shift(pos.pieces(Us, SHOGI_PAWN)))) & nonPawnEnemies; + b = (pawn_attacks_bb(b) | shift(shift(pos.pieces(Us, SHOGI_PAWN, SOLDIER)))) & nonPawnEnemies; score += ThreatByPawnPush * popcount(b); // Bonus for threats on the next moves against enemy queen -- 1.7.0.4