Piece/square table challenge

Discussion of chess software programming and technical issues.

Moderator: Ras

PK
Posts: 904
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Piece/square table challenge

Post by PK »

Basically I used tables from Rodent, but with some modifications. Pawn table was the hardest. It uses rank-based vector {-3, -1, 1, 3, 3, -1, -3} as a basis, multiplying it by 5 for midgame and by -1 for endgame. 7th rank gets full worth of Rodent's passed pawn bonus, 6th rank - probably 60% of it. endgame table gets a bonus for advancing all pawns, which in retrospect should be different. midgame table wants to advance central pawns (d/e more than c/f) and to stop them on 4th rank if possible. beside that A2/B2/G2/H2 got a big bonus, so that engine tries to keep pawn shield around its king.

the rest is similar to tables described at the end of Toga log user manual (http://members.aon.at/josefd/Toga%20LOG), with some tweaks. If I remember correctly, knight, queen and king tables are identical or almost identical. I preferred my bishops to stay back in the midgame, however, in order to protect them, and wanted them to like long diagonals. This should be consistent with slight preference for bishops.

BTW, I noticed that Your set of values avoids castling a little bit too often, so I'll try to check if it gains something with more traditional king tables.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Piece/square table challenge

Post by Lyudmil Tsvetkov »

PK wrote:@Lyudmil,

I'd like to include Your tables in the competition, but please type Your values in the template I provided and fill in the gaps (piece values, king tables). For the record: exact divisor for Stockfish pst values is 2,56.
Hi Pawel, please forget about that.

At the moment I simply do not have time for this particular operation, it is too costly in terms of effort, because I have to fill everything manually, as I do not use special programming tools.

However, Adam's table is an excellent example of how I would have filled the tables. Maybe there is some asymmetry and other details that would differ, but on the whole Adam's tables (apart from the king) are what I understand as good space tables. But having bonus for squares attacking the short castled king, both for bishops and knights, provided that you use no attacks in Rodent, is somehow biassed if one table uses such bonus and others not. If you think of everything you could include in case psqt is the only eval you use, you could do much better tables.

I am rooting again for Adam tables, those are basically the space tables I would like to see, with many corrections of course. And they are scoring best. :D
PK
Posts: 904
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Piece/square table challenge

Post by PK »

Ok, Lyudmil. In that event I'll try to see what happens if I make Adam's tables (or at least parts of them) vertically symmetric.
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: Piece/square table challenge

Post by velmarin »

Lyudmil Tsvetkov wrote: it is too costly in terms of effort, because I have to fill everything manually, as I do not use special programming tools.
Heh, programming is hard, tools no .... manual typing and intuition, and 99 percent goes to waste ....
Bouquet has eight pawns arrays for more color ... these non static, in eval dinamic ...

The subject is very interesting ...
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Piece/square table challenge

Post by Daniel Shawul »

Nebiyu uses one centralization PSQT for all pieces for both middle game and end game phases. It results in a weird style of play that favors all pieces to move towards the centre. Spartacus exploited this style with wing side pawn pushes but pure PSQT engines will not be able exploit it. So here is my entry :

Code: Select all

-40, -28, -22, -12, -12, -22, -28, -40,
-18,  -6,   0,  10,  10,   0,  -6, -18,
-12,   0,   6,  16,  16,   6,   0, -12,
 -2,  10,  16,  26,  26,  16,  10,  -2,
 -2,  10,  16,  26,  26,  16,  10,  -2,
-12,   0,   6,  16,  16,   6,   0, -12,
-18,  -6,   0,  10,  10,   0,  -6, -18,
-40, -28, -22, -12, -12, -22, -28, -40,
The value of the pieces are the standard 100,325,325,500,900
PK
Posts: 904
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Piece/square table challenge

Post by PK »

First results are:

Code: Select all

 
    Program                          Elo    +   -   Games   Score   Av.Op.  Draws
  1 Adam Hair                      : 2079   14  14  2034    62.9 %   1988   17.7 %
  2 Pawel Koziol                    : 2056   13  13  2068    58.9 %   1993   24.0 %
  3 Tomasz Michniewski / CPW       : 2000   13  13  2016    49.0 %   2007   25.5 %
  4 Lucas Braesch                  : 1962   13  13  2026    42.1 %   2017   24.7 %
  5 Mikko Aarnos (MY ERROR)       : 1932   14  14  2036    36.9 %   2025   22.0 %
Unfortunately I'll have to replay all games of Mikko's entry, as I made a typo with queen value. But this will come tomorrow.
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: Piece/square table challenge

Post by Adam Hair »

PK wrote:Basically I used tables from Rodent, but with some modifications. Pawn table was the hardest. It uses rank-based vector {-3, -1, 1, 3, 3, -1, -3} as a basis, multiplying it by 5 for midgame and by -1 for endgame. 7th rank gets full worth of Rodent's passed pawn bonus, 6th rank - probably 60% of it. endgame table gets a bonus for advancing all pawns, which in retrospect should be different. midgame table wants to advance central pawns (d/e more than c/f) and to stop them on 4th rank if possible. beside that A2/B2/G2/H2 got a big bonus, so that engine tries to keep pawn shield around its king.

the rest is similar to tables described at the end of Toga log user manual (http://members.aon.at/josefd/Toga%20LOG), with some tweaks. If I remember correctly, knight, queen and king tables are identical or almost identical. I preferred my bishops to stay back in the midgame, however, in order to protect them, and wanted them to like long diagonals. This should be consistent with slight preference for bishops.

BTW, I noticed that Your set of values avoids castling a little bit too often, so I'll try to check if it gains something with more traditional king tables.
The king midgame table is basically the table that Cupcake uses. I just modified it to discourage long side castling. That brought about a small improvement in self-play.

There was not enough data to create a full king midgame table, which is why I used the Cupcake values for this table. Evidently stronger engines think it is unsafe to let the king meander around when there a lot of enemy pieces on the board :lol:
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: Piece/square table challenge

Post by Adam Hair »

Here are Lyudmil's PSTs (adjusted to centipawns). I am interested in seeing how Lyudmil's ideas work with an engine with no eval. I used Pawel's king midgame PST and my king endgame PST.

Code: Select all

#define PAWN_VAL 100 
#define KNIGHT_VAL 300 
#define BISHOP_VAL 300 
#define ROOK_VAL 450 
#define QUEEN_VAL 900



const int pstPawnMg[64] =
{
    0,   0,   0,   0,   0,   0,   0,   0
   -5,  -2,   4,   5,   5,   4,  -2,  -5
   -4,  -2,   5,   7,   7,   5,  -2,  -4
   -2,  -1,   9,  13,  13,   9,  -1,  -2
    2,   4,  13,  21,  21,  13,   4,   2
   10,  21,  25,  29,  29,  25,  21,  10
    1,   2,   5,   9,   9,   5,   2,   1
    0,   0,   0,   0,   0,   0,   0,   0
};

const int pstPawnEg[64] =
{
    0,   0,   0,   0,   0,   0,   0,   0
   -3,  -1,   2,   3,   3,   2,  -1,  -3
   -2,  -1,   3,   4,   4,   3,  -1,  -2
   -1,   0,   4,   7,   7,   4,   0,  -1
    1,   2,   7,  11,  11,   7,   2,   1
    5,  11,  13,  14,  14,  13,  11,   5
    0,   1,   3,   5,   5,   3,   1,   0
    0,   0,   0,   0,   0,   0,   0,   0
};

const int pstKnightMg[64] =
{
  -31, -23, -20, -16, -16, -20, -23, -31
  -23, -16, -12,  -8,  -8, -12, -16, -23
   -8,  -4,   0,   8,   8,   0,  -4,  -8
   -4,   8,  12,  16,  16,  12,   8,  -4
    8,  16,  20,  23,  23,  20,  16,   8
   23,  27,  31,  35,  35,  31,  27,  23
    4,   8,  12,  16,  16,  12,   8,   4
    4,   4,   4,   4,   4,   4,   4,   4
};

const int pstKnightEg[64] =
{
   -39, -27, -23, -20, -20, -23, -27, -39
   -27, -20, -12,  -8,  -8, -12, -20, -27
    -8,  -4,   0,   8,   8,   0,  -4,  -8
    -4,   8,  12,  16,  16,  12,   8,  -4
     8,  16,  20,  23,  23,  20,  16,   8
    12,  23,  27,  31,  31,  27,  23,  12
    -2,   2,   4,   8,   8,   4,   2,  -2
   -16,  -8,  -4,  -4,  -4,  -4,  -8, -16
};

const int pstBishopMg[64] =  
{
  -31, -23, -20, -16, -16, -20, -23, -31
  -23, -16, -12,  -8,  -8, -12, -16, -23
   -8,  -4,   0,   8,   8,   0,  -4,  -8
   -4,   8,  12,  16,  16,  12,   8,  -4
    8,  16,  20,  23,  23,  20,  16,   8
   23,  27,  31,  35,  35,  31,  27,  23
    4,   8,  12,  16,  16,  12,   8,   4
    4,   4,   4,   4,   4,   4,   4,   4
};

const int pstBishopEg[64] =  
{
   -39, -27, -23, -20, -20, -23, -27, -39
   -27, -20, -12,  -8,  -8, -12, -20, -27
    -8,  -4,   0,   8,   8,   0,  -4,  -8
    -4,   8,  12,  16,  16,  12,   8,  -4
     8,  16,  20,  23,  23,  20,  16,   8
    12,  23,  27,  31,  31,  27,  23,  12
    -2,   2,   4,   8,   8,   4,   2,  -2
   -16,  -8,  -4,  -4,  -4,  -4,  -8, -16
};

const int pstRookMg[64] =
{
   -10,  -8,  -6,  -4,  -4,  -6,  -8, -10
    -8,  -6,  -4,  -2,  -2,  -4,  -6,  -8
    -4,  -2,   0,   4,   4,   0,  -2,  -4
    -2,   2,   4,   8,   8,   4,   2,  -2
     2,   4,   8,  12,  12,   8,   4,   2
     4,   8,   12, 16,  16,  12,   8,   4
    20,  21,   23, 23,  23,  23,  21,  20
    18,  18,   20, 20,  20,  20,  18,  18
};

const int pstRookEg[64] =
{
   -10,  -8,  -6,  -4,  -4,  -6,  -8, -10
    -8,  -6,  -4,  -2,  -2,  -4,  -6,  -8
    -4,  -2,   0,   4,   4,   0,  -2,  -4
    -2,   2,   4,   8,   8,   4,   2,  -2
     2,   4,   8,  12,  12,   8,   4,   2
     4,   8,  12,  16,  16,  12,   8,   4
    20,  21,  23,  23,  23,  23,  21,  20
    18,  18,  20,  20,  20,  20,  18,  18
};

const int pstQueenMg[64] =
{
   -23, -20, -16, -12, -12, -16, -20, -23
   -18, -14, -12,  -8,  -8, -12, -14, -18
   -16,  -8,   0,   8,   8,   0,  -8, -16
    -8,   0,  12,  16,  16,  12,   0,  -8
     4,  12,  16,  23,  23,  16,  12,   4
    16,  23,  27,  31,  31,  27,  23,  16
     4,  12,  16,  23,  23,  16,  12,   4
     2,   8,  12,  12,  12,  12,   8,   2
};

const int pstQueenEg[64] =
{
   -23, -20, -16, -12, -12, -16, -20, -23
   -18, -14, -12,  -8,  -8, -12, -14, -18
   -16,  -8,   0,   8,   8,   0,  -8, -16
    -8,   0,  12,  16,  16,  12,   0,  -8
     4,  12,  16,  23,  23,  16,  12,   4
    16,  23,  27,  31,  31,  27,  23,  16
     4,  12,  16,  23,  23,  16,  12,   4
     2,   8,  12,  12,  12,  12,   8,   2
};

const int pstKingMg[64] = 
{ 
    40,  50,  30,  10,  10,  30,  50,  40
    30,  40,  20,   0,   0,  20,  40,  30
    10,  20,   0, -20, -20,   0,  20,  10
     0,  10, -10, -30, -30, -10,  10,   0
   -10,   0, -20, -40, -40, -20,   0, -10
   -20, -10, -30, -50, -50, -30, -10, -20
   -30, -20, -40, -60, -60, -40, -20, -30
   -40, -30, -50, -70, -70, -50, -30, -40 
}; 

const int pstKingEg[64] = 
{ 
   -34, -30, -28, -27, -27, -28, -30, -34
   -17, -13, -11, -10, -10, -11, -13, -17
    -2,   2,   4,   5,   5,   4,   2,  -2
    11,  15,  17,  18,  18,  17,  15,  11
    22,  26,  28,  29,  29,  28,  26,  22
    31,  34,  37,  38,  38,  37,  34,  31
    38,  41,  44,  45,  45,  44,  41,  38
    42,  46,  48,  50,  50,  48,  46,  42
};
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: Piece/square table challenge

Post by Greg Strong »

Awesome. Thanks for doing this! Below is my submission...

Code: Select all


#define PAWN_VAL 100
#define KNIGHT_VAL 325
#define BISHOP_VAL 325
#define ROOK_VAL 500
#define ROOK_VAL 900 

const int pstPawnMg[64] =
{
//A1                                        H1 
 -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,
 -20,  -20,  -28,  -40,  -40,  -28,  -20,  -20,
   0,   -5,  -16,  -14,  -14,  -16,   -5,    0,
   0,    0,    9,   21,   21,    9,    0,    0,
  25,   25,   34,   44,   44,   34,   25,   25,
  50,   50,   55,   55,   55,   55,   50,   50,
  75,   75,   75,   75,   75,   75,   75,   75,
 100,  100,  100,  100,  100,  100,  100,  100
//A8                                        H8
}; 
 
const int pstPawnEg[64] =
{ 
 -70,  -70,  -70,  -70,  -70,  -70,  -70,  -70,
 -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
   0,    0,    7,    8,    8,    7,    0,    0,
  35,   35,   42,   48,   48,   42,   35,   35,
  70,   70,   77,   82,   82,   77,   70,   70,
 105,  105,  110,  110,  110,  110,  105,  105,
 140,  140,  140,  140,  140,  140,  140,  140,
 175,  175,  175,  175,  175,  175,  175,  175
};

const int pstKnightMg[64] =
{ 
 -45,  -41,  -41,  -37,  -37,  -41,  -41,  -45,
 -31,  -27,  -25,  -21,  -21,  -25,  -27,  -31,
 -21,  -15,   -4,   -2,   -2,   -4,  -15,  -21,
  -7,   -1,    8,   22,   22,    8,   -1,   -7,
   3,    9,   18,   32,   32,   18,    9,    3,
   9,   15,   26,   28,   28,   26,   15,    9,
  19,   23,   25,   29,   29,   25,   23,   19,
  25,   29,   29,   33,   33,   29,   29,   25
};

const int pstKnightEg[64] =
{ 
 -45,  -43,  -43,  -41,  -41,  -43,  -43,  -45,
 -33,  -31,  -30,  -28,  -28,  -30,  -31,  -33,
 -23,  -20,  -14,  -13,  -13,  -14,  -20,  -23,
 -11,   -8,   -3,    3,    3,   -3,   -8,  -11,
  -1,    2,    7,   13,   13,    7,    2,   -1,
   7,   10,   16,   17,   17,   16,   10,    7,
  17,   19,   20,   22,   22,   20,   19,   17,
  25,   27,   27,   29,   29,   27,   27,   25
};

const int pstBishopMg[64] = 
{ 
 -25,  -31,  -37,  -41,  -41,  -37,  -31,  -25,
 -21,  -15,  -21,  -23,  -23,  -21,  -15,  -21,
 -17,  -11,   -4,   -6,   -6,   -4,  -11,  -17,
 -11,   -3,    4,   22,   22,    4,   -3,  -11,
  -1,    7,   14,   32,   32,   14,    7,   -1,
  13,   19,   26,   24,   24,   26,   19,   13,
  29,   35,   29,   27,   27,   29,   35,   29,
  45,   39,   33,   29,   29,   33,   39,   45
};

const int pstBishopEg[64] = 
{ 
 -15,  -18,  -21,  -23,  -23,  -21,  -18,  -15,
  -8,   -5,   -8,   -9,   -9,   -8,   -5,   -8,
  -1,    2,    8,    7,    7,    8,    2,   -1,
   7,   11,   17,   26,   26,   17,   11,    7,
  17,   21,   27,   36,   36,   27,   21,   17,
  29,   32,   38,   37,   37,   38,   32,   29,
  42,   45,   42,   41,   41,   42,   45,   42,
  55,   52,   49,   47,   47,   49,   52,   55
};

const int pstRookMg[64] = 
{ 
   0,    8,   12,   20,   20,   12,    8,    0,
   0,    8,   12,   20,   20,   12,    8,    0,
   0,    8,   12,   20,   20,   12,    8,    0,
   0,    8,   12,   20,   20,   12,    8,    0,
   0,    8,   12,   20,   20,   12,    8,    0,
   0,    8,   12,   20,   20,   12,    8,    0,
   6,   14,   22,   30,   30,   22,   14,    6,
   0,    8,   12,   20,   20,   12,    8,    0
};

const int pstRookEg[64] = 
{ 
  50,   50,   50,   50,   50,   50,   50,   50,
  50,   50,   50,   50,   50,   50,   50,   50,
  50,   50,   50,   50,   50,   50,   50,   50,
  50,   50,   50,   50,   50,   50,   50,   50,
  50,   50,   50,   50,   50,   50,   50,   50,
  50,   50,   50,   50,   50,   50,   50,   50,
  50,   50,   50,   50,   50,   50,   50,   50,
  50,   50,   50,   50,   50,   50,   50,   50
};

const int pstQueenMg[64] = 
{ 
 -25,  -31,  -21,  -21,  -21,  -21,  -31,  -25,
 -21,  -15,   -5,   -3,   -3,   -5,  -15,  -21,
  -1,    5,   20,   22,   22,   20,    5,   -1,
   9,   17,   32,   50,   50,   32,   17,    9,
  19,   27,   42,   60,   60,   42,   27,   19,
  29,   35,   50,   52,   52,   50,   35,   29,
  29,   35,   45,   47,   47,   45,   35,   29,
  45,   39,   49,   49,   49,   49,   39,   45
};

const int pstQueenEg[64] = 
{ 
  75,   69,   79,   79,   79,   79,   69,   75,
  79,   85,   75,   97,   97,   75,   85,   79,
  99,  105,  120,  122,  122,  120,  105,   99,
 109,  117,  132,  150,  150,  132,  117,  109,
 119,  127,  142,  160,  160,  142,  127,  119,
 129,  135,  150,  152,  152,  150,  135,  129,
 129,  135,  145,  147,  147,  145,  135,  129,
 145,  139,  149,  149,  149,  149,  139,  145
};

const int pstKingMg[64] = 
{
  15,   35,   10,    0,    0,   10,   35,   15,
  25,   15,    5,    5,    5,    5,   15,   25,
 -25,  -25,  -25,  -25,  -25,  -25,  -25,  -25,
 -55,  -55,  -55,  -55,  -55,  -55,  -55,  -55,
 -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,
-115, -115, -115, -115, -115, -115, -115, -115,
-145, -145, -145, -145, -145, -145, -145, -145,
-175, -175, -175, -175, -175, -175, -175, -175
};

const int pstKingEg[64] = 
{
 -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,
 -33,  -31,  -29,  -27,  -27,  -29,  -31,  -33,
 -25,  -21,   -3,    2,    2,   -3,  -21,  -25,
 -17,  -11,   10,   22,   22,   10,  -11,  -17,
  -9,   -3,   18,   30,   30,   18,   -3,   -9,
  -1,    3,   21,   26,   26,   21,    3,   -1,
   7,    9,   11,   13,   13,   11,    9,    7,
  15,   15,   15,   15,   15,   15,   15,   15
};
[/code]
lucasart
Posts: 3241
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Piece/square table challenge

Post by lucasart »

PK wrote: tables proposed by Lucas scored 42,5% against original template.
Are you sure you reversed them all? They are all file-symmetric, but many of them are not rank-symmetric. I am not surprised that they are sub-optimal here, as they were tuned in the presence of many other eval terms in DiscoCheck, never stand-alone. But that they score so badly surprises me a bit. Here is my template in correct RANK_1 -> RANK_8 ordering:

Code: Select all

#define PAWN_VAL 100
#define KNIGHT_VAL 330
#define BISHOP_VAL 330
#define ROOK_VAL 540
#define QUEEN_VAL 1000 

const int pstPawnMg[64] = {
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,9,9,0,0,0,
	0,0,0,18,18,0,0,0,
	0,0,0,9,9,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0
};

const int pstPawnEg[64] = {
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0
};

const int pstKnightMg[64] = {
	-60,-40,-30,-20,-20,-30,-40,-60,
	-40,-20,-10,0,0,-10,-20,-40,
	-30,-10,0,10,10,0,-10,-30,
	-20,0,10,20,20,10,0,-20,
	-20,0,10,20,20,10,0,-20,
	-30,-10,0,10,10,0,-10,-30,
	-40,-20,-10,0,0,-10,-20,-40,
	-60,-40,-30,-20,-20,-30,-40,-60
};

const int pstKnightEg[64] = {
	-18,-12,-9,-6,-6,-9,-12,-18,
	-12,-6,-3,0,0,-3,-6,-12,
	-9,-3,0,3,3,0,-3,-9,
	-6,0,3,6,6,3,0,-6,
	-6,0,3,6,6,3,0,-6,
	-9,-3,0,3,3,0,-3,-9,
	-12,-6,-3,0,0,-3,-6,-12,
	-18,-12,-9,-6,-6,-9,-12,-18
};

const int pstBishopMg[64] = {
	-18,-18,-16,-14,-14,-16,-18,-18,
	-8,0,-2,0,0,-2,0,-8,
	-6,-2,4,2,2,4,-2,-6,
	-4,0,2,8,8,2,0,-4,
	-4,0,2,8,8,2,0,-4,
	-6,-2,4,2,2,4,-2,-6,
	-8,0,-2,0,0,-2,0,-8,
	-8,-8,-6,-4,-4,-6,-8,-8
};

const int pstBishopEg[64] = {
	-18,-12,-9,-6,-6,-9,-12,-18,
	-12,-6,-3,0,0,-3,-6,-12,
	-9,-3,0,3,3,0,-3,-9,
	-6,0,3,6,6,3,0,-6,
	-6,0,3,6,6,3,0,-6,
	-9,-3,0,3,3,0,-3,-9,
	-12,-6,-3,0,0,-3,-6,-12,
	-18,-12,-9,-6,-6,-9,-12,-18
};

const int pstRookMg[64] = {
	-9,-3,0,3,3,0,-3,-9,
	-9,-3,0,3,3,0,-3,-9,
	-9,-3,0,3,3,0,-3,-9,
	-9,-3,0,3,3,0,-3,-9,
	-9,-3,0,3,3,0,-3,-9,
	-9,-3,0,3,3,0,-3,-9,
	-1,5,8,11,11,8,5,-1,
	-9,-3,0,3,3,0,-3,-9
};

const int pstRookEg[64] = {
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	8,8,8,8,8,8,8,8,
	0,0,0,0,0,0,0,0
};

const int pstQueenMg[64] = {
	-5,-5,-5,-5,-5,-5,-5,-5,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0,
	0,0,0,0,0,0,0,0
};

const int pstQueenEg[64] = {
	-24,-16,-12,-8,-8,-12,-16,-24,
	-16,-8,-4,0,0,-4,-8,-16,
	-12,-4,0,4,4,0,-4,-12,
	-8,0,4,8,8,4,0,-8,
	-8,0,4,8,8,4,0,-8,
	-12,-4,0,4,4,0,-4,-12,
	-16,-8,-4,0,0,-4,-8,-16,
	-24,-16,-12,-8,-8,-12,-16,-24
};

const int pstKingMg[64] = {
	37,47,27,7,7,27,47,37,
	30,40,20,0,0,20,40,30,
	16,26,6,-14,-14,6,26,16,
	9,19,-1,-21,-21,-1,19,9,
	2,12,-8,-28,-28,-8,12,2,
	-5,5,-15,-35,-35,-15,5,-5,
	-12,-2,-22,-42,-42,-22,-2,-12,
	-19,-9,-29,-49,-49,-29,-9,-19
};

const int pstKingEg[64] = {
	-84,-56,-42,-28,-28,-42,-56,-84,
	-56,-28,-14,0,0,-14,-28,-56,
	-42,-14,0,14,14,0,-14,-42,
	-28,0,14,28,28,14,0,-28,
	-28,0,14,28,28,14,0,-28,
	-42,-14,0,14,14,0,-14,-42,
	-56,-28,-14,0,0,-14,-28,-56,
	-84,-56,-42,-28,-28,-42,-56,-84
};
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.