1

I'm working on a chess UI and am trying to implement a game analysis feature by calling UCI engines. For showing analysis of a specific position two things are needed:

  1. get the cp value for the move actually played in a particular position
  2. get the next best n moves with their cp score

I was wondering if it can me done in one command. To my understanding this would take two calls to the engine (after setting the position -- let's say this is startpos now, and white started the analyzed game with a2a4) :

  1. go depth 20 searchmoves a2a4 - to get the value for the actual move
  2. go depth 20 - to get the actual best move(s) with cp value

I was hoping that if I setoption name MultiPv value 4 and after that call go with providing a single searchmoves X it would return the cp value for X and the next 3 moves. That doesn't happen though (with Stockfish at least) but searchvalue restricts the search to the move list provided, even if it is only 1 move -- so I only get the value for that move.

Is it possible to get both 1/ and 2/ in one UCI call per design?

parszab
  • 149
  • 7
  • 1
    Just set a max multipv equal to the number of legal moves. Then call engine to search and rank all moves. You will get the top x moves you want and at the same time you will get the score of the specific move you want. Besides you also get the rank of that specific move. – ferdy Mar 02 '23 at 08:52
  • This is only true if that move that was taken is part of the top x moves, isn't it? – parszab Mar 02 '23 at 17:15
  • Sorry I don't understand your question. – ferdy Mar 03 '23 at 00:04

0 Answers0