From c990f4d21c1b69ac31ee79d64ee2dea1638bf3ba Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sat, 6 Jul 2019 12:22:06 +0200 Subject: [PATCH] Redefine game phase for drop games crazyhouse STC LLR: 2.97 (-2.94,2.94) [-10.00,5.00] Total: 2070 W: 1033 L: 981 D: 56 http://35.161.250.236:6543/tests/view/5d1f37226e23db34f4206c75 crazyhouse LTC LLR: 2.97 (-2.94,2.94) [-10.00,5.00] Total: 1346 W: 680 L: 623 D: 43 http://35.161.250.236:6543/tests/view/5d1f665c6e23db34f4206c78 --- src/material.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/material.cpp b/src/material.cpp index 7d65145..8b29f4e 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -143,10 +143,10 @@ Entry* probe(const Position& pos) { // Map total non-pawn material into [PHASE_ENDGAME, PHASE_MIDGAME] if (pos.captures_to_hand()) { - npm = VALUE_ZERO; + Value npm2 = VALUE_ZERO; for (PieceType pt : pos.piece_types()) - npm += (pos.count_in_hand(WHITE, pt) + pos.count_in_hand(BLACK, pt)) * PieceValue[MG][make_piece(WHITE, pt)]; - e->gamePhase = Phase(PHASE_MIDGAME * (MidgameLimit - std::min(npm, MidgameLimit)) / MidgameLimit); + npm2 += (pos.count_in_hand(WHITE, pt) + pos.count_in_hand(BLACK, pt)) * PieceValue[MG][make_piece(WHITE, pt)]; + e->gamePhase = Phase(PHASE_MIDGAME * npm / std::max(int(npm + npm2), 1)); } else e->gamePhase = Phase(((npm - EndgameLimit) * PHASE_MIDGAME) / (MidgameLimit - EndgameLimit)); -- 1.7.0.4