Skip to content

Commit

Permalink
Add tuned values
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed May 16, 2024
1 parent c5c25d9 commit 36e1a91
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 123 deletions.
46 changes: 19 additions & 27 deletions src/Lynx.Cli/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@

// Evaluation
"DoubledPawnPenalty": {
"MG": -6,
"EG": -12
"MG": -8,
"EG": -11
},
"IsolatedPawnPenalty": {
"MG": -17,
"MG": -19,
"EG": -13
},
"OpenFileRookBonus": {
"MG": 47,
"EG": 10
"MG": 50,
"EG": 8
},
"SemiOpenFileRookBonus": {
"MG": 18,
"EG": 17
"MG": 20,
"EG": 16
},
"BishopMobilityBonus": {
"MG": 10,
Expand All @@ -84,22 +84,14 @@
},
"QueenMobilityBonus": {
"MG": 4,
"EG": 7
"EG": 8
},
//"SemiOpenFileKingPenalty": {
// "MG": -36,
// "EG": 24
//},
//"OpenFileKingPenalty": {
// "MG": -105,
// "EG": 8
//},
"KingShieldBonus": {
"MG": 16,
"EG": -6
"MG": 20,
"EG": -5
},
"BishopPairBonus": {
"MG": 31,
"MG": 32,
"EG": 80
},
"PassedPawnBonus": {
Expand All @@ -108,8 +100,8 @@
"EG": 0
},
"Rank1": {
"MG": -2,
"EG": 7
"MG": -1,
"EG": 6
},
"Rank2": {
"MG": -15,
Expand All @@ -120,16 +112,16 @@
"EG": 41
},
"Rank4": {
"MG": 20,
"EG": 74
"MG": 21,
"EG": 75
},
"Rank5": {
"MG": 60,
"EG": 150
"MG": 62,
"EG": 153
},
"Rank6": {
"MG": 98,
"EG": 217
"MG": 108,
"EG": 236
},
"Rank7": {
"MG": 0,
Expand Down
192 changes: 96 additions & 96 deletions src/Lynx/EvaluationConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,158 +26,158 @@ public static class EvaluationConstants

internal static readonly short[] MiddleGamePieceValues =
[
+105, +392, +363, +488, +1116, 0,
-105, -392, -363, -488, -1116, 0
+112, +395, +363, +486, +1123, 0,
-112, -395, -363, -486, -1123, 0
];

internal static readonly short[] EndGamePieceValues =
[
+135, +443, +399, +774, +1424, 0,
-135, -443, -399, -774, -1424, 0
+132, +440, +392, +767, +1410, 0,
-132, -440, -392, -767, -1410, 0
];

internal static readonly short[] MiddleGamePawnTable =
[
0, 0, 0, 0, 0, 0, 0, 0,
-26, -22, -15, -10, -2, 29, 31, -15,
-26, -24, -6, 9, 18, 28, 26, 7,
-25, -15, 3, 17, 25, 31, 4, -5,
-25, -11, 1, 19, 27, 28, 3, -6,
-24, -17, -4, 3, 14, 25, 19, 1,
-26, -20, -19, -14, -5, 23, 21, -22,
-29, -28, -18, -14, -2, 27, 39, -13,
-29, -29, -8, 6, 20, 28, 35, 11,
-28, -19, -1, 14, 27, 30, 12, -1,
-28, -15, -2, 16, 28, 27, 11, -2,
-26, -22, -7, 0, 15, 24, 29, 5,
-29, -25, -23, -18, -5, 21, 28, -21,
0, 0, 0, 0, 0, 0, 0, 0,
];

internal static readonly short[] EndGamePawnTable =
[
0, 0, 0, 0, 0, 0, 0, 0,
11, 11, 6, -12, 6, 2, -5, -10,
9, 10, 0, -13, -7, -6, -5, -11,
24, 17, -1, -20, -16, -12, 6, -2,
22, 17, -2, -16, -14, -9, 4, -4,
10, 8, -3, -11, -3, -4, -4, -11,
13, 11, 9, -12, 15, 5, -2, -6,
13, 13, 8, -10, 5, 2, -7, -10,
12, 12, 1, -12, -8, -6, -8, -11,
26, 19, 1, -19, -16, -12, 3, -2,
24, 19, 0, -15, -15, -9, 1, -4,
12, 10, -2, -10, -5, -4, -7, -11,
16, 14, 10, -11, 14, 5, -5, -7,
0, 0, 0, 0, 0, 0, 0, 0,
];

internal static readonly short[] MiddleGameKnightTable =
[
-145, -22, -50, -31, -12, -20, -10, -98,
-45, -28, -3, 16, 17, 24, -14, -17,
-28, 2, 20, 57, 60, 40, 34, -4,
-10, 25, 44, 59, 59, 59, 45, 18,
-7, 25, 46, 47, 57, 58, 45, 17,
-26, 4, 20, 49, 58, 34, 28, -5,
-46, -19, 0, 15, 17, 19, -13, -18,
-163, -25, -48, -20, -9, -11, -18, -88,
-149, -23, -51, -31, -14, -23, -11, -99,
-45, -28, -5, 15, 16, 23, -17, -19,
-28, 0, 19, 56, 60, 40, 34, -4,
-11, 25, 42, 59, 58, 59, 45, 17,
-8, 23, 45, 47, 56, 57, 45, 17,
-26, 2, 19, 48, 58, 33, 26, -4,
-45, -18, 0, 14, 15, 17, -16, -20,
-166, -25, -49, -20, -10, -14, -18, -90,
];

internal static readonly short[] EndGameKnightTable =
[
-67, -59, -12, -11, -10, -27, -53, -87,
-18, 1, 13, 8, 8, 5, -10, -20,
-14, 15, 35, 35, 32, 17, 9, -14,
7, 19, 47, 48, 52, 46, 24, -7,
4, 24, 46, 51, 52, 42, 28, 0,
-16, 18, 26, 40, 32, 18, 5, -10,
-25, 4, 5, 11, 4, 0, -11, -24,
-71, -57, -7, -14, -11, -26, -50, -85,
-62, -59, -12, -12, -10, -26, -53, -79,
-17, 1, 13, 8, 8, 5, -12, -21,
-14, 13, 35, 34, 32, 16, 8, -14,
5, 17, 47, 47, 52, 45, 22, -6,
4, 24, 45, 50, 52, 41, 27, -1,
-16, 17, 25, 39, 30, 18, 6, -10,
-26, 2, 5, 11, 4, 0, -11, -25,
-66, -57, -8, -16, -12, -25, -51, -80,
];

internal static readonly short[] MiddleGameBishopTable =
[
-18, 14, -3, -15, -12, -16, -22, 0,
7, 2, 7, -18, 2, -1, 27, -12,
-6, 5, -4, 3, -8, 13, 4, 27,
-8, -6, -5, 23, 20, -17, 2, -2,
-15, -1, -13, 18, 6, -13, -6, 5,
5, 5, 7, -4, 6, 6, 7, 22,
9, 13, 11, -6, -3, 3, 19, -3,
7, 18, 11, -30, -14, -21, 1, -15,
-17, 15, -2, -14, -12, -18, -23, -1,
6, 1, 6, -19, 1, 0, 25, -8,
-7, 5, -4, 3, -8, 13, 4, 28,
-6, -7, -6, 22, 20, -17, 2, -1,
-15, -2, -14, 20, 5, -14, -7, 5,
4, 5, 7, -5, 5, 7, 7, 23,
9, 13, 10, -6, -4, 3, 16, -4,
9, 19, 11, -30, -12, -22, 2, -17,
];

internal static readonly short[] EndGameBishopTable =
[
-11, 13, -14, 3, -2, 4, -2, -27,
-3, -7, -3, 4, 2, -9, -3, -15,
12, 13, 7, 2, 11, 3, 6, 9,
12, 7, 6, -3, -6, 6, 5, 6,
8, 10, 6, 0, -8, 6, 7, 7,
10, 4, 0, 0, 5, -1, 4, 6,
-13, -10, -14, 2, 1, -3, -3, -10,
-7, -14, -9, 7, 7, 6, -4, -13,
-9, 15, -12, 4, 0, 7, 0, -25,
-1, -7, -3, 5, 2, -9, -3, -15,
14, 13, 6, 1, 10, 3, 6, 9,
12, 7, 6, -4, -8, 6, 5, 7,
8, 9, 5, -1, -10, 6, 7, 9,
10, 3, -1, -1, 5, -2, 3, 7,
-10, -9, -15, 3, 1, -4, -2, -7,
-7, -13, -7, 9, 7, 7, -3, -10,
];

internal static readonly short[] MiddleGameRookTable =
[
-4, -10, -4, 2, 14, 4, 7, -2,
-26, -17, -13, -12, 0, 3, 17, -3,
-29, -20, -22, -12, 3, 10, 50, 27,
-24, -21, -17, -8, -4, 9, 38, 19,
-18, -15, -13, -5, -6, 8, 29, 14,
-22, -16, -18, -4, 2, 19, 48, 27,
-24, -26, -9, -6, 2, 2, 23, 2,
-2, -4, 0, 12, 22, 8, 15, 9,
-2, -9, -4, 1, 16, 2, 10, -3,
-24, -17, -14, -12, 2, 3, 16, -3,
-27, -19, -23, -12, 7, 12, 53, 32,
-25, -20, -17, -7, -2, 11, 43, 23,
-17, -16, -12, -5, -5, 10, 33, 18,
-21, -15, -19, -4, 3, 20, 48, 29,
-22, -25, -10, -7, 3, 1, 20, 2,
-1, -3, 0, 11, 23, 6, 18, 8,
];

internal static readonly short[] EndGameRookTable =
[
4, 2, 6, -3, -11, 3, 0, -4,
16, 19, 18, 8, -1, -2, -4, 3,
14, 11, 12, 5, -7, -9, -20, -16,
15, 11, 13, 6, 0, -1, -13, -13,
15, 11, 13, 4, 1, -6, -10, -9,
13, 14, 5, -3, -10, -13, -20, -11,
19, 22, 14, 4, -4, -2, -4, 2,
0, -3, 1, -9, -18, -5, -8, -12,
4, 2, 7, -1, -11, 5, 0, -3,
15, 19, 18, 8, -3, -3, -4, 2,
12, 11, 11, 5, -10, -11, -22, -17,
15, 10, 12, 4, -2, -3, -16, -14,
14, 10, 11, 3, -1, -7, -13, -10,
12, 12, 4, -4, -11, -14, -21, -12,
19, 21, 14, 4, -5, -3, -5, 2,
0, -3, 3, -8, -18, -3, -8, -12,
];

internal static readonly short[] MiddleGameQueenTable =
[
-12, -10, -5, 9, 3, -30, 9, 2,
-2, -10, 7, -3, 2, 6, 22, 49,
-9, -6, -9, -10, -12, 7, 34, 55,
-12, -19, -18, -9, -9, -5, 11, 24,
-12, -16, -19, -18, -8, -5, 9, 22,
-6, -4, -15, -12, -5, 4, 20, 37,
-16, -20, 3, 10, 7, 3, 6, 36,
-10, -10, 4, 11, 6, -36, -13, 25,
-12, -9, -5, 8, 3, -32, 10, 0,
-2, -12, 7, -3, 2, 4, 21, 61,
-8, -6, -9, -10, -11, 6, 32, 58,
-13, -19, -19, -10, -12, -5, 9, 23,
-12, -16, -21, -20, -12, -6, 8, 21,
-8, -3, -15, -12, -6, 3, 19, 38,
-16, -22, 3, 10, 8, 2, 2, 44,
-9, -9, 7, 11, 6, -39, -14, 26,
];

internal static readonly short[] EndGameQueenTable =
[
-24, -20, -11, -11, -16, -10, -34, 9,
-16, -9, -25, 0, -2, -16, -45, -7,
-15, -4, 6, 2, 23, 20, -8, 4,
-9, 9, 9, 14, 27, 38, 44, 31,
-2, 5, 16, 25, 22, 34, 25, 40,
-15, -11, 14, 12, 14, 20, 19, 15,
-10, -3, -21, -18, -12, -11, -31, 3,
-15, -16, -17, -6, -9, 16, 14, -3,
-22, -21, -10, -9, -16, -7, -36, 10,
-14, -10, -28, -2, -2, -13, -41, -1,
-16, -5, 5, -1, 21, 21, -3, 2,
-10, 7, 6, 11, 27, 37, 43, 35,
-3, 3, 16, 24, 25, 33, 26, 42,
-10, -14, 12, 7, 13, 20, 19, 19,
-8, -2, -23, -20, -15, -13, -23, 7,
-13, -16, -20, -4, -10, 18, 14, -1,
];

internal static readonly short[] MiddleGameKingTable =
[
25, 50, 26, -74, 9, -61, 39, 48,
-11, -16, -34, -72, -84, -58, -10, 19,
-82, -67, -105, -107, -116, -124, -83, -96,
-105, -95, -115, -150, -145, -138, -137, -162,
-71, -69, -103, -130, -146, -123, -141, -158,
-79, -43, -96, -104, -93, -104, -75, -87,
72, -9, -37, -63, -68, -47, 4, 26,
38, 75, 38, -59, 20, -51, 52, 62,
38, 59, 28, -86, 4, -58, 42, 57,
2, -18, -38, -81, -90, -71, -12, 21,
-75, -65, -113, -128, -136, -131, -88, -95,
-102, -102, -130, -180, -168, -143, -135, -168,
-71, -80, -119, -155, -159, -127, -141, -159,
-78, -41, -105, -121, -106, -108, -76, -87,
82, -14, -41, -75, -74, -54, 3, 30,
50, 84, 41, -70, 15, -47, 57, 73,
];

internal static readonly short[] EndGameKingTable =
[
-72, -46, -20, 5, -33, -2, -38, -89,
-13, 18, 27, 39, 46, 33, 13, -23,
10, 42, 59, 68, 72, 64, 44, 22,
15, 53, 75, 90, 88, 80, 68, 39,
5, 45, 72, 86, 91, 78, 70, 39,
11, 39, 57, 68, 66, 59, 43, 17,
-38, 13, 28, 37, 39, 29, 8, -26,
-82, -56, -26, -2, -29, -6, -42, -94,
-71, -46, -18, 3, -32, -2, -36, -87,
-16, 18, 26, 37, 45, 37, 14, -21,
7, 39, 57, 68, 72, 65, 44, 23,
11, 50, 72, 89, 87, 80, 65, 39,
2, 42, 70, 84, 89, 78, 69, 38,
8, 34, 55, 67, 66, 59, 42, 19,
-40, 13, 27, 36, 39, 32, 9, -25,
-84, -58, -27, -4, -28, -5, -40, -94,
];

#pragma warning restore IDE0055
Expand Down

0 comments on commit 36e1a91

Please sign in to comment.