UCI Engines without the graphical interface

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mephisto
Posts: 430
Joined: Mon Apr 03, 2006 10:10 am
Location: England

UCI Engines without the graphical interface

Post by mephisto »

Hi
Is there a simple windows program that let's you input the moves by board co-ordinates (e2e4) and the moves are returned the same way (e7-e5) instead of using a graphical interface like Arena.
The reason being that I want to incorporate a small Tablet PC into a chess table I have so the resulting moves are only required.
Thanks
Bryan
What's my next move? - to the fridge for another beer !!
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: UCI Engines without the graphical interface

Post by mcostalba »

mephisto wrote:Hi
Is there a simple windows program that let's you input the moves by board co-ordinates (e2e4) and the moves are returned the same way (e7-e5) instead of using a graphical interface like Arena.
The reason being that I want to incorporate a small Tablet PC into a chess table I have so the resulting moves are only required.
Thanks
Bryan
Any engine works like this, if I have understood the question. You don't need any interface to play like this.

Just start your preferred engine and type the move, engine will answer with its move directly to the console.
mephisto
Posts: 430
Joined: Mon Apr 03, 2006 10:10 am
Location: England

Re: UCI Engines without the graphical interface

Post by mephisto »

Hi Marco
Unfortunately if I double click on the chess engine file, I get the following error message.
"Is not a valid win32 application"
that is why I need an program to run the engines like Arena but without the graphics.
Regards
Bryan
What's my next move? - to the fridge for another beer !!
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: UCI Engines without the graphical interface

Post by mcostalba »

mephisto wrote:Hi Marco
Unfortunately if I double click on the chess engine file, I get the following error message.
"Is not a valid win32 application"
that is why I need an program to run the engines like Arena but without the graphics.
Regards
Bryan
Ok. First you should open the engine from the console, not double clicking, from start application type cmd.exe and run it.

In case google for cmd.exe and "open console on Windows" to know how to do it. You should open the console in the same directory of your engine.

Then from the console type the name of the engine application and if it is in the same directory it should start...
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: UCI Engines without the graphical interface

Post by kranium »

mcostalba wrote:
mephisto wrote:Hi Marco
Unfortunately if I double click on the chess engine file, I get the following error message.
"Is not a valid win32 application"
that is why I need an program to run the engines like Arena but without the graphics.
Regards
Bryan
Ok. First you should open the engine from the console, not double clicking, from start application type cmd.exe and run it.

In case google for cmd.exe and "open console on Windows" to know how to do it. You should open the console in the same directory of your engine.

Then from the console type the name of the engine application and if it is in the same directory it should start...
Hi Bryan, Marco-

my understanding is:

in a windows environment, browsing to an .exe and double-clicking it is a perfectly valid method to start a program (console or not). with windows explorer, there's no need to be concerned about current directories, etc. unlike (command-line) unix.

the error message "is not a valid win32 application" is a platform problem,
and usually means that the executable was not compiled for the environment it's being run in.

for ex:
1). if trying to run a 64 bit app in 32 bit windows...
2.) if the exe was compiled with a processor specific instruction set which is lacking in the current environment...
3.) trying to run a linux app in windows
etc.

my guess here is that the .exe is a 64 bit app
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI Engines without the graphical interface

Post by hgm »

mephisto wrote:Hi Marco
Unfortunately if I double click on the chess engine file, I get the following error message.
"Is not a valid win32 application"
that is why I need an program to run the engines like Arena but without the graphics.
Regards
Bryan
An engine provoking that response will not be able to run under Arena or whatever GUI. Engines must be valid win32 applications to run on a 32-bit Windows, no matter what GUI you use.

Of course UCI engines, run in console mode, cannot be used by simply entering the next move. You would have to enter the entire game upto and including the next move for every move you want it to make.

Better use a WinBoard engine.

In a sense Polyglot is what you seek, as this makes UCI engines communicate like they are WinBoard engines, i.e. by entering a single move, and waiting for the reply. But the reply is preceeded by "move ". If you don't want that, you could use InBetween to suppress it.
User avatar
Onno Garms
Posts: 224
Joined: Mon Mar 12, 2007 7:31 pm
Location: Bonn, Germany

Re: UCI Engines without the graphical interface

Post by Onno Garms »

hgm wrote: Of course UCI engines, run in console mode, cannot be used by simply entering the next move. You would have to enter the entire game upto and including the next move for every move you want it to make.
That does not hold for all UCI engines. Some UCI engines (such as mine :wink: ) do have an internal board that remembers the current position, so entering

Code: Select all

position moves e7e5
is enough.

It is true that the UCI protocol does not force you to remember the position and that any GUI has to send all the moves again, but the engine is allowed to remember.
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: UCI Engines without the graphical interface

Post by kranium »

Onno Garms wrote:
hgm wrote: Of course UCI engines, run in console mode, cannot be used by simply entering the next move. You would have to enter the entire game upto and including the next move for every move you want it to make.
That does not hold for all UCI engines. Some UCI engines (such as mine :wink: ) do have an internal board that remembers the current position, so entering

Code: Select all

position moves e7e5
is enough.

It is true that the UCI protocol does not force you to remember the position and that any GUI has to send all the moves again, but the engine is allowed to remember.
yes, and i think that's really a major flaw in the UCI protocol (as implemented)...

often in long games, the commands sent from GUI to engine are unecessarily long

i.e.
(here's an example after just 50 moves...imagine what it looks like after 100!)
position startpos moves b1c3 g8f6 g1f3 e7e6 e2e3 f8d6 f1c4 e8g8 e1g1 d6b4 a2a3 b4c3 d2c3 b8c6 f3g5 d7d5 c4d3 e6e5 e3e4 f6e4 g5e4 d5e4 d3e4 d8d1 f1d1 c8e6 c1g5 f7f6 g5e3 f8f7 e3c5 a8b8 b2b3 b8a8 a3a4 a7a6 f2f3 a8b8 d1d3 b8d8 a1d1 d8d3 d1d3 f7d7 d3d7 e6d7 g1f2 c6d8 c5e7 d8c6 e7a3 d7e6 a3c5 c6d8 c5e7 d8c6 e4c6 b7c6 f2e1 e6f5 e1d2 g8f7 e7d8 c6c5 d8c7 f7e7 b3b4 c5b4 c3b4 f5d7 a4a5 d7e6 b4b5 a6b5 a5a6 e6d5 c7b6 e5e4 f3e4 d5e4 g2g3 h7h6 a6a7 e7f7 d2c3 f7e6 c3b4 e4c6 b4c5 e6d7 h2h3 f6f5 b6a5 g7g5 a5d2 d7c7 d2e3 c6g2 h3h4 c7b7
go wtime 13191 btime 21167 winc 1000 binc 1000

the UCI engine must load the start position and (using it's excellent text parsing abilities) make every move until the current game position is reached?

(kinda silly, sorta like making a toothpick out of a log if you ask me...)

what's wrong with expecting the engine to realize it's involved in a game and has to remember the current position? (as happens with winboard)

in that case the only command that need be sent is 'move g7g5' for example...?

how much time is lost with UCI engines parsing unecessarily long input?
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: UCI Engines without the graphical interface

Post by kranium »

Onno Garms wrote:
hgm wrote: Of course UCI engines, run in console mode, cannot be used by simply entering the next move. You would have to enter the entire game upto and including the next move for every move you want it to make.
That does not hold for all UCI engines. Some UCI engines (such as mine :wink: ) do have an internal board that remembers the current position, so entering

Code: Select all

position moves e7e5
is enough.

It is true that the UCI protocol does not force you to remember the position and that any GUI has to send all the moves again, but the engine is allowed to remember.
maybe

Code: Select all

position moves e7e5
is not exactly valid?

my limited understanding is that the 'position' keyword should (must) reference something, for ex: 'startposition' or a 'fen' string, afterward followed by 'moves', etc. ...if need be?

maybe i'm wrong here...
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: UCI Engines without the graphical interface

Post by kranium »

kranium wrote:
Onno Garms wrote:
hgm wrote: Of course UCI engines, run in console mode, cannot be used by simply entering the next move. You would have to enter the entire game upto and including the next move for every move you want it to make.
That does not hold for all UCI engines. Some UCI engines (such as mine :wink: ) do have an internal board that remembers the current position, so entering

Code: Select all

position moves e7e5
is enough.

It is true that the UCI protocol does not force you to remember the position and that any GUI has to send all the moves again, but the engine is allowed to remember.
yes, and i think that's really a major flaw in the UCI protocol (as implemented)...

often in long games, the commands sent from GUI to engine are unecessarily long

i.e.
(here's an example after just 50 moves...imagine what it looks like after 100!)
position startpos moves b1c3 g8f6 g1f3 e7e6 e2e3 f8d6 f1c4 e8g8 e1g1 d6b4 a2a3 b4c3 d2c3 b8c6 f3g5 d7d5 c4d3 e6e5 e3e4 f6e4 g5e4 d5e4 d3e4 d8d1 f1d1 c8e6 c1g5 f7f6 g5e3 f8f7 e3c5 a8b8 b2b3 b8a8 a3a4 a7a6 f2f3 a8b8 d1d3 b8d8 a1d1 d8d3 d1d3 f7d7 d3d7 e6d7 g1f2 c6d8 c5e7 d8c6 e7a3 d7e6 a3c5 c6d8 c5e7 d8c6 e4c6 b7c6 f2e1 e6f5 e1d2 g8f7 e7d8 c6c5 d8c7 f7e7 b3b4 c5b4 c3b4 f5d7 a4a5 d7e6 b4b5 a6b5 a5a6 e6d5 c7b6 e5e4 f3e4 d5e4 g2g3 h7h6 a6a7 e7f7 d2c3 f7e6 c3b4 e4c6 b4c5 e6d7 h2h3 f6f5 b6a5 g7g5 a5d2 d7c7 d2e3 c6g2 h3h4 c7b7
go wtime 13191 btime 21167 winc 1000 binc 1000

the UCI engine must load the start position and (using it's excellent text parsing abilities) make every move until the current game position is reached?

(kinda silly, sorta like making a toothpick out of a log if you ask me...)

what's wrong with expecting the engine to realize it's involved in a game and has to remember the current position? (as happens with winboard)

in that case the only command that need be sent is 'move g7g5' for example...?

how much time is lost with UCI engines parsing unecessarily long input?
there is an alternative to loading the startposition, and making each and every move until the current position is reached:
if the UCI engine has the ability to remember the game position (which almost all do) , then it simply has to parse to the end of the command line, and capture and make the last move indicated...

i'm not aware of any engine that does this however...