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 15, 2024
1 parent f015e56 commit af97f8f
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 121 deletions.
32 changes: 16 additions & 16 deletions src/Lynx.Cli/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,41 +67,41 @@
// "EG": -13
//},
"OpenFileRookBonus": {
"MG": 47,
"EG": 10
"MG": 42,
"EG": 2
},
"SemiOpenFileRookBonus": {
"MG": 18,
"EG": 17
"MG": 15,
"EG": -7
},
"BishopMobilityBonus": {
"MG": 10,
"EG": 9
"EG": 8
},
"RookMobilityBonus": {
"MG": 5,
"EG": 5
"MG": 6,
"EG": 4
},
"QueenMobilityBonus": {
"MG": 4,
"MG": 5,
"EG": 7
},
"SemiOpenFileKingPenalty": {
"MG": -36,
"EG": 24
"MG": -48,
"EG": 15
},
"OpenFileKingPenalty": {
"MG": -105,
"EG": 8
"MG": -109,
"EG": 7
},
"KingShieldBonus": {
"MG": 16,
"EG": -6
"EG": -8
},
"BishopPairBonus": {
"MG": 31,
"EG": 80
},
"MG": 30,
"EG": 78
}
//"PassedPawnBonus": {
// "Rank0": {
// "MG": 0,
Expand Down
18 changes: 9 additions & 9 deletions src/Lynx/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,23 +207,23 @@ public sealed class EngineSettings

//public TaperedEvaluationTerm IsolatedPawnPenalty { get; set; } = new(-17, -13);

public TaperedEvaluationTerm OpenFileRookBonus { get; set; } = new(47, 10);
public TaperedEvaluationTerm OpenFileRookBonus { get; set; } = new(42, 2);

public TaperedEvaluationTerm SemiOpenFileRookBonus { get; set; } = new(18, 17);
public TaperedEvaluationTerm SemiOpenFileRookBonus { get; set; } = new(15, -7);

public TaperedEvaluationTerm BishopMobilityBonus { get; set; } = new(10, 9);
public TaperedEvaluationTerm BishopMobilityBonus { get; set; } = new(10, 8);

public TaperedEvaluationTerm RookMobilityBonus { get; set; } = new(5, 5);
public TaperedEvaluationTerm RookMobilityBonus { get; set; } = new(6, 4);

public TaperedEvaluationTerm QueenMobilityBonus { get; set; } = new(4, 7);
public TaperedEvaluationTerm QueenMobilityBonus { get; set; } = new(5, 7);

public TaperedEvaluationTerm SemiOpenFileKingPenalty { get; set; } = new(-36, 24);
public TaperedEvaluationTerm SemiOpenFileKingPenalty { get; set; } = new(-48, 15);

public TaperedEvaluationTerm OpenFileKingPenalty { get; set; } = new(-105, 8);
public TaperedEvaluationTerm OpenFileKingPenalty { get; set; } = new(-109, 7);

public TaperedEvaluationTerm KingShieldBonus { get; set; } = new(16, -6);
public TaperedEvaluationTerm KingShieldBonus { get; set; } = new(16, -8);

public TaperedEvaluationTerm BishopPairBonus { get; set; } = new(31, 80);
public TaperedEvaluationTerm BishopPairBonus { get; set; } = new(30, 78);

//public TaperedEvaluationTermByRank PassedPawnBonus { get; set; } = new(
// new(0, 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
+98, +393, +359, +486, +1101, 0,
-98, -393, -359, -486, -1101, 0
];

internal static readonly short[] EndGamePieceValues =
[
+135, +443, +399, +774, +1424, 0,
-135, -443, -399, -774, -1424, 0
+161, +415, +377, +737, +1362, 0,
-161, -415, -377, -737, -1362, 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,
-31, -7, -14, -13, -2, 29, 40, -18,
-34, -12, -8, 10, 19, 21, 30, 1,
-33, -3, 0, 14, 23, 25, 9, -13,
-33, 1, -1, 16, 25, 22, 9, -13,
-31, -6, -6, 1, 11, 18, 23, -4,
-31, -5, -19, -19, -7, 22, 30, -25,
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,
16, 16, 1, 42, 15, -9, -5, -14,
13, 15, -2, 4, -11, -18, -7, -17,
24, 17, -8, -20, -26, -29, 0, -9,
21, 15, -8, -16, -22, -24, -2, -13,
14, 9, -7, 5, -5, -17, -5, -18,
17, 13, 4, 52, 28, -7, -2, -13,
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,
-142, -21, -51, -31, -13, -21, -10, -95,
-46, -27, -3, 16, 17, 25, -16, -18,
-29, 0, 20, 55, 58, 38, 31, -6,
-11, 24, 42, 58, 56, 57, 42, 15,
-7, 24, 44, 46, 55, 55, 43, 14,
-26, 2, 19, 48, 57, 32, 25, -8,
-46, -18, 0, 15, 16, 19, -12, -19,
-153, -22, -48, -20, -11, -11, -18, -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,
-72, -57, -16, -9, -9, -26, -48, -104,
-22, 4, 11, 11, 12, 8, -5, -17,
-13, 15, 39, 37, 36, 23, 12, -11,
8, 21, 49, 49, 54, 49, 28, -3,
7, 23, 46, 53, 54, 45, 32, 4,
-18, 19, 32, 42, 34, 23, 9, -9,
-27, 7, 3, 13, 8, 0, -8, -27,
-90, -56, -14, -13, -10, -30, -44, -103,
];

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,
-16, 17, 2, -18, -11, -15, -15, 1,
7, 4, 4, -17, 1, 1, 28, -13,
-6, 3, -4, 1, -8, 12, 2, 26,
-9, -7, -7, 22, 18, -18, 1, -3,
-15, -2, -14, 18, 5, -14, -6, 3,
5, 2, 7, -6, 5, 6, 4, 23,
9, 15, 9, -6, -3, 4, 21, -3,
6, 17, 14, -32, -15, -18, 5, -13,
];

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

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,
-3, -10, -2, 5, 16, 6, 6, -2,
-26, -16, -13, -11, 1, 2, 14, -3,
-28, -19, -22, -12, 2, 9, 47, 27,
-19, -19, -16, -5, -3, 8, 37, 22,
-15, -15, -11, -3, -6, 7, 27, 17,
-19, -16, -17, -2, 2, 17, 45, 27,
-24, -25, -8, -3, 3, 2, 22, 5,
-2, -3, 3, 14, 23, 11, 14, 10,
];

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

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,
-9, -8, -5, 12, 4, -31, 2, 4,
0, -10, 6, -3, 1, 4, 23, 51,
-9, -8, -11, -12, -15, 5, 30, 55,
-11, -20, -21, -10, -12, -9, 9, 24,
-10, -16, -21, -18, -10, -9, 8, 22,
-6, -5, -16, -14, -8, 2, 17, 37,
-13, -18, 2, 10, 7, 2, 8, 40,
-8, -8, 7, 15, 8, -34, -10, 29,
];

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,
-31, -25, -14, -14, -21, -3, -24, 4,
-23, -7, -24, 0, 0, -10, -41, -14,
-18, -1, 11, 7, 29, 25, 0, 1,
-17, 8, 11, 19, 29, 41, 44, 27,
-14, 2, 18, 30, 23, 38, 22, 34,
-18, -9, 18, 17, 20, 23, 22, 12,
-20, -5, -19, -18, -11, -8, -29, -4,
-21, -21, -22, -10, -16, 11, 3, -14,
];

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,
17, 46, 28, -70, 12, -59, 36, 42,
-25, -18, -31, -69, -80, -55, -10, 15,
-92, -71, -107, -106, -116, -127, -85, -98,
-111, -105, -121, -149, -149, -142, -140, -164,
-66, -74, -105, -125, -152, -128, -138, -154,
-82, -43, -91, -101, -89, -99, -71, -86,
64, -10, -34, -58, -62, -42, 7, 24,
24, 74, 40, -54, 25, -48, 51, 58,
];

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,
-75, -53, -31, -12, -46, -12, -40, -93,
-9, 13, 19, 29, 37, 28, 11, -25,
20, 47, 60, 69, 72, 66, 47, 27,
26, 64, 84, 97, 94, 88, 76, 49,
13, 57, 82, 94, 99, 86, 79, 49,
19, 46, 63, 72, 70, 61, 47, 24,
-34, 16, 28, 35, 37, 29, 10, -22,
-70, -54, -26, -4, -32, -9, -38, -92,
];

#pragma warning restore IDE0055
Expand Down

0 comments on commit af97f8f

Please sign in to comment.