Question : How to use a java engine as an uci engine

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

wolfman
Posts: 237
Joined: Thu Dec 31, 2009 12:06 pm

Question : How to use a java engine as an uci engine

Post by wolfman »

I have downloaded Carballo 1.7. This is a java engine. Is there an adapter as WB2UCI for java. If not , is it possible to use a java engine as an uci one ?
Thanks for your help.
Eran.
User avatar
hgm
Posts: 28513
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Question : How to use a java engine as an uci engine

Post by hgm »

Being a 'Java engine' does not mean much. Only that you need a different command for starting it, invoking the Java iterpreter. Java engines can be UCI or WB like any other, and this and the GUI used determine whether you need an adapter, or which one.
Colin-G
Posts: 191
Joined: Mon Oct 31, 2016 6:30 pm
Location: England

Re: Question : How to use a java engine as an uci engine

Post by Colin-G »

wolfman wrote:I have downloaded Carballo 1.7. This is a java engine. Is there an adapter as WB2UCI for java. If not , is it possible to use a java engine as an uci one ?
Thanks for your help.
Eran.
I just downloaded it to try it.
It works ok in linux Mint 17.
It uses the bash script "carballo.sh" to run the java program as a UCI engine.

Image

I made a polyglot file, carballo.ini, in the polyglot folder.

Code: Select all

[PolyGlot]
EngineName Carballo 1.7
EngineDir = /home/colin/carballo
EngineCommand = ./carballo.sh
Book = false
Log = false
Resign = true
ResignScore = 900

[Engine]
Hash = 64
Threads = 1
OwnBook = true
Ponder = false
and it works ok as a UCI engine in xboard with

Code: Select all

xboard -fd /home/colin/mychess/polyglot -fcp ./"polyglot carballo.ini"
I assume in Windows, you use the "carballo.bat" file to run it as a UCI engine, assuming you have java installed.
User avatar
hgm
Posts: 28513
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Question : How to use a java engine as an uci engine

Post by hgm »

Colin-G wrote:I made a polyglot file, carballo.ini, in the polyglot folder.

Code: Select all

[PolyGlot]
EngineName Carballo 1.7
EngineDir = /home/colin/carballo
EngineCommand = ./carballo.sh
Book = false
Log = false
Resign = true
ResignScore = 900

[Engine]
Hash = 64
Threads = 1
OwnBook = true
Ponder = false
and it works ok as a UCI engine in xboard with

Code: Select all

xboard -fd /home/colin/mychess/polyglot -fcp ./"polyglot carballo.ini"
I assume in Windows, you use the "carballo.bat" file to run it as a UCI engine, assuming you have java installed.
Note that the command

xboard -fcp ./carballo.sh -fd /home/colin/carballo -fUCI

should then also work, without making a polyglot.ini file. If you have Polyglot compliatly installed (i.e. in /usr/bin, /usr/games or /usr/local/bin),as it would be when you install it from the distro repositories or from the source code by "sudo make install".
Norbert Raimund Leisner
Posts: 1643
Joined: Tue May 20, 2008 4:57 pm
Location: Augsburg - Germany

Re: Question : How to use a java engine as an uci engine

Post by Norbert Raimund Leisner »

Colin-G
Posts: 191
Joined: Mon Oct 31, 2016 6:30 pm
Location: England

Re: Question : How to use a java engine as an uci engine

Post by Colin-G »

hgm wrote:
Colin-G wrote:I made a polyglot file, carballo.ini, in the polyglot folder.

Code: Select all

[PolyGlot]
EngineName Carballo 1.7
EngineDir = /home/colin/carballo
EngineCommand = ./carballo.sh
Book = false
Log = false
Resign = true
ResignScore = 900

[Engine]
Hash = 64
Threads = 1
OwnBook = true
Ponder = false
and it works ok as a UCI engine in xboard with

Code: Select all

xboard -fd /home/colin/mychess/polyglot -fcp ./"polyglot carballo.ini"
I assume in Windows, you use the "carballo.bat" file to run it as a UCI engine, assuming you have java installed.
Note that the command

xboard -fcp ./carballo.sh -fd /home/colin/carballo -fUCI

should then also work, without making a polyglot.ini file. If you have Polyglot compliatly installed (i.e. in /usr/bin, /usr/games or /usr/local/bin),as it would be when you install it from the distro repositories or from the source code by "sudo make install".
What you say is true, but the reason I use a separate linux polyglot executable and not have one installed from the repositories is that I have been using xboard since 2001, before the days of UCI engines. When UCI engines first came into being, the polyglot adapter had to be compiled manually and was not available to install from repositories. The xboard of those days also had no fUCI parameter.
Although I now use the latest xboard, I never use the fUCI functions because I had already generated some tcl/tk and bash control scripts, using a separate polyglot adapter where necessary, to easily select which engines play each other and settings, and have kept with them.
User avatar
hgm
Posts: 28513
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Question : How to use a java engine as an uci engine

Post by hgm »

OK, fair enough. But for the benefit of others who are not burdened with such a legacy, it should be pointed out that messing with ini files is a needlessly cumbersome way to run UCI engines in XBoard.
styx
Posts: 338
Joined: Tue Mar 13, 2012 9:59 pm
Location: Germany

Re: Question : How to use a java engine as an uci engine

Post by styx »

Anyone knows how to use CockooChess 1.12 in xboard under linux?

I tried the following line

Code: Select all

"CuckooChess" -fcp "java -Xmx2048m -jar /home/andreas/Dokumente/Chess/Engines/CuckooChess/cuckoo112.jar uci" -fd "." -fUCI
but it doesn't work.

Loading the engine causes a JVM process to start, using all the CPU power and 2,3 GB of RAM. I can load the engine's setting dialog without any problems, but it will never start to calculate moves.

I tried another Java Engine in xboard (Carballo) with the following line:

Code: Select all

"Carballo" -cp -fcp "java -jar /home/andreas/Dokumente/Chess/Engines/Carballo/carballo-1.7.jar" -fd "." -fUCI
and it works flawlessly.
Guenther
Posts: 4718
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: Question : How to use a java engine as an uci engine

Post by Guenther »

styx wrote:Anyone knows how to use CockooChess 1.12 in xboard under linux?

I tried the following line

Code: Select all

"CuckooChess" -fcp "java -Xmx2048m -jar /home/andreas/Dokumente/Chess/Engines/CuckooChess/cuckoo112.jar uci" -fd "." -fUCI
but it doesn't work.

Loading the engine causes a JVM process to start, using all the CPU power and 2,3 GB of RAM. I can load the engine's setting dialog without any problems, but it will never start to calculate moves.

...
I don't have Linux here, but your commandline looks right. I will try if
I can start it under Windows today, as it is not yet integrated in my WB setup.
(probably testing both ways - polyglot + uci2wb)
styx
Posts: 338
Joined: Tue Mar 13, 2012 9:59 pm
Location: Germany

Re: Question : How to use a java engine as an uci engine

Post by styx »

I tried UCI2WB adapter too. But either the syntax is different (or some special parameters are needed) or UCI2WB is not ready to communicate with a JVM.