Answers.Body: <p>This is a very common data-structure in chess engine - Piece-Square-Tables.</p>
  
  <p>Refer to 
  <a href="https://chessprogramming.wikispaces.com/Piece-Square+Tables" rel="nofollow">https://chessprogramming.wikispaces.com/Piece-Square+Tables</a> for more details.</p>
  
  <p>Basically, it gives a score for a piece on a particular score and it's almost always symmetry (white and black have the same score but flipped).</p>
  
  <p>For example, if I modified the score for knight in the table on d4 to positive infinity. The engine will believe placing a knight is very important, it'll sacrifice it's queen, rooks, bishops just to permanently position a knight on the d4 square.</p>
  
  <p>The values are usually determined by trials-and-errors. Stronger engines such as Stockfish learn the values by playing hundreds or thousands of games, this is known as parameter calibration or automatic tuning.</p>
  
  <p>Refer to <a href="https://chessprogramming.wikispaces.com/Automated+Tuning" rel="nofollow">https://chessprogramming.wikispaces.com/Automated+Tuning</a> for more details.</p>
  
  <p>CLOP and Texel are two common tuning methods.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-28T06:03:51.523Z
Answers.LastActivityDate: 2015-03-28T06:03:51.523Z
Answers.UserDisplayName: SmallChess
Body: <p>Looking into a source code of a <a href="http://www.ltn.lv/~gv/BlenderChess/c0_python_chess.py" rel="nofollow">chess engine</a>, I noticed matrices that represent position of some pieces.</p>
  
  <pre><code>knightPos = [
     -200, -100, -50, -50, -50, -50, -100, -200,
     -100, 0, 0, 0, 0, 0, 0, -100,
     -50, 0, 60, 60, 60, 60, 0, -50,
     -50, 0, 30, 60, 60, 30, 0, -50,
     -50, 0, 30, 60, 60, 30, 0, -50,
     -50, 0, 30, 30, 30, 30, 0, -50,
     -100, 0, 0, 0, 0, 0, 0, -100,
     -200, -50, -25, -25, -25, -25, -50, -200
  ]
  </code></pre>
  
  <p>There are more matrices like this there (also I found the same matrices in other chess engine). It looks like they decode the quality of the piece based on it's position.</p>
  
  <p>Is there any place, where I can read about it, how it is used and how people came up with these numbers?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-03-28T00:32:11.317Z
Comments.Text: Your guess is correct; the engine is trying to give an evaluation bonus for knights that are centralized (especially ones in the opponent's half of the board, restricting his movement) and penalizing ones on the sides ("a knight on the rim is dim"). This numbers are usually just arrived at heuristically.
Comments.UserDisplayName: dfan
Tags: <engines><evaluation>
Title: Matrix representation of piece position for a chess engine
ThreadText: # Matrix representation of piece position for a chess engine
  
  (Asked by: username_0 on 2015-03-28)
  
  Looking into a source code of a chess engine, I noticed matrices that represent position of some pieces.
  knightPos = [
     -200, -100, -50, -50, -50, -50, -100, -200,
     -100, 0, 0, 0, 0, 0, 0, -100,
     -50, 0, 60, 60, 60, 60, 0, -50,
     -50, 0, 30, 60, 60, 30, 0, -50,
     -50, 0, 30, 60, 60, 30, 0, -50,
     -50, 0, 30, 30, 30, 30, 0, -50,
     -100, 0, 0, 0, 0, 0, 0, -100,
     -200, -50, -25, -25, -25, -25, -50, -200
  ]
  
  There are more matrices like this there (also I found the same matrices in other chess engine). It looks like they decode the quality of the piece based on it's position.
  Is there any place, where I can read about it, how it is used and how people came up with these numbers?
  
  **Tags:** engines, evaluation
  
  > **Comments:**
  > **username_1**: Your guess is correct; the engine is trying to give an evaluation bonus for knights that are centralized (especially ones in the opponent's half of the board, restricting his movement) and penalizing ones on the sides ("a knight on the rim is dim"). This numbers are usually just arrived at heuristically.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-03-28. Score: 1
  
  This is a very common data-structure in chess engine - Piece-Square-Tables.
  
  Refer to
  <https://chessprogramming.wikispaces.com/Piece-Square+Tables> for more details.
  
  Basically, it gives a score for a piece on a particular score and it's almost always symmetry (white and black have the same score but flipped).
  
  For example, if I modified the score for knight in the table on d4 to positive infinity. The engine will believe placing a knight is very important, it'll sacrifice it's queen, rooks, bishops just to permanently position a knight on the d4 square.
  
  The values are usually determined by trials-and-errors. Stronger engines such as Stockfish learn the values by playing hundreds or thousands of games, this is known as parameter calibration or automatic tuning.
  
  Refer to <https://chessprogramming.wikispaces.com/Automated+Tuning> for more details.
  
  CLOP and Texel are two common tuning methods.
  
  
  ---
  
  