Consider board size in shogi king danger
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 1 Mar 2020 19:06:37 +0000 (20:06 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 1 Mar 2020 19:06:37 +0000 (20:06 +0100)
shogi
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 2688 W: 1391 L: 1251 D: 46

minishogi
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 2208 W: 1169 L: 1035 D: 4

src/evaluate.cpp

index 4248f76..cf696d0 100644 (file)
@@ -584,7 +584,7 @@ namespace {
 
     // For drop games, king danger is independent of game phase
     if (pos.captures_to_hand())
-        score = make_score(mg_value(score), mg_value(score)) * 2 / (2 + 3 * !pos.shogi_doubled_pawn());
+        score = make_score(mg_value(score), mg_value(score)) * 2 / (2 + 16 / pos.max_rank() * !pos.shogi_doubled_pawn());
 
     if (T)
         Trace::add(KING, Us, score);