Answers.Body: <blockquote>
  <p>Is this really how it works?</p>
  </blockquote>
  <p>Yes and no. An evaluation function based on pure material advantage is a perfectly legal function. It's certainly better than nothing. However, it's too simple in practice.</p>
  <p>The state-of-the-art methods involve neural network. Google &quot;Stockfish NNUE&quot; for details.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-30T12:25:42.357Z
Answers.LastActivityDate: 2021-01-30T12:25:42.357Z
Answers.UserDisplayName: SmallChess
Answers.Body: <p>The function you are showing (from this <a href="https://www.chessprogramming.org/index.php?title=Evaluation&amp;mobileaction=toggle_view_mobile" rel="nofollow noreferrer">website</a>) only calculates the score of a position based on how many pieces are on the board. It does not take into account where the pieces are located. So wK, bK, wQ, bQ, etc. are simply the number of the specific pieces that are on the board. The weights rank the pieces according to their importance.</p>
  <p>So for example if white has 8 pawns and black has 6 pawns, the last term of the score would be <code>pawnWt * (wP-bP) = 1 * (8-6) = 2</code>. (assuming the value of a pawn to be 1) That leads to a relative advantage for white only based on pawns, but according to how many of the other pieces are on the board, black might still have an advantage.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-28T04:16:22.587Z
Answers.LastActivityDate: 2021-01-28T04:16:22.587Z
Answers.UserDisplayName: Mafu
Body: <p>I'm trying to improve my evaluation and I saw this <a href="https://www.chessprogramming.org/index.php?title=Evaluation&amp;mobileaction=toggle_view_mobile" rel="nofollow noreferrer">here</a></p>
  <pre><code>materialScore = kingWt  * (wK-bK)
                + queenWt * (wQ-bQ)
                + rookWt  * (wR-bR)
                + knightWt* (wN-bN)
                + bishopWt* (wB-bB)
                + pawnWt  * (wP-bP)
  </code></pre>
  <p>How do I get the value, let's say <code>wK</code>? Do I get the position of the king and score it relative to the board? For example, <code>wK</code> is more safe than the <code>bK</code>, so let's say <code>wK - bK = 1 - 0.5</code>. So, the result will be <code>90 * (0.5)</code>. Is this really how it works?</p>
  
Tags: <game-ai><minimax><chess><evaluation-functions><negamax>
Title: What is the meaning of the terms in this evaluation function for chess?
UserDisplayName: James Urian
ThreadText: # What is the meaning of the terms in this evaluation function for chess?
  
  (Asked by: username_0 on 2021-01-28)
  
  I'm trying to improve my evaluation and I saw this here
  materialScore = kingWt  * (wK-bK)
                + queenWt * (wQ-bQ)
                + rookWt  * (wR-bR)
                + knightWt* (wN-bN)
                + bishopWt* (wB-bB)
                + pawnWt  * (wP-bP)
  
  How do I get the value, let's say wK? Do I get the position of the king and score it relative to the board? For example, wK is more safe than the bK, so let's say wK - bK = 1 - 0.5. So, the result will be 90 * (0.5). Is this really how it works?
  
  **Tags:** game-ai, minimax, chess, evaluation-functions, negamax
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2021-01-30. Score: 0 | Accepted answer
  
  > Is this really how it works?
  
  Yes and no. An evaluation function based on pure material advantage is a perfectly legal function. It's certainly better than nothing. However, it's too simple in practice.
  
  The state-of-the-art methods involve neural network. Google "Stockfish NNUE" for details.
  
  
  ---
  
  ### Answer by username_2 on 2021-01-28. Score: 0
  
  The function you are showing (from this [website](https://www.chessprogramming.org/index.php?title=Evaluation&mobileaction=toggle_view_mobile)) only calculates the score of a position based on how many pieces are on the board. It does not take into account where the pieces are located. So wK, bK, wQ, bQ, etc. are simply the number of the specific pieces that are on the board. The weights rank the pieces according to their importance.
  
  So for example if white has 8 pawns and black has 6 pawns, the last term of the score would be `pawnWt * (wP-bP) = 1 * (8-6) = 2`. (assuming the value of a pawn to be 1) That leads to a relative advantage for white only based on pawns, but according to how many of the other pieces are on the board, black might still have an advantage.
  
  
  ---
  
  