So called backward analysis

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

So called backward analysis

Post by xr_a_y »

Trying to make Minic for user friendly I will focus on feature for some time :
- pondering
- analysis
- level
- syzygy TB
- style

I'm now confronted to analysis mode. Using xboard protocol, what are the involved command to allow the user to make backward analysis ? Is it UNDO and REMOVE ? If so, is the engine suppose to remember played moves to implement them ?
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: So called backward analysis

Post by hgm »

Indeed, the engine will have to remember the moves and start FEN (which might be received from a 'setboard'. What I usually do on reception of an 'undo' is set up the board from that FEN, and replay all the moves minus one (or two, for 'remove').
D Sceviour
Posts: 570
Joined: Mon Jul 20, 2015 5:06 pm

Re: So called backward analysis

Post by D Sceviour »

The usual Winboard command for taking back a move is "undo". The "remove" command is documented for xboard protocol but I was never able to find an occurance of it ever sent by Winboard. Instead, an undocumented "back [n]" command may be sent by Winboard, Arena or other GUI. Winboard will remember the moves in an internal pgn buffer, but you should at least track the current move number.

Set up Schooner in debug mode and analyze back and forth a few moves. The debug code will show you all the commands your engine should expect to receive and respond to in Winboard. Also, try debugging with different GUI's to test the continuity for analyzing.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: So called backward analysis

Post by xr_a_y »

hgm wrote: Tue Jul 23, 2019 2:55 pm Indeed, the engine will have to remember the moves and start FEN (which might be received from a 'setboard'. What I usually do on reception of an 'undo' is set up the board from that FEN, and replay all the moves minus one (or two, for 'remove').
Ok thanks, even that BACK [n] command shall be treated this way. I'll implement that soon.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: So called backward analysis

Post by hgm »

I have never seen a BACK [n] command. The 'remove' command is sent by WinBoard/XBoard when you exercise the Engine -> Retract Move menu item. I guess GNU Chess supported it in addition to 'undo', because when the engine is playing white or black, and you take back only a single ply, the engine will be on move again, and re-make the play before you can undo a second one. So then you would have to switch to force mode first, before you can undo, and then set the engine playing again. This is of course no problem if a GUI controls the engine, but GNU Chess was designed for typing the commands by hand...

Typically people want to retract because they blundered, and only realize it when they see the engine's refutation of their move. Then they want to take back bot the engine's move and their own, to play an alternative to the latter for continuing the game.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: So called backward analysis

Post by xr_a_y »

ok, thanks again.