2

I'm reading the specifications of UCI protocol but unfortunately I can't find a decent explanation of some of its commands or use-cases.

1) I don't understand what ucinewgame is meant for. By the documentation, it "starts a new game" but what exactly does it mean if UCI engine is stateless and therefore it shouldn't matter if there was new game or not?

2) What is better for playing with client, send to engine "position startpos moves ..." every time adding one more move (i.e. keeping record of all moves from the start) or "position <fenstring>" which only reflects the current position? I understand the second case is way more compact but are there any benefits from keeping all the previous moves?

3) If I want to have several players that simultaneously play against the engine (each their own game), do I need to have an instance of engine for each of them? I understand that while the engine is busy with one player, it cannot process moves for another player, but other than that, I see no problem here, do I just need to send position from one chosen player when the engine is ready, and temporarily block the other players? Then again, does ucinewgame have something to do here?

Andrei Nikolaenko
  • 1,022
  • 1
  • 7
  • 13

2 Answers2

1

OK, by the source code the ucinewgame seems to do just one thing - it clears the training data.

Andrei Nikolaenko
  • 1,022
  • 1
  • 7
  • 13
1

Kinda late, so I don't know if this will help you, but I had the same questions, and after some thinking, position startpos moves ... is preferable.

This is because a FEN string doesn't contain information about previous states of the game, so thus the engine won't know when a draw by repetition would occur. And if the game isn't starting from the initial position, position fen ... moves ... should be used. Again so the engine will know about repetition draws.

If you are feeling fancy, you could only send the moves since the last pawn push, piece capture or castle since the rest of the moves are useless,and keeping a reasonably compact string has numerous minor practical and performance advantages.

Mushroom idiot
  • 39
  • 3
  • 10