Answers.Body: <p>Enable multipv on the engine. When you are at "e2e4 e7e5 d2d4" it will list all possible best moves that the engine considers in order of their evaluation. If you find "g7g6" in this list, then what you have considered is one of the best moves also considered by the engine and you'll obviously have the score associated with "g7g6". So, you will find this information before you make the move "g7g6".</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-25T08:00:56.270Z
Answers.LastActivityDate: 2014-08-25T08:00:56.270Z
Answers.UserDisplayName: Keshav
Answers.Body: <p>From a read-through of the UCI protocol (<a href="http://wbec-ridderkerk.nl/html/UCIProtocol.html" rel="nofollow">http://wbec-ridderkerk.nl/html/UCIProtocol.html</a>) I didn't find a single command to do exactly what you want. </p>
  
  <p>What it looks like you could do is start with the position before g7g6, get the cp score (-40 is, I think, a .4 advantage for black), play g7g6 and get the cp score in the subsequent position. You could then take the difference of the two and you have an evaluation of the move.</p>
  
  <p>Please let me know if this works/is what you are looking for. I haven't gotten into UCI implementation before but you've sparked my interest.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T16:30:24.867Z
Answers.Text: Sorry, his command is correct. startpos tells the engine to play all moves from the beginning of the position all the way and include the g7g6 move. The asker had an invalid engine or something went wrong in the analysis.
Answers.UserDisplayName: SmallChess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T16:39:04.340Z
Answers.Text: @student-t: The UCI communication is just an example, not what my engine actually gave me. sorry for the confusion.
Answers.UserDisplayName: Peter Petrelli
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T16:48:31.927Z
Answers.Text: @cleveland: So I'm not sure I understand your reasoning. Say I start with the position before g7g6, which is d2d4 and run the search, I'll get e5d4 as the best move which has a score of cp -10 (hypothetical). I then add the move g7g6 and then search on that and get d4e5 with a score +100. What you're suggesting is that the score for the move g7g6 is the difference 100 - -10 = +110. I don't really understand why that is? Please elaborate?
Answers.UserDisplayName: Peter Petrelli
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T17:50:33.643Z
Answers.Text: The +110 is from an absolute perspective, so it was a bad move for black. The move he made worsened his position by 1.1 pawns.
Answers.UserDisplayName: Cleveland
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T16:03:53.073Z
Answers.LastActivityDate: 2014-08-22T16:03:53.073Z
Answers.UserDisplayName: Cleveland
Answers.Body: <p>I think you've confused somewhat in the UCI. Your reported results is invalid. Either the engine has a bug or you've done something wrong. The command you give is correct but the bestmove it reports is invalid because it's white to move in the final position.</p>
  
  <p>When I did the same thing on Stockfish, I have the following. Please note that the first move in all PVs are white's move.</p>
  
  <pre><code>info depth 16 seldepth 24 score cp 103 upperbound nodes 2601011 nps 207169 time 12555 multipv 1 pv d4e5 f7f6 e5f6 g8f6 b1c3 f8b4 f1d3 d7d5 e4e5 d8e7 d1e2
  
  info depth 16 currmove d4e5 currmovenumber 1
  
  info depth 16 seldepth 26 score cp 131 lowerbound nodes 3046457 nps 207807 time 14660 multipv 1 pv d4e5 f7f6 e5f6 g8f6 g1f3 f6e4 f1c4 b8c6 e1g1 f8e7 b1c3 e4d6
  
  info depth 16 currmove d4e5 currmovenumber 1
  
  info depth 16 seldepth 26 score cp 131 nodes 3094910 nps 208061 time 14875 multipv 1 pv d4e5 f7f6 e5f6 g8f6 g1f3 f6e4 f1c4 b8c6 e1g1 f8e7 b1c3 e4d6
  info nodes 3094910 time 14875
  
  bestmove d4e5 ponder f7f6
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Your question is a bit unclear because you ask for the evaluation for the move g7-g6. But this evaluation term is extremely unclear. From your comments, you're actually referring to the how well the move g7-g6 is relative to other moves that you can make in the same position.</p>
  
  <p>If my interpretation is correct, your closest is multi-pv. Multi-pv lists the moves from best to worst. If g7-g6 is the second best move, you'll see the score and you can compare it with the score for the best move. I said it's closest because if your move is not one of the best moves, you'll find it hard to see in a multi-pv output.</p>
  
  <p>UCI protocol is designed for computer vs computer playing, not really designed for human analysis like you described in your scenario. If you really want to know about your move. You have to play the move, get the score of it. Take the move back and find the best move in the position.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T16:50:52.360Z
Answers.Text: Oops sorry about that, that was just an example (and a poor one at that), didn't really try it in the engine
Answers.UserDisplayName: Peter Petrelli
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T17:07:50.493Z
Answers.Text: Oh, so you're really talking about how well your g6-g7 move is relative to other alternatives!
Answers.UserDisplayName: SmallChess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T17:14:01.063Z
Answers.Text: See my edited answer.
Answers.UserDisplayName: SmallChess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T17:22:49.273Z
Answers.Text: Yes, how would i see how the engine scores my g6g7 move?
Answers.UserDisplayName: Peter Petrelli
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T17:25:17.540Z
Answers.Text: You say "You have to play the move, get the score of it. Take the move back and find the best move in the position." How exactly do i get the score of it?
Answers.UserDisplayName: Peter Petrelli
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T17:48:46.047Z
Answers.Text: Ooh, I think i've figured it out. I'd use go searchmoves g7g6. Thanks!
Answers.UserDisplayName: Peter Petrelli
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-23T00:17:41.543Z
Answers.Text: Please consider accepting the answer if you think it's useful.
Answers.UserDisplayName: SmallChess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-22T16:29:17.287Z
Answers.LastActivityDate: 2014-08-22T17:13:52.593Z
Answers.LastEditDate: 2014-08-22T17:13:52.593Z
Answers.UserDisplayName: SmallChess
Body: <p>I am looking for a way to analyse the moves I play. I'm NOT looking for a suggestion of a GUI that does this, or using Chessbase to do this. I want to know how to do this by communicating directly with the UCI engine.</p>
  
  <p>For example, when I tell the engine:</p>
  
  <p>position startpos moves e2e4 e7e5 d2d4  g7g6</p>
  
  <p>go depth 30</p>
  
  <p>it returns the best move in this position:</p>
  
  <p>info nodes 11295495 score cp -40</p>
  
  <p>bestmove f7f5 ponder g8f6</p>
  
  <p>But what I want is the evaluation of my latest move g7g6. How do i get that?</p>
  
Tags: <analysis><engines><evaluation><uci>
Title: How to evaluate my move with UCI engine?
ThreadText: # How to evaluate my move with UCI engine?
  
  (Asked by: username_0 on 2014-08-22)
  
  I am looking for a way to analyse the moves I play. I'm NOT looking for a suggestion of a GUI that does this, or using Chessbase to do this. I want to know how to do this by communicating directly with the UCI engine.
  
  For example, when I tell the engine:
  
  position startpos moves e2e4 e7e5 d2d4 g7g6
  
  go depth 30
  
  it returns the best move in this position:
  
  info nodes 11295495 score cp -40
  
  bestmove f7f5 ponder g8f6
  
  But what I want is the evaluation of my latest move g7g6. How do i get that?
  
  **Tags:** analysis, engines, evaluation, uci
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2014-08-25. Score: 2
  
  Enable multipv on the engine. When you are at "e2e4 e7e5 d2d4" it will list all possible best moves that the engine considers in order of their evaluation. If you find "g7g6" in this list, then what you have considered is one of the best moves also considered by the engine and you'll obviously have the score associated with "g7g6". So, you will find this information before you make the move "g7g6".
  
  
  ---
  
  ### Answer by username_2 on 2014-08-22. Score: 1
  
  From a read-through of the UCI protocol (<http://wbec-ridderkerk.nl/html/UCIProtocol.html>) I didn't find a single command to do exactly what you want.
  
  What it looks like you could do is start with the position before g7g6, get the cp score (-40 is, I think, a .4 advantage for black), play g7g6 and get the cp score in the subsequent position. You could then take the difference of the two and you have an evaluation of the move.
  
  Please let me know if this works/is what you are looking for. I haven't gotten into UCI implementation before but you've sparked my interest.
  
  > **Comments:**
  > **username_3**: Sorry, his command is correct. startpos tells the engine to play all moves from the beginning of the position all the way and include the g7g6 move. The asker had an invalid engine or something went wrong in the analysis.  
  > **username_0**: @student-t: The UCI communication is just an example, not what my engine actually gave me. sorry for the confusion.  
  > **username_0**: @username_2: So I'm not sure I understand your reasoning. Say I start with the position before g7g6, which is d2d4 and run the search, I'll get e5d4 as the best move which has a score of cp -10 (hypothetical). I then add the move g7g6 and then search on that and get d4e5 with a score +100. What you're suggesting is that the score for the move g7g6 is the difference 100 - -10 = +110. I don't really understand why that is? Please elaborate?  
  > **username_2**: The +110 is from an absolute perspective, so it was a bad move for black. The move he made worsened his position by 1.1 pawns.  
  
  ---
  
  ### Answer by username_3 on 2014-08-22. Score: -1
  
  I think you've confused somewhat in the UCI. Your reported results is invalid. Either the engine has a bug or you've done something wrong. The command you give is correct but the bestmove it reports is invalid because it's white to move in the final position.
  
  When I did the same thing on Stockfish, I have the following. Please note that the first move in all PVs are white's move.
  
  ```
  info depth 16 seldepth 24 score cp 103 upperbound nodes 2601011 nps 207169 time 12555 multipv 1 pv d4e5 f7f6 e5f6 g8f6 b1c3 f8b4 f1d3 d7d5 e4e5 d8e7 d1e2
  
  info depth 16 currmove d4e5 currmovenumber 1
  
  info depth 16 seldepth 26 score cp 131 lowerbound nodes 3046457 nps 207807 time 14660 multipv 1 pv d4e5 f7f6 e5f6 g8f6 g1f3 f6e4 f1c4 b8c6 e1g1 f8e7 b1c3 e4d6
  
  info depth 16 currmove d4e5 currmovenumber 1
  
  info depth 16 seldepth 26 score cp 131 nodes 3094910 nps 208061 time 14875 multipv 1 pv d4e5 f7f6 e5f6 g8f6 g1f3 f6e4 f1c4 b8c6 e1g1 f8e7 b1c3 e4d6
  info nodes 3094910 time 14875
  
  bestmove d4e5 ponder f7f6
  
  ```
  
  EDIT:
  
  Your question is a bit unclear because you ask for the evaluation for the move g7-g6. But this evaluation term is extremely unclear. From your comments, you're actually referring to the how well the move g7-g6 is relative to other moves that you can make in the same position.
  
  If my interpretation is correct, your closest is multi-pv. Multi-pv lists the moves from best to worst. If g7-g6 is the second best move, you'll see the score and you can compare it with the score for the best move. I said it's closest because if your move is not one of the best moves, you'll find it hard to see in a multi-pv output.
  
  UCI protocol is designed for computer vs computer playing, not really designed for human analysis like you described in your scenario. If you really want to know about your move. You have to play the move, get the score of it. Take the move back and find the best move in the position.
  
  > **Comments:**
  > **username_0**: Oops sorry about that, that was just an example (and a poor one at that), didn't really try it in the engine  
  > **username_3**: Oh, so you're really talking about how well your g6-g7 move is relative to other alternatives!  
  > **username_3**: See my edited answer.  
  > **username_0**: Yes, how would i see how the engine scores my g6g7 move?  
  > **username_0**: You say "You have to play the move, get the score of it. Take the move back and find the best move in the position." How exactly do i get the score of it?  
  > **username_0**: Ooh, I think i've figured it out. I'd use go searchmoves g7g6. Thanks!  
  > **username_3**: Please consider accepting the answer if you think it's useful.  
  
  ---
  
  