From: Stéphane Nicolet Date: Mon, 5 Dec 2016 17:49:07 +0000 (+0100) Subject: Pawn flank attacks X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=0d33466bcd84d9d58ea7049b224f375ba6a51221;ds=sidebyside Pawn flank attacks 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 --- diff --git a/src/pawns.cpp b/src/pawns.cpp index 71ec3443..6e564c9d 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -197,7 +197,7 @@ void init() { { 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); } } diff --git a/src/psqt.cpp b/src/psqt.cpp index 41a9b499..3addc288 100644 --- a/src/psqt.cpp +++ b/src/psqt.cpp @@ -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) }, - { 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) },