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 7f76db8 commit de329a0
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 126 deletions.
56 changes: 26 additions & 30 deletions src/Lynx.Cli/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,17 @@
"FP_Margin": 250,

// Evaluation
//"DoubledPawnPenalty": {
// "MG": -6,
// "EG": -12
//},
"IsolatedPawnPenalty": {
"MG": -17,
"EG": -13
"MG": -21,
"EG": -17
},
"OpenFileRookBonus": {
"MG": 47,
"EG": 10
"MG": 46,
"EG": 9
},
"SemiOpenFileRookBonus": {
"MG": 18,
"EG": 17
"MG": 15,
"EG": 15
},
"BishopMobilityBonus": {
"MG": 10,
Expand All @@ -84,22 +80,22 @@
},
"QueenMobilityBonus": {
"MG": 4,
"EG": 7
"EG": 8
},
"SemiOpenFileKingPenalty": {
"MG": -36,
"EG": 24
"MG": -41,
"EG": 21
},
"OpenFileKingPenalty": {
"MG": -105,
"EG": 8
"MG": -110,
"EG": 10
},
"KingShieldBonus": {
"MG": 16,
"EG": -6
"MG": 17,
"EG": -5
},
"BishopPairBonus": {
"MG": 31,
"MG": 33,
"EG": 80
},
"PassedPawnBonus": {
Expand All @@ -108,28 +104,28 @@
"EG": 0
},
"Rank1": {
"MG": -2,
"EG": 7
"MG": 4,
"EG": 12
},
"Rank2": {
"MG": -15,
"EG": 13
"MG": -11,
"EG": 19
},
"Rank3": {
"MG": -14,
"EG": 41
"MG": -11,
"EG": 47
},
"Rank4": {
"MG": 20,
"EG": 74
"MG": 21,
"EG": 80
},
"Rank5": {
"MG": 60,
"EG": 150
"MG": 62,
"EG": 158
},
"Rank6": {
"MG": 98,
"EG": 217
"MG": 104,
"EG": 243
},
"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
+105, +399, +365, +493, +1129, 0,
-105, -399, -365, -493, -1129, 0
];

internal static readonly short[] EndGamePieceValues =
[
+135, +443, +399, +774, +1424, 0,
-135, -443, -399, -774, -1424, 0
+128, +440, +392, +769, +1408, 0,
-128, -440, -392, -769, -1408, 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,
-26, -25, -16, -9, -3, 29, 29, -11,
-27, -27, -7, 10, 17, 26, 23, 11,
-25, -17, 1, 18, 26, 29, 1, -1,
-25, -13, 0, 20, 27, 27, 1, -2,
-23, -21, -5, 3, 13, 23, 16, 5,
-26, -23, -20, -13, -6, 23, 19, -19,
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,
15, 10, 5, -12, 7, 1, -7, -7,
13, 9, -1, -12, -6, -7, -7, -8,
27, 17, 0, -19, -15, -13, 4, 0,
25, 16, -1, -15, -14, -10, 2, -2,
14, 7, -3, -10, -3, -5, -6, -8,
17, 11, 9, -11, 16, 4, -4, -4,
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,
-147, -24, -51, -30, -14, -21, -11, -98,
-45, -28, -5, 15, 16, 25, -12, -17,
-29, 0, 18, 56, 60, 39, 33, -4,
-11, 25, 42, 59, 58, 58, 44, 17,
-8, 23, 44, 46, 56, 56, 44, 16,
-27, 2, 18, 48, 57, 32, 26, -5,
-46, -18, 0, 14, 15, 19, -12, -18,
-164, -26, -50, -20, -9, -11, -19, -88,
];

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, -27, -53, -82,
-17, 0, 13, 8, 8, 5, -13, -22,
-13, 14, 35, 34, 32, 16, 8, -13,
5, 18, 47, 48, 52, 46, 23, -5,
4, 23, 45, 51, 52, 41, 27, -1,
-15, 17, 26, 39, 31, 18, 6, -9,
-25, 2, 5, 11, 4, 0, -12, -26,
-66, -58, -8, -16, -12, -26, -51, -82,
];

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, -10, -16, -21, 1,
6, 2, 7, -17, 2, 3, 28, -7,
-6, 5, -4, 2, -8, 14, 5, 28,
-6, -6, -6, 24, 20, -17, 2, -1,
-13, -1, -13, 20, 6, -14, -6, 5,
5, 5, 7, -5, 6, 8, 7, 24,
9, 13, 11, -5, -2, 5, 20, -1,
8, 20, 12, -29, -11, -20, 2, -14,
];

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,
-8, 15, -12, 4, -1, 6, -1, -25,
0, -7, -3, 5, 2, -10, -3, -15,
14, 13, 6, 1, 10, 3, 6, 9,
13, 7, 6, -4, -7, 6, 5, 8,
8, 10, 5, -1, -10, 6, 7, 10,
10, 3, -1, -1, 5, -2, 3, 7,
-10, -8, -14, 3, 1, -3, -2, -7,
-6, -13, -8, 8, 7, 7, -3, -11,
];

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,
-5, -10, -5, 2, 14, 3, 6, -4,
-26, -17, -13, -11, 1, 5, 19, -2,
-28, -19, -23, -12, 5, 11, 50, 30,
-25, -20, -18, -6, -4, 10, 38, 21,
-18, -16, -12, -4, -6, 8, 29, 14,
-22, -15, -19, -4, 2, 19, 48, 27,
-24, -26, -10, -6, 3, 3, 26, 3,
-4, -4, -1, 11, 21, 7, 14, 7,
];

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,
5, 3, 7, -1, -10, 5, 1, -3,
16, 19, 18, 8, -2, -2, -3, 1,
12, 10, 11, 5, -8, -10, -21, -18,
14, 10, 12, 4, 0, -1, -14, -13,
14, 10, 12, 3, 1, -6, -12, -10,
13, 12, 4, -3, -10, -14, -20, -12,
19, 21, 14, 4, -4, -3, -6, 2,
0, -2, 3, -8, -17, -3, -7, -11,
];

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,
-11, -9, -5, 10, 4, -30, 8, -5,
-2, -11, 8, -1, 4, 7, 24, 62,
-7, -6, -9, -10, -12, 7, 33, 58,
-13, -19, -19, -10, -11, -4, 11, 24,
-11, -16, -20, -20, -11, -5, 9, 22,
-8, -3, -14, -11, -5, 4, 20, 38,
-15, -21, 4, 11, 9, 5, 8, 46,
-9, -9, 7, 12, 8, -35, -14, 25,
];

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,
-24, -22, -11, -11, -16, -6, -33, 14,
-15, -10, -28, -2, -3, -15, -41, -7,
-17, -6, 5, 0, 22, 21, -1, 3,
-10, 7, 7, 12, 27, 37, 44, 36,
-4, 3, 15, 24, 24, 33, 28, 44,
-11, -14, 11, 6, 13, 20, 20, 20,
-10, -2, -22, -20, -15, -15, -26, 4,
-15, -16, -20, -5, -11, 16, 14, 0,
];

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,
27, 51, 26, -74, 9, -61, 38, 48,
-6, -16, -32, -72, -85, -59, -11, 18,
-74, -63, -104, -106, -115, -128, -85, -93,
-95, -91, -110, -144, -142, -137, -133, -168,
-70, -65, -99, -122, -139, -122, -139, -158,
-79, -35, -91, -101, -92, -104, -75, -87,
76, -8, -35, -63, -67, -46, 4, 27,
41, 77, 39, -56, 21, -50, 52, 64,
];

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,
-70, -45, -19, 7, -31, -2, -36, -88,
-15, 18, 27, 39, 46, 34, 13, -22,
8, 40, 58, 68, 71, 64, 43, 21,
11, 51, 73, 87, 86, 79, 65, 39,
3, 42, 71, 83, 89, 77, 69, 38,
10, 35, 56, 67, 65, 58, 41, 18,
-38, 13, 28, 37, 40, 29, 8, -25,
-82, -57, -26, -1, -27, -5, -41, -95,
];

#pragma warning restore IDE0055
Expand Down

0 comments on commit de329a0

Please sign in to comment.