Skip to content

Commit f4ace94

Browse files
DiscanXglinscott
authored andcommitted
Tuned values for mid and end game passed pawns.
STC : LLR: 2.96 (-2.94,2.94) [0.00,4.00] Total: 22691 W: 4468 L: 4228 D: 13995 LTC : LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 13620 W: 2216 L: 2023 D: 9381 Bench: 8384669 Resolves #391
1 parent 1aae35b commit f4ace94

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/evaluate.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,17 @@ namespace {
146146
S(0, 0), S(0, 0), S(107, 138), S(84, 122), S(114, 203), S(121, 217)
147147
};
148148

149+
// PassedPawnsBonusMg[Rank] and PassedPawnsBonusEg[Rank]
150+
//contains bonuses for midgame and endgame for passed pawns according to
151+
//the rank of the pawn.
152+
const Value PassedPawnsBonusMg[6] = {
153+
V(0), V(1), V(34), V(90), V(214), V(328)
154+
};
155+
156+
const Value PassedPawnsBonusEg[6] = {
157+
V(7), V(14), V(37), V(63), V(134), V(189)
158+
};
159+
149160
const Score ThreatenedByHangingPawn = S(40, 60);
150161

151162
// Assorted bonuses and penalties used by evaluation
@@ -567,8 +578,8 @@ namespace {
567578
int r = relative_rank(Us, s) - RANK_2;
568579
int rr = r * (r - 1);
569580

570-
// Base bonus based on rank
571-
Value mbonus = Value(17 * rr), ebonus = Value(7 * (rr + r + 1));
581+
Value mbonus = PassedPawnsBonusMg[r],
582+
ebonus = PassedPawnsBonusEg[r];
572583

573584
if (rr)
574585
{

0 commit comments

Comments
 (0)