Refine horde connected bonus
authorFabian Fichter <ianfab@users.noreply.github.com>
Wed, 16 Dec 2020 19:04:14 +0000 (20:04 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 16 Dec 2020 19:04:14 +0000 (20:04 +0100)
horde STC
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 957 W: 532 L: 416 D: 9
http://www.variantfishtest.org:6543/tests/view/5fda46cb6e23db221d9e9557

horde LTC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 904 W: 506 L: 391 D: 7
http://www.variantfishtest.org:6543/tests/view/5fda4a616e23db221d9e955a

src/pawns.cpp

index fef84da..b8e38f7 100644 (file)
@@ -73,7 +73,8 @@ namespace {
 
 
   // Variant bonuses
-  constexpr int HordeConnected[RANK_NB] = { 0, 0, 0, 50, 50, 85, 50 };
+  constexpr int HordeConnected[2][RANK_NB] = {{   5, 10,  20, 55, 55, 100, 80 },
+                                              { -10,  5, -10,  5, 25,  40, 30 }};
 
   #undef S
   #undef V
@@ -158,8 +159,8 @@ namespace {
         {
             int v =  Connected[r] * (2 + bool(phalanx) - bool(opposed)) * (r == RANK_2 && pos.captures_to_hand() ? 3 : 1)
                    + 22 * popcount(support);
-            if (r >= RANK_4 && pos.count<PAWN>(Us) > popcount(pos.board_bb()) / 4)
-                v = popcount(support | phalanx) * HordeConnected[r] / (opposed ? 2 : 1);
+            if (pos.count<PAWN>(Us) > popcount(pos.board_bb()) / 4)
+                v = popcount(support | phalanx) * HordeConnected[bool(opposed)][r];
 
             score += make_score(v, v * (r - 2) / 4);
         }