Simplify horde breakthrough bonus
authorFabian Fichter <ianfab@users.noreply.github.com>
Fri, 18 Dec 2020 09:10:52 +0000 (10:10 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Fri, 18 Dec 2020 09:10:52 +0000 (10:10 +0100)
horde STC
LLR: 2.96 (-2.94,2.94) [-10.00,5.00]
Total: 564 W: 312 L: 248 D: 4
http://www.variantfishtest.org:6543/tests/view/5fdbea7c6e23db221d9e957a

horde LTC
LLR: 2.97 (-2.94,2.94) [-10.00,5.00]
Total: 363 W: 211 L: 146 D: 6
http://www.variantfishtest.org:6543/tests/view/5fdbf10b6e23db221d9e9582

src/evaluate.cpp

index d5a13e2..7b129a2 100644 (file)
@@ -1188,13 +1188,8 @@ namespace {
                 if (breakthroughs)
                     dist = attackedBy[Us][QUEEN] & breakthroughs ? 0 : 1;
                 else for (File f = FILE_A; f <= pos.max_file(); ++f)
-                {
-                    int pawns = popcount(pos.pieces(Them, PAWN) & file_bb(f));
-                    int pawnsl = std::min(popcount(pos.pieces(Them, PAWN) & shift<WEST>(file_bb(f))), pawns);
-                    int pawnsr = std::min(popcount(pos.pieces(Them, PAWN) & shift<EAST>(file_bb(f))), pawns);
-                    dist = std::min(dist, pawnsl + pawnsr);
-                }
-                score += make_score(60, 60) * pos.count<PAWN>(Them) / (1 + dist) / (pos.pieces(Us, QUEEN) ? 2 : 4);
+                    dist = std::min(dist, popcount(pos.pieces(PAWN) & file_bb(f)));
+                score += make_score(70, 70) * pos.count<PAWN>(Them) / (1 + dist * (dist + 1)) / (pos.pieces(Us, QUEEN) ? 2 : 4);
             }
     }