]> git.sesse.net Git - stockfish/commitdiff
Halve StormDanger bonus for blocked pawn on A/H file
authorjoergoster <osterj165@googlemail.com>
Thu, 11 Dec 2014 18:06:03 +0000 (13:06 -0500)
committerGary Linscott <glinscott@gmail.com>
Thu, 11 Dec 2014 18:08:29 +0000 (13:08 -0500)
STC
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 3410 W: 758 L: 641 D: 2011

LTC
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 33225 W: 5708 L: 5445 D: 22072

Bench: 8465811

Resolves #153

src/pawns.cpp

index 16b00ec2fa012cbf36e75001e3811e661bc91f1a..d6ea1479de80c407449863709208db76fa1b13c3 100644 (file)
@@ -65,11 +65,14 @@ namespace {
   { V(100), V(0), V(27), V(73), V(92), V(101), V(101) };
 
   // Danger of enemy pawns moving toward our king indexed by
-  // [no friendly pawn | pawn unblocked | pawn blocked][rank of enemy pawn]
-  const Value StormDanger[][RANK_NB] = {
-  { V( 0),  V(64), V(128), V(51), V(26) },
-  { V(26),  V(32), V( 96), V(38), V(20) },
-  { V( 0),  V( 0), V(160), V(25), V(13) } };
+  // [edge files][no friendly pawn | pawn unblocked | pawn blocked][rank of enemy pawn]
+  const Value StormDanger[][3][RANK_NB] = {
+  { { V( 0),  V(64), V(128), V(51), V(26) },
+    { V(26),  V(32), V( 96), V(38), V(20) },
+    { V( 0),  V( 0), V(160), V(25), V(13) } },
+  { { V( 0),  V(64), V(128), V(51), V(26) },
+    { V(26),  V(32), V( 96), V(38), V(20) },
+    { V( 0),  V( 0), V( 80), V(13), V( 7) } } };
 
   // Max bonus for king safety. Corresponds to start position with all the pawns
   // in front of the king and no enemy pawn on the horizon.
@@ -252,7 +255,8 @@ Value Entry::shelter_storm(const Position& pos, Square ksq) {
           safety += 200;
       else
           safety -=  ShelterWeakness[rkUs]
-                   + StormDanger[rkUs   == RANK_1   ? 0 :
+                   + StormDanger[f == FILE_A || f == FILE_H]
+                                [rkUs   == RANK_1   ? 0 :
                                  rkThem != rkUs + 1 ? 1 : 2][rkThem];
   }