UCI: Console Play Mode?
Moderators: hgm, Rebel, chrisw
-
- Posts: 13447
- Joined: Wed Mar 08, 2006 9:02 pm
- Location: Dallas, Texas
- Full name: Matthew Hull
UCI: Console Play Mode?
How do you play a UCI chess program in console mode where you play against the program, entering moves and observe its thinking/pondering at the same time? It was not clear to me how this is done from just reading the UCI protocol definition.
Matthew Hull
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: UCI: Console Play Mode?
Type
Then repeat the 'position' and 'go' line for every move you want to make, but with the entire game so far after 'moves', and the actual clock times left. E.g. if the engine replied (after thinking output) with "bestmove e7e5", for your next move you would type:
to play Ng3, etc.
Code: Select all
uci
setoption name Hash value 256
isready
ucinewgame
position startpos moves e2e4
go wtime 300000 btime 300000 movestogo 40
Code: Select all
position startpos moves e2e4 e7e5 g1f3
go wtime 290000 btime 295000 movestogo 39
-
- Posts: 13447
- Joined: Wed Mar 08, 2006 9:02 pm
- Location: Dallas, Texas
- Full name: Matthew Hull
Re: UCI: Console Play Mode?
Thanks, HG. That looks a bit ponderous for playing a full game from the console. My target machine will only support a console but it may have networking (if I can get a driver running). I guess I'd better use a GUI over the network (assuming that's possible) or write a front-end to make console play more practical.hgm wrote:Type
Then repeat the 'position' and 'go' line for every move you want to make, but with the entire game so far after 'moves', and the actual clock times left. E.g. if the engine replied (after thinking output) with "bestmove e7e5", for your next move you would type:Code: Select all
uci setoption name Hash value 256 isready ucinewgame position startpos moves e2e4 go wtime 300000 btime 300000 movestogo 40
to play Ng3, etc.Code: Select all
position startpos moves e2e4 e7e5 g1f3 go wtime 290000 btime 295000 movestogo 39
Matthew Hull
-
- Posts: 1203
- Joined: Thu May 10, 2007 2:49 pm
Re: UCI: Console Play Mode?
You could use an uci to winboard adapter and run it with the winboard commands.mhull wrote:Thanks, HG. That looks a bit ponderous for playing a full game from the console. My target machine will only support a console but it may have networking (if I can get a driver running). I guess I'd better use a GUI over the network (assuming that's possible) or write a front-end to make console play more practical.hgm wrote:Type
Then repeat the 'position' and 'go' line for every move you want to make, but with the entire game so far after 'moves', and the actual clock times left. E.g. if the engine replied (after thinking output) with "bestmove e7e5", for your next move you would type:Code: Select all
uci setoption name Hash value 256 isready ucinewgame position startpos moves e2e4 go wtime 300000 btime 300000 movestogo 40
to play Ng3, etc.Code: Select all
position startpos moves e2e4 e7e5 g1f3 go wtime 290000 btime 295000 movestogo 39
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: UCI: Console Play Mode?
When you can recall the previous lines with an arrow key it is doable; you just add the latest two moves to the recalled position line. And whe you don't care too much about the time usage, you can leave the 'go' line the same always.
-
- Posts: 13447
- Joined: Wed Mar 08, 2006 9:02 pm
- Location: Dallas, Texas
- Full name: Matthew Hull
Re: UCI: Console Play Mode?
Ah, that makes sense. Thanks.hgm wrote:When you can recall the previous lines with an arrow key it is doable; you just add the latest two moves to the recalled position line. And whe you don't care too much about the time usage, you can leave the 'go' line the same always.
Matthew Hull
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: UCI: Console Play Mode?
I wanted to propose that, but then I realized that both Polyglot and UCI2WB support 'feature usermove=1', meaning they request the GUI/console user to prefix every input move with 'usermove ', which sort of spoils the fun.Alexander Schmidt wrote:You could use an uci to winboard adapter and run it with the winboard commands.
I just discovered that Polyglot also understands moves without the 'usermove ' prefix, however! So all that is needed is:
Run the command
Code: Select all
polyglot -noini -ec "ENGINE_COMMAND" -ed "ENGINE_DIRECTORY"
Code: Select all
new
level 0 5 0
e4
Code: Select all
Nf3
If you want to play black, instead of entering your first move, just enter "go".
The "0 5 0" in the 'level' command means 5-min, no increment.
-
- Posts: 13447
- Joined: Wed Mar 08, 2006 9:02 pm
- Location: Dallas, Texas
- Full name: Matthew Hull
Re: UCI: Console Play Mode?
This is a nice solution. How does polyglot enable pondering for a UCI program?hgm wrote:I wanted to propose that, but then I realized that both Polyglot and UCI2WB support 'feature usermove=1', meaning they request the GUI/console user to prefix every input move with 'usermove ', which sort of spoils the fun.Alexander Schmidt wrote:You could use an uci to winboard adapter and run it with the winboard commands.
I just discovered that Polyglot also understands moves without the 'usermove ' prefix, however! So all that is needed is:
Run the command
Then typeCode: Select all
polyglot -noini -ec "ENGINE_COMMAND" -ed "ENGINE_DIRECTORY"
The engine will reply "move e7e5", and you can then simply enter your own next move asCode: Select all
new level 0 5 0 e4
Polyglot does understand SAN.Code: Select all
Nf3
If you want to play black, instead of entering your first move, just enter "go".
The "0 5 0" in the 'level' command means 5-min, no increment.
Matthew Hull
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: UCI: Console Play Mode?
The command 'hard' switches it on, the command 'easy' switches it off. As long as it is switched on the engine will ponder while the opponent is on move (except in the start position).