]> git.sesse.net Git - stockfish/commitdiff
Pawn flank attacks
authorStéphane Nicolet <cassio@free.fr>
Mon, 5 Dec 2016 17:49:07 +0000 (18:49 +0100)
committerMarco Costalba <mcostalba@users.noreply.github.com>
Mon, 5 Dec 2016 17:49:07 +0000 (18:49 +0100)
This patch tweaks some pawn values to favor flank attacks.

The first part of the patch increases the midgame psqt values of external pawns to launch more attacks (credits to user GuardianRM for this idea), while the second part increases the endgame connection values for pawns on upper ranks.

Passed STC:
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 34997 W: 6328 L: 6055 D: 22614

and LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 13844 W: 1832 L: 1650 D: 10362

Bench: 5884767

src/pawns.cpp
src/psqt.cpp

index 71ec344394506b821c59341f57b1c2d478bac375..6e564c9ddae2c6e6ea21829a085bfd6deab22c26 100644 (file)
@@ -197,7 +197,7 @@ void init() {
   {
       int v = (Seed[r] + (phalanx ? (Seed[r + 1] - Seed[r]) / 2 : 0)) >> opposed;
       v += (apex ? v / 2 : 0);
   {
       int v = (Seed[r] + (phalanx ? (Seed[r + 1] - Seed[r]) / 2 : 0)) >> opposed;
       v += (apex ? v / 2 : 0);
-      Connected[opposed][phalanx][apex][r] = make_score(v, v * 5 / 8);
+      Connected[opposed][phalanx][apex][r] = make_score(v, v * (r-2) / 4);
   }
 }
 
   }
 }
 
index 41a9b499b4c4611dc1f8bd9ec7cfde46db3d104f..3addc2884faf6a3508c40c5956d73810f0187f66 100644 (file)
@@ -39,12 +39,12 @@ const Score Bonus[][RANK_NB][int(FILE_NB) / 2] = {
   { },
   { // Pawn
    { S(  0, 0), S(  0, 0), S(  0, 0), S( 0, 0) },
   { },
   { // Pawn
    { S(  0, 0), S(  0, 0), S(  0, 0), S( 0, 0) },
-   { S(-16, 7), S(  1,-4), S(  7, 8), S( 3,-2) },
-   { S(-23,-4), S( -7,-5), S( 19, 5), S(24, 4) },
-   { S(-22, 3), S(-14, 3), S( 20,-8), S(35,-3) },
-   { S(-11, 8), S(  0, 9), S(  3, 7), S(21,-6) },
-   { S(-11, 8), S(-13,-5), S( -6, 2), S(-2, 4) },
-   { S( -9, 3), S( 15,-9), S( -8, 1), S(-4,18) }
+   { S(-11, 7), S(  6,-4), S(  7, 8), S( 3,-2) },
+   { S(-18,-4), S( -2,-5), S( 19, 5), S(24, 4) },
+   { S(-17, 3), S( -9, 3), S( 20,-8), S(35,-3) },
+   { S(- 6, 8), S(  5, 9), S(  3, 7), S(21,-6) },
+   { S(- 6, 8), S(- 8,-5), S( -6, 2), S(-2, 4) },
+   { S( -4, 3), S( 20,-9), S( -8, 1), S(-4,18) }
   },
   { // Knight
    { S(-143, -97), S(-96,-82), S(-80,-46), S(-73,-14) },
   },
   { // Knight
    { S(-143, -97), S(-96,-82), S(-80,-46), S(-73,-14) },