Skip to content

Commit 3913726

Browse files
miguel-lsnicolet
authored andcommitted
Use single value for KingProtector.
After some recent big tuning session, the values for King Protector were simplified to only be used on minor pieces. This patch tries to further simplify by just using a single value, since current S(6,5) and S(5,6) are close to each other. The value S(6,6) ended up passing, although S(5,5) was also tried and failed STC. STC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 14261 W: 3288 L: 3151 D: 7822 http://tests.stockfishchess.org/tests/view/5b4ccdf50ebc5902bdb77f65 LTC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 19606 W: 3396 L: 3273 D: 12937 http://tests.stockfishchess.org/tests/view/5b4ce4280ebc5902bdb7803b Bench: 5448998
1 parent 2ac3502 commit 3913726

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Mark Tenzer (31m059)
8282
Michael Byrne (MichaelB7)
8383
Michael Stembera (mstembera)
8484
Michel Van den Bergh (vdbergh)
85+
Miguel Lahoz (miguel-l)
8586
Mikael Bäckman (mbootsector)
8687
Mike Whiteley (protonspring)
8788
Miroslav Fontán (Hexik)
@@ -118,4 +119,3 @@ Tom Vijlbrief (tomtor)
118119
Torsten Franz (torfranz)
119120
Uri Blass (uriblass)
120121
Vince Negri
121-
xoroshiro

src/evaluate.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,14 @@ namespace {
154154
// PassedDanger[Rank] contains a term to weight the passed score
155155
constexpr int PassedDanger[RANK_NB] = { 0, 0, 0, 3, 7, 11, 20 };
156156

157-
// KingProtector[knight/bishop] contains a penalty according to distance from king
158-
constexpr Score KingProtector[] = { S(5, 6), S(6, 5) };
159-
160157
// Assorted bonuses and penalties
161158
constexpr Score BishopPawns = S( 3, 7);
162159
constexpr Score CloseEnemies = S( 6, 0);
163160
constexpr Score Connectivity = S( 3, 1);
164161
constexpr Score CorneredBishop = S( 50, 50);
165162
constexpr Score Hanging = S( 52, 30);
166163
constexpr Score HinderPassedPawn = S( 4, 0);
164+
constexpr Score KingProtector = S( 6, 6);
167165
constexpr Score KnightOnQueen = S( 21, 11);
168166
constexpr Score LongDiagonalBishop = S( 22, 0);
169167
constexpr Score MinorBehindPawn = S( 16, 0);
@@ -342,7 +340,7 @@ namespace {
342340
score += MinorBehindPawn;
343341

344342
// Penalty if the piece is far from the king
345-
score -= KingProtector[Pt == BISHOP] * distance(s, pos.square<KING>(Us));
343+
score -= KingProtector * distance(s, pos.square<KING>(Us));
346344

347345
if (Pt == BISHOP)
348346
{

0 commit comments

Comments
 (0)