Tweak shelter strength for drop variants
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 1 Sep 2018 09:22:40 +0000 (11:22 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 19 Sep 2018 20:21:28 +0000 (22:21 +0200)
STC crazyhouse
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 7305 W: 3696 L: 3490 D: 119
http://35.161.250.236:6543/tests/view/5b8a5c546e23db0fbab0dd0f

src/pawns.cpp

index 032e177..5ee3165 100644 (file)
@@ -227,7 +227,8 @@ Value Entry::evaluate_shelter(const Position& pos, Square ksq) {
       int theirRank = b ? relative_rank(Us, frontmost_sq(Them, b), pos.max_rank()) : 0;
 
       int d = std::min(f, ~f);
-      safety += ShelterStrength[d][ourRank];
+      // higher weight for pawns on second rank and missing shelter in drop variants
+      safety += ShelterStrength[d][ourRank] * (1 + (pos.captures_to_hand() && ourRank <= RANK_2));
       safety -= (ourRank && (ourRank == theirRank - 1)) ? BlockedStorm[theirRank]
                                                         : UnblockedStorm[d][theirRank];
   }