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 85f4854 commit c2ba929
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 118 deletions.
44 changes: 22 additions & 22 deletions src/Lynx.Cli/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,39 @@
"EG": -12
},
"IsolatedPawnPenalty": {
"MG": -17,
"MG": -18,
"EG": -13
},
"OpenFileRookBonus": {
"MG": 47,
"EG": 10
"MG": 45,
"EG": 11
},
"SemiOpenFileRookBonus": {
"MG": 18,
"EG": 17
"MG": 16,
"EG": 18
},
"BishopMobilityBonus": {
"MG": 10,
"EG": 9
},
"RookMobilityBonus": {
"MG": 5,
"EG": 5
"EG": 4
},
"QueenMobilityBonus": {
"MG": 4,
"EG": 7
"EG": 8
},
"SemiOpenFileKingPenalty": {
"MG": -36,
"EG": 24
"MG": -42,
"EG": 25
},
"OpenFileKingPenalty": {
"MG": -105,
"EG": 8
"MG": -115,
"EG": 12
},
"BishopPairBonus": {
"MG": 31,
"MG": 33,
"EG": 80
},
"PassedPawnBonus": {
Expand All @@ -104,28 +104,28 @@
"EG": 0
},
"Rank1": {
"MG": -2,
"EG": 7
"MG": -1,
"EG": 6
},
"Rank2": {
"MG": -15,
"EG": 13
"EG": 12
},
"Rank3": {
"MG": -14,
"EG": 41
"EG": 40
},
"Rank4": {
"MG": 20,
"EG": 74
"MG": 21,
"EG": 75
},
"Rank5": {
"MG": 60,
"EG": 150
"MG": 63,
"EG": 152
},
"Rank6": {
"MG": 98,
"EG": 217
"MG": 101,
"EG": 238
},
"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
+110, +402, +370, +491, +1135, 0,
-110, -402, -370, -491, -1135, 0
];

internal static readonly short[] EndGamePieceValues =
[
+135, +443, +399, +774, +1424, 0,
-135, -443, -399, -774, -1424, 0
+133, +438, +391, +769, +1402, 0,
-133, -438, -391, -769, -1402, 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,
-28, -25, -17, -6, -1, 41, 39, -4,
-28, -26, -8, 7, 16, 28, 24, 7,
-28, -17, 0, 15, 23, 29, 3, -5,
-27, -13, -2, 17, 25, 26, 2, -6,
-25, -20, -6, 1, 12, 25, 18, 1,
-27, -22, -21, -10, -2, 35, 29, -12,
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, -14, 5, -1, -5, -12,
11, 12, 1, -12, -6, -5, -3, -10,
26, 19, 1, -19, -15, -11, 7, -1,
23, 18, -1, -15, -14, -8, 5, -3,
12, 10, -2, -10, -2, -4, -3, -10,
15, 13, 10, -13, 13, 2, -3, -8,
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, -26, -52, -29, -15, -9, -13, -91,
-47, -30, -7, 16, 18, 33, -5, -8,
-32, -3, 16, 54, 57, 38, 32, -5,
-14, 22, 40, 56, 56, 55, 42, 14,
-11, 21, 42, 44, 54, 54, 42, 14,
-30, 0, 16, 45, 55, 31, 25, -7,
-47, -20, -2, 15, 16, 27, -5, -8,
-161, -28, -49, -19, -11, 0, -21, -80,
];

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, -58, -11, -12, -9, -30, -52, -83,
-16, 2, 14, 8, 8, 2, -14, -23,
-13, 15, 36, 35, 34, 17, 9, -13,
6, 19, 48, 49, 53, 47, 24, -5,
5, 24, 46, 51, 53, 41, 28, -1,
-14, 18, 27, 40, 32, 19, 7, -8,
-25, 2, 6, 10, 4, -4, -13, -28,
-68, -56, -7, -16, -11, -29, -50, -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,
-21, 13, -5, -14, -12, -7, -13, 7,
3, -1, 5, -18, 2, 8, 35, -2,
-9, 2, -7, 0, -11, 11, 2, 25,
-10, -10, -9, 20, 17, -21, -1, -4,
-17, -5, -17, 17, 3, -17, -9, 3,
1, 2, 4, -7, 2, 5, 5, 21,
7, 11, 9, -5, -2, 12, 27, 5,
5, 18, 8, -30, -13, -12, 12, -11,
];

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

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

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,
-14, -10, -6, 12, 4, -20, 17, -5,
-5, -13, 6, 0, 4, 15, 28, 59,
-10, -9, -11, -12, -14, 5, 31, 57,
-16, -22, -21, -14, -13, -8, 9, 21,
-15, -18, -23, -23, -13, -8, 7, 19,
-11, -5, -16, -12, -7, 2, 18, 38,
-18, -23, 2, 12, 9, 13, 13, 45,
-12, -10, 6, 15, 7, -25, -3, 23,
];

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, -22, -10, -15, -16, -12, -38, 15,
-13, -9, -28, -5, -5, -21, -41, -3,
-15, -4, 6, 0, 22, 23, 1, 4,
-7, 8, 6, 13, 27, 38, 45, 38,
-1, 4, 15, 26, 23, 34, 29, 47,
-7, -14, 12, 7, 14, 21, 23, 20,
-8, -1, -22, -23, -17, -20, -27, 6,
-12, -16, -19, -9, -11, 11, 8, 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,
13, 48, 31, -81, 3, -63, 36, 29,
-8, -8, -20, -61, -73, -44, 5, 17,
-73, -51, -92, -94, -104, -113, -71, -91,
-92, -83, -102, -132, -130, -127, -123, -165,
-66, -55, -90, -110, -128, -112, -127, -154,
-75, -21, -80, -90, -80, -89, -59, -85,
76, 1, -21, -54, -57, -32, 19, 26,
34, 79, 47, -62, 13, -53, 50, 46,
];

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,
-64, -41, -20, 10, -30, -1, -35, -79,
-14, 17, 25, 37, 44, 30, 9, -20,
8, 37, 55, 65, 69, 61, 40, 21,
10, 49, 71, 85, 83, 77, 62, 39,
3, 40, 68, 81, 86, 75, 65, 37,
9, 33, 53, 65, 63, 54, 38, 17,
-37, 12, 26, 36, 37, 26, 4, -24,
-78, -55, -28, 1, -25, -4, -39, -86,
];

#pragma warning restore IDE0055
Expand Down

0 comments on commit c2ba929

Please sign in to comment.