Page 1 of 2

How to use openings books?

Posted: Mon Jul 25, 2016 8:36 pm
by Luis Babboni
Thats!

My engine Soberango never uses opening book and seems this is the reason sometimes crash if the settings obligate the engine to use it.

I look for it in http://hgm.nubati.net/CECP.html where are the xBoard commands and couldn´t find about it.
Well, I found this but or I do not understand it or is not what I looking for:

"bk
[advanced] Invites the engine to send a number of text lines starting with a Space or Tab character to the GUI, terminated by an empty line, for display as a table to the user. Intended for book or tablebase moves the engine has available in the current position."


Any hint?

Thanks!

Re: How to use books?

Posted: Mon Jul 25, 2016 8:45 pm
by Dann Corbit
If your engine can start a game from a future position, it should work with a book.

Can you run games starting from something like this:


[Event "1. hxg6!!"]
[Site "?"]
[Date "2010.10.28"]
[Round "?"]
[White "Euxinus Pontus no.13, Bxg6"]
[Black "?"]
[Result "*"]
[SetUp "1"]
[FEN "7q/b1p5/1p1Npkb1/pPP2ppP/P1P5/3B2P1/5P1R/K3R3 w - - 0 1"]
[PlyCount "43"]
[EventDate "2010.??.??"]

*

Re: How to use books?

Posted: Mon Jul 25, 2016 8:58 pm
by Luis Babboni
Thanks Dann!

No, just from the begining!

But is able to read a FEN, what do the subroutine I did to comunicate Soberango with the GUI is this:

Code: Select all

If DiceGUI="new" Then
  	Reseteo
  	FEN="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"		
  	CargaFEN(FEN)
EndIf
Where:
-DiceGUI is the command sent by the GUI.
-Reseteo clean the board and restore all variables.
-CargaFEN() read the FEN and set the apropiate variables.

Sorry, not sure if my question is correct:
After wich command instead of "new" must the engine read the FEN?

Re: How to use openings books?

Posted: Mon Jul 25, 2016 9:02 pm
by hgm
When using a GUI book the engine gets the bookbmoves sent to it by the GUI in 'force' mode. I.e. irrespective of whether the engine is going to play black or whiteit will be sent a 'force' command to make it play neither side, and then a number of moves will be sent to it as long as the game stays in book. Once you run out of book, and it is the engine's turn, it will receive a 'go' command to set it thinking.

Re: How to use openings books?

Posted: Mon Jul 25, 2016 9:04 pm
by Luis Babboni
hgm wrote:When using a GUI book the engine gets the bookbmoves sent to it by the GUI in 'force' mode. I.e. irrespective of whether the engine is going to play black or whiteit will be sent a 'force' command to make it play neither side, and then a number of moves will be sent to it as long as the game stays in book. Once you run out of book, and it is the engine's turn, it will receive a 'go' command to set it thinking.
That means is not the engine who choice between differents options the book have? Is the GUI who selected the path by the book? :shock:

Re: How to use openings books?

Posted: Mon Jul 25, 2016 9:17 pm
by hgm
Indeed. That is how a GUI book works. The GUI selects an opening line from the book, and feeds it to the engines before setting them playing.

If you want the engine be in control of what book moves it selects, it should handle a book itself. This would be something the GUI is notinvolved in, and knows nothing about. The engine is free to decide what method it uses to find a move, when its turn comes up. It can use search and evaluation,or it could just read the move from a file.

Re: How to use openings books?

Posted: Mon Jul 25, 2016 9:44 pm
by Luis Babboni
hgm wrote: ...
If you want the engine be in control of what book moves it selects, it should handle a book itself. This would be something the GUI is notinvolved in, and knows nothing about. The engine is free to decide what method it uses to find a move, when its turn comes up. It can use search and evaluation,or it could just read the move from a file.
That´s how I guessed all engines works, but today Soberango was start tested to be add to CCRL 40/4 Rank and crashes because is not able to start a game after some moves made by Arena GUI using its openings book

That´s why I start thinking in add the ability to use openings book that I was planed for future after quiescence search, hashtables and tablebases and mostly after improving the evaluation cause actually just count material and then has no sense the choice of one or other move in opening if no implies material difference.

Re: How to use openings books?

Posted: Mon Jul 25, 2016 10:04 pm
by Luis Babboni
After the GUI ends to read the opening book, it will send to the engine a FEN with the position reached or the engine must actualize its variables after each move made by the GUI from its book while in force mode?

Re: How to use openings books?

Posted: Mon Jul 25, 2016 10:05 pm
by cdani
Luis Babboni wrote:
That´s how I guessed all engines works, but today Soberango was start tested to be add to CCRL 40/4 Rank and crashes because is not able to start a game after some moves made by Arena GUI using its openings book
If your engine is uci and supports the uci command
position startpos moves e2e4 e7e5
it should work.

Re: How to use openings books?

Posted: Mon Jul 25, 2016 10:16 pm
by Luis Babboni
cdani wrote:
Luis Babboni wrote:
That´s how I guessed all engines works, but today Soberango was start tested to be add to CCRL 40/4 Rank and crashes because is not able to start a game after some moves made by Arena GUI using its openings book
If your engine is uci and supports the uci command
position startpos moves e2e4 e7e5
it should work.
Thanks Daniel!
Soberango uses xBoard*
But anyway I´m not understand your suggestion.
You mean that read GUI information gives to the engine while move using its book and transform it to this to set the apropiate position in the engine board?

*: when I say that uses xBoard, is not that I take the pseudocode showed in http://hgm.nubati.net/CECP.html and use it to write a complete xboard interfase in FreeBasic. The communication Soberango have with GUI is just using the minimum commands I saw I need to run it and all other are simply ignored.