I never programmed for Xboard. If Arena decides the moves sure it sends them to the engine to let it update its internal board.Luis Babboni wrote:Thanks Daniel!cdani wrote:If your engine is uci and supports the uci commandLuis 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
position startpos moves e2e4 e7e5
it should work.
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.
How to use openings books?
Moderators: hgm, Rebel, chrisw
-
- Posts: 2204
- Joined: Sat Jan 18, 2014 10:24 am
- Location: Andorra
Re: How to use openings books?
Daniel José - http://www.andscacs.com
-
- Posts: 464
- Joined: Sat Feb 28, 2015 4:37 pm
- Location: Argentina
Re: How to use openings books?
Thanks Daniel!cdani wrote:I never programmed for Xboard. If Arena decides the moves sure it sends them to the engine to let it update its internal board.Luis Babboni wrote:Thanks Daniel!cdani wrote:If your engine is uci and supports the uci commandLuis 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
position startpos moves e2e4 e7e5
it should work.
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.
So not send a FEN with the final position after book moves?
If you know it not doing that when use UCI, I guess do not do it when use xBoard.
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: How to use openings books?
Luis, please have a look at the implementation of the "force" command (including other commands that must react correctly in force mode), it does not work correctly. After sending these commands: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 bookhgm 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 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.
Code: Select all
xboard
protover 2
new
force
usermove e2e4
-
- Posts: 464
- Joined: Sat Feb 28, 2015 4:37 pm
- Location: Argentina
Re: How to use openings books?
Yes, "usermove" launch the search and the rest of the engine work, this must be the mistake.
I was sure that after any "usermove" there is no other option that the need of the engine to make a move.
I was sure that after any "usermove" there is no other option that the need of the engine to make a move.
-
- Posts: 12542
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: How to use books?
Not every game starts with the opening position.Luis Babboni wrote: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:
Where:Code: Select all
If DiceGUI="new" Then Reseteo FEN="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" CargaFEN(FEN) EndIf
-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?
If you get a [FEN tag in the PGN header, then expect a non-standard starting position.
For the UCI protocol itself, you will just get the position to start playing from.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
-
- Posts: 27817
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: How to use openings books?
"usermove" does not launch a search directly. What it does is change the side to move. This can trigger a search when the engine is playing for the side that now has the move. But a 'force' command sets the engine to play neither side, so it would never start searching and playing a move, no matter which color is on move.Luis Babboni wrote:Yes, "usermove" launch the search and the rest of the engine work, this must be the mistake.
I was sure that after any "usermove" there is no other option that the need of the engine to make a move.
The GUI would not send you any position when using the GUI book. Most GUIs also have an option to start grom a given opening line, however, specified as incomplete PGN game. Such a game can contain a FEN tag, and in that case the GUI would send the position before sending the moves of the line (after 'new' and 'force'). Unless you would have taken measures to avoid that, the GUI would send you an 'edit' command for that.
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: How to use openings books?
Provided the implementation of "usermove" is correct ... In the given case "usermove" erroneously also sets the engine to play the side that has the move, so it ends the "force" mode immediately. That should be avoided since it is mainly the task of the "go" command.hgm wrote:"usermove" does not launch a search directly. What it does is change the side to move. This can trigger a search when the engine is playing for the side that now has the move. But a 'force' command sets the engine to play neither side, so it would never start searching and playing a move, no matter which color is on move.Luis Babboni wrote:Yes, "usermove" launch the search and the rest of the engine work, this must be the mistake.
I was sure that after any "usermove" there is no other option that the need of the engine to make a move.
-
- Posts: 27817
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: How to use openings books?
Indeed, what I described is what the command should do according to the specs. Moving should occur because the side to move gets equal to the side played. Never as execution of a command. Commands only affect the side to move (usermove, setboard, white, black, new) or the side played (new, go, white, black, force).
-
- Posts: 464
- Joined: Sat Feb 28, 2015 4:37 pm
- Location: Argentina
Re: How to use openings books?
As in most of my code, not sure how clear, easy or usefull to future features but it seems I solved the problem and now Soberango could play using openings books!
Thanks guys for your help!
Thanks guys for your help!