WinBoard/XBoard protocol in Chess for Android

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
abik
Posts: 823
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

WinBoard/XBoard protocol in Chess for Android

Post by abik »

I am exploring extending Chess for Android with some rudimentary support for the Chess Engine Communication Protocol (often simply called the XBoard or WinBoard protocol), and a very first prototype is functioning! I made an Android binary of the engine FairyMax (written by H.G. Muller, who was also very helpful providing more background), and imported this in Chess for Android. Some screenshots can be found at this blog posting.

Please let me know if you are interested in testing your Win/XBoard engine on Android (new UCI engines are of course also welcome).
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: WinBoard/XBoard protocol in Chess for Android

Post by Adam Hair »

abik wrote:I am exploring extending Chess for Android with some rudimentary support for the Chess Engine Communication Protocol (often simply called the XBoard or WinBoard protocol), and a very first prototype is functioning! I made an Android binary of the engine FairyMax (written by H.G. Muller, who was also very helpful providing more background), and imported this in Chess for Android. Some screenshots can be found at this blog posting.

Please let me know if you are interested in testing your Win/XBoard engine on Android (new UCI engines are of course also welcome).
Pardon me for butting in, but I feel I must say "Great!".

Thank you, Aart.
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: WinBoard/XBoard protocol in Chess for Android

Post by michiguel »

Adam Hair wrote:
abik wrote:I am exploring extending Chess for Android with some rudimentary support for the Chess Engine Communication Protocol (often simply called the XBoard or WinBoard protocol), and a very first prototype is functioning! I made an Android binary of the engine FairyMax (written by H.G. Muller, who was also very helpful providing more background), and imported this in Chess for Android. Some screenshots can be found at this blog posting.

Please let me know if you are interested in testing your Win/XBoard engine on Android (new UCI engines are of course also welcome).
Pardon me for butting in, but I feel I must say "Great!".

Thank you, Aart.
Fantastic!

Gaviota was, is, and will always be winboard Aart! You have another engine there ready!

Miguel
User avatar
abik
Posts: 823
Joined: Fri Dec 01, 2006 10:46 pm
Location: Mountain View, CA, USA
Full name: Aart Bik

Re: WinBoard/XBoard protocol in Chess for Android

Post by abik »

michiguel wrote:Gaviota was, is, and will always be winboard Aart! You have another engine there ready!
Thanks Miguel! I realized that, but in my prototype, the GUI first sends "uci" to attempt the UCI protocol, and if it then gets an error of the xboard form "Error (unknown command) uci" tries the xboard protocol instead with the "xboard" command. So for your engine, this current approach puts it in uci mode right away.

I guess I could send "xboard" first, but I am afraid some UCI and xboard engines will respond in the same way. How do other GUIs properly chose between the two protocols (and can the engine prefer one format over the other)?
kinderchocolate
Posts: 454
Joined: Mon Nov 01, 2010 6:55 am
Full name: Ted Wong

Re: WinBoard/XBoard protocol in Chess for Android

Post by kinderchocolate »

abik wrote:
michiguel wrote:Gaviota was, is, and will always be winboard Aart! You have another engine there ready!
Thanks Miguel! I realized that, but in my prototype, the GUI first sends "uci" to attempt the UCI protocol, and if it then gets an error of the xboard form "Error (unknown command) uci" tries the xboard protocol instead with the "xboard" command. So for your engine, this current approach puts it in uci mode right away.

I guess I could send "xboard" first, but I am afraid some UCI and xboard engines will respond in the same way. How do other GUIs properly chose between the two protocols (and can the engine prefer one format over the other)?
What about trying for more commands if you don't get any response? Like "go", if you receive anything you know it's a UCI engine. I think Arena would ask the user what protocol if it can't detect by the uci command.
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: WinBoard/XBoard protocol in Chess for Android

Post by Michel »

I am exploring extending Chess for Android with some rudimentary support for the Chess Engine Communication Protocol (often simply called the XBoard or WinBoard protocol), and a very first prototype is functioning!
Fantastic!
and if it then gets an error of the xboard form "Error (unknown command) uci" tries the xboard protocol instead with the "xboard" command
.

I did something similar in Polyglot. It works well for the well known open source xboard engines (like crafty, scorpio, the old gnuchess, the old sjeng). Of course technically the protocol has not started yet, so it is undefined what, if anything, the engine should send.

The opposite thing, sending "xboard" to an UCI engine, will likely not provoke any response at all. The UCI protocol says that any command (or token) that is not understood should be ignored. Again the caveat
that the protocol has not started applies here as well.

BTW. GNU Chess will behave as Gaviota. It will be auto detected as an uci engine.
User avatar
hgm
Posts: 28389
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: WinBoard/XBoard protocol in Chess for Android

Post by hgm »

Unfortunately auto-detection of engine type is often unreliable. E.g. it seems that Arena thinks that QueeNy is a UCI engine! If you don't allow the user to specify the engine type, there will be some engines you simply will not be able to run.
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: WinBoard/XBoard protocol in Chess for Android

Post by Michel »

E.g. it seems that Arena thinks that QueeNy is a UCI engine!
I think this is probably because QueeNy sends output before the gui has sent either "uci" or "xboard". While technically legal I think this should be avoided nonetheless.

GNU Chess is recognized by Arena as an xboard engine (even though it supports both protocols).

A UCI engine running under Polyglot is recognized by Arena as an xboard engine (even though it would also understand the UCI protocol).

This seems to indicate that Arena prefers the xboard protocol.
User avatar
hgm
Posts: 28389
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: WinBoard/XBoard protocol in Chess for Android

Post by hgm »

True, but unfortunately a GUI author will have to endure bad habits of existing engines.
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: WinBoard/XBoard protocol in Chess for Android

Post by michiguel »

abik wrote:
michiguel wrote:Gaviota was, is, and will always be winboard Aart! You have another engine there ready!
Thanks Miguel! I realized that, but in my prototype, the GUI first sends "uci" to attempt the UCI protocol, and if it then gets an error of the xboard form "Error (unknown command) uci" tries the xboard protocol instead with the "xboard" command. So for your engine, this current approach puts it in uci mode right away.

I guess I could send "xboard" first, but I am afraid some UCI and xboard engines will respond in the same way. How do other GUIs properly chose between the two protocols (and can the engine prefer one format over the other)?
you can run it as
./gaviota -x
will force it to be xboard

./gaviota -u
will force it to be uci

Miguel