give up / propose draw

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: give up / propose draw

Post by bob »

mar wrote:
bob wrote:You are kidding, I assume? There is no "resign" option?

What a protocol.
I assume it's you who's kidding, resigning prematurely won't give you any elo (the opponent can still crash).

Moreover, isn't it Crafty who violates xboard protocol and reports scores from white's POV just to make GUI programmer's lives easier? :D (and adjudication as well?)
This doesn't seem to violate the xboard protocol. The original engine interface document didn't even mention scores as they weren't used. But in any case, it has only worked this way for 20+ years now. It wasn't to "make the GUI programmer's job easier, either. It was to make the score consistent with normal chess notation (PGN). If white is winning, you see +/- everywhere. Not +/- after a white move and -/+ after a black move...

Resigning is about courtesy to the opponent.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: give up / propose draw

Post by Ferdy »

bob wrote:
Ferdy wrote:
flok wrote:Hi,

Is it possible for a chess engine to propose a draw and/or give up when using the UCI protocol?
If so: how?
Still another method of giving up is by time forfeit. After receiving go ... command, search without limit, don't return bestmove, until you receive a stop command, by then you can send your bestmove.
In this case the gui had sent stop command because you have already exceeded the time allocation.
You are kidding, I assume? There is no "resign" option?
Folkert has an engine which supports uci protocol. He knew there is no such thing as resign in this protocol, that is why he uses the term "give up".
So I give him couple of methods on how to make an engine do so. Then he said it is clumsy and later offers protocol extension.

An elegant way perhaps is.

Code: Select all

info string I am resigning
Followed by

Code: Select all

bestmove resign
The gui will flag it as illegal move so it is a form of giving up the game, but giving info in advance to the gui.

Or after receiving

Code: Select all

position ...
go ...
The engine may reply with

Code: Select all

info depth ...
...
info string I am resigning
bestmove e2e4
Then next time it receives the,

Code: Select all

position...
go ...
The engine will purposely not return a bestmove on time, until it receives the stop
command, which would give up the game by time forfeit.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: give up / propose draw

Post by bob »

Ferdy wrote:
bob wrote:
Ferdy wrote:
flok wrote:Hi,

Is it possible for a chess engine to propose a draw and/or give up when using the UCI protocol?
If so: how?
Still another method of giving up is by time forfeit. After receiving go ... command, search without limit, don't return bestmove, until you receive a stop command, by then you can send your bestmove.
In this case the gui had sent stop command because you have already exceeded the time allocation.
You are kidding, I assume? There is no "resign" option?
Folkert has an engine which supports uci protocol. He knew there is no such thing as resign in this protocol, that is why he uses the term "give up".
So I give him couple of methods on how to make an engine do so. Then he said it is clumsy and later offers protocol extension.

An elegant way perhaps is.

Code: Select all

info string I am resigning
Followed by

Code: Select all

bestmove resign
The gui will flag it as illegal move so it is a form of giving up the game, but giving info in advance to the gui.

Or after receiving

Code: Select all

position ...
go ...
The engine may reply with

Code: Select all

info depth ...
...
info string I am resigning
bestmove e2e4
Then next time it receives the,

Code: Select all

position...
go ...
The engine will purposely not return a bestmove on time, until it receives the stop
command, which would give up the game by time forfeit.
Seems odd to omit such a basic thing as "I resign" or "I claim a draw"...
User avatar
hgm
Posts: 27703
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: give up / propose draw

Post by hgm »

Well, resign you can do without. And to be frank, most WB engines, if they implement it at all, implement it in a quite useless way, like "resign when you see you will be mated in 3". Other engines resign when they get a score below a certain value for a few moves in a row. None of this adds anything over what a GUI could have done: the latter can see the scores too.

The real problem is making and accepting draw offers. This is an integral part of game play, and requires a risk assessment that cannot be seen from the score alone.

My advice: just do not use such a defective protocol... :lol: