Connect (UCI) engine(s) with GUI over network

Discussion of chess software programming and technical issues.

Moderator: Ras

nionita
Posts: 180
Joined: Fri Oct 22, 2010 9:47 pm
Location: Austria
Full name: Niculae Ionita

Connect (UCI) engine(s) with GUI over network

Post by nionita »

Hi, I have a windows desktop where I develop and a linux notebook, and sometimes I wish I could let 2 engines play in a (windows) GUI from both machines. (Currently I use Fritz GUI).

I remember there was some connector for this but I can't find that post.

I found something called netChess, but it seems there are at least 2 different pices of software, one from 2004 (in tcl) which does not run anymore (at least on linux), and something which is more recent (beeing itself a GUI), but it seems to be only for windows.

I know there are some solutions for virtual serial ports over TCP/IP, but I find this terribly in the 21st century. If there is no connector (adapter) I must write one myself.
User avatar
jshriver
Posts: 1387
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: Connect (UCI) engine(s) with GUI over network

Post by jshriver »

It's probably over-kill, but if you are linux-savvy you could grab HG Mullers Internet chess server and run it on your linux box.

Then you can run any engines (xboard or UCI) and use the ICS as a middle ground.

How I started my project, it's a useful server. Not the ideal solution to your needs, kind of tossing you a truck when you just needed a wheel barrow.

-Josh
User avatar
hgm
Posts: 28464
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Connect (UCI) engine(s) with GUI over network

Post by hgm »

There is p2p, which is a peer-to-peer connection adapter that disquises as an engine. So if you want to play A vs B over the network, you can play A vs p2p on machine 1, and B vs p2p vs machine 2.
User avatar
hgm
Posts: 28464
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Connect (UCI) engine(s) with GUI over network

Post by hgm »

There is p2p, which is a peer-to-peer connection adapter that disquises as an engine. So if you want to play A vs B over the network, you can play A vs p2p on machine 1, and B vs p2p vs machine 2.

http://www.talkchess.com/forum/viewtopic.php?t=44450

But this is really intended for situations where you need to have a GUI on both ends (e.g. because you play human vs human). For running remote engines, it is usually much simpler to set up one machine as an engine server (e.g. simply running the engine through the ssh server if it is a Linux machine), and let the GUI on the other machine use it (by using ssh with the proper connection parameters as 'engine').
ZirconiumX
Posts: 1361
Joined: Sun Jul 17, 2011 11:14 am
Full name: Hannah Ravensloft

Re: Connect (UCI) engine(s) with GUI over network

Post by ZirconiumX »

Code: Select all

ssh -p <port> <ip address> <engine command>
is how I do it. You need to use ssh keys, because last time I checked "Password for mbrades@xxx:" isn't a valid UCI command, just to give one example. But it is bulletproof, and reliable, even across architectures - I can run Houdini on Linux (using WINE) and connect to it on my iMac G4.

Matthew:out
tu ne cede malis, sed contra audentior ito
nionita
Posts: 180
Joined: Fri Oct 22, 2010 9:47 pm
Location: Austria
Full name: Niculae Ionita

Re: Connect (UCI) engine(s) with GUI over network

Post by nionita »

ZirconiumX wrote:

Code: Select all

ssh -p <port> <ip address> <engine command>
is how I do it. You need to use ssh keys, because last time I checked "Password for mbrades@xxx:" isn't a valid UCI command, just to give one example. But it is bulletproof, and reliable, even across architectures - I can run Houdini on Linux (using WINE) and connect to it on my iMac G4.

Matthew:out
Thanks, I think this is the easiest to try. I don't remember if Fritz GUI accepts command with parameters for the engine, but I'll try this too.

Nicu
kinderchocolate
Posts: 454
Joined: Mon Nov 01, 2010 6:55 am
Full name: Ted Wong

Re: Connect (UCI) engine(s) with GUI over network

Post by kinderchocolate »

Why not go for the easiest approach? There's a FICS server you can use. I always pair engines playing using total different protocol/software/hardware on FICS. You just need a script or interface to connect your engine to FICS. I use this technique to connect engines on Mac, PC, Android and iPhone easily.
ZirconiumX
Posts: 1361
Joined: Sun Jul 17, 2011 11:14 am
Full name: Hannah Ravensloft

Re: Connect (UCI) engine(s) with GUI over network

Post by ZirconiumX »

kinderchocolate wrote:Why not go for the easiest approach? There's a FICS server you can use. I always pair engines playing using total different protocol/software/hardware on FICS. You just need a script or interface to connect your engine to FICS. I use this technique to connect engines on Mac, PC, Android and iPhone easily.
This is going overboard, IMO. Fritz GUI does not support FICS protocol, just to give one example.

"So use Winboard!" I hear you cry. Winboard requires Polyglot for UCI engines. SSH does not.

To conclude:

For FICS you need Xboard and polyglot, and Winboard.
For SSH you need SSH.

Matthew:out
tu ne cede malis, sed contra audentior ito
User avatar
hgm
Posts: 28464
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Connect (UCI) engine(s) with GUI over network

Post by hgm »

ZirconiumX wrote:"So use Winboard!" I hear you cry. Winboard requires Polyglot for UCI engines. SSH does not.
Yes, so? That makes it superior, right? Polyglot is very good.

Even if you use the ssh solution, it is better to run Polyglot on the remote machine together with the engine. So that you use the compact WB protocol over the network,in stead of the horrendously verbose UCI.
mar
Posts: 2675
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Connect (UCI) engine(s) with GUI over network

Post by mar »

hgm wrote:in stead of the horrendously verbose UCI.
Yes you're right. I think this is biggest weak spot of UCI (unfortunately). The problem is that one can't compress it using position FEN because that would break repetition detection. Even if one would compress positions using FEN from last irreversible move - that's still not enough and UCI still has to send all the moves since that position.