Define game phase based on pieces in hand,
and score king danger independent of game phase.
shogi
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 624 W: 357 L: 248 D: 19
minishogi
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 468 W: 261 L: 161 D: 46
judkinshogi
LLR: 2.98 (-2.94,2.94) [-10.00,5.00]
Total: 508 W: 281 L: 217 D: 10
crazyhouse STC
LLR: 2.99 (-2.94,2.94) [-10.00,5.00]
Total: 613 W: 330 L: 267 D: 16
http://35.161.250.236:6543/tests/view/
5c13f9786e23db7639060ce0
// King tropism, to anticipate slow motion attacks on our king
score -= CloseEnemies * (popcount(b1) + popcount(b2)) * (1 + pos.captures_to_hand() + !!pos.max_check_count());
+ // For drop games, king danger is independent of game phase
+ if (pos.captures_to_hand())
+ score = make_score(mg_value(score), mg_value(score)) / (1 + 3 * !pos.shogi_doubled_pawn());
+
if (T)
Trace::add(KING, Us, score);
Value npm = std::max(EndgameLimit, std::min(npm_w + npm_b, MidgameLimit));
// Map total non-pawn material into [PHASE_ENDGAME, PHASE_MIDGAME]
- e->gamePhase = Phase(((npm - EndgameLimit) * PHASE_MIDGAME) / (MidgameLimit - EndgameLimit));
+ if (pos.captures_to_hand())
+ {
+ npm = 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);
+ }
+ else
+ e->gamePhase = Phase(((npm - EndgameLimit) * PHASE_MIDGAME) / (MidgameLimit - EndgameLimit));
#ifdef LARGEBOARDS
// Disable endgame evaluation until it works independent of board size
Bitboard blackDropRegion = AllSquares;
bool sittuyinRookDrop = false;
bool dropOppositeColoredBishop = false;
- bool shogiDoubledPawn = false;
+ bool shogiDoubledPawn = true;
bool immobilityIllegal = false;
// game end
Value stalemateValue = VALUE_DRAW;