Page 1 of 4

An FRC compatible xboard (sort of)

PostPosted: 17 Jul 2005, 23:31
by Tord Romstad
Hi all,

It's been a rainy weekend in Oslo, and today I decided to kill some time by trying to hack some basic FRC support into xboard. I think all my changes are located in files which are shared between xboard and Winboard, which means that everything should work equally well (which not well at all, really) in Winboard. You can download the modified source code by clicking here.

This xboard version uses FEN strings and move encodings of the form described by Stefan Meyer Kahlen in his recent extension to the UCI protocol. It will only work with engines which send moves in coordinate notation ("e2e4", etc.). Castling moves are encoded in the form "king captures rook", e.g. "e1h1" for a white kingside castling from the standard opening position. Entering castling moves with the mouse is done in the same way, you just drop the king on top of the rook.

There are many limitations. So far, there is no legality checking at all for FRC castlings. For instance, if you launch xboard without a chess engine, in the standard starting position xboard will allow 1. O-O as white's first move (the bishop on f1 and the knight on g1 will simply disappear). It is also not possible to manually set up FRC positions. I recommend creating a text file containing all the 960 starting positions in SMK's FEN format, and load a position by starting xboard with the -lpf and -lpi command line parameters.

I also cannot promise that there are no serious bugs. I haven't had the chance to test a lot. My plan was to use my modified xboard combined with a FRC-enabled PolyGlot which I am also working on, but this modified PolyGlot is even more unfinished and not yet ready for release. I bet Fabien will have it finished before me, anyway. :)

If someone wants to inspect my changes to the xboard code, I have tried to surround them with comments including my name. Search for the string "Tord" in the source code, and you should be able to easily find all the important changes (I may have forgotten adding comments a couple of places, but not in important parts of the code, I think). Most of the changes are really ugly and hairy hacks, but I think they mostly work.

Have fun.

Tord

Re: An FRC compatible xboard (sort of)

PostPosted: 18 Jul 2005, 05:39
by Reinhard Scharnagl
Tord wrote:This xboard version uses FEN strings and move encodings of the form described by Stefan Meyer Kahlen

It seems necessary to state, that Shredder's FEN extension would lead to contradicting representations of identic positions. Using the well known X-FEN http://www.chessbox.de/Compu/fullchess5b_e.html instead would preserve compatibility to existing game databases, online chess servers, PGN viewers and many other existing GUIs and engines.

Reinhard.

Re: An FRC compatible xboard (sort of)

PostPosted: 18 Jul 2005, 08:49
by F.Huber
Reinhard Scharnagl wrote:It seems necessary to state, that Shredder's FEN extension would lead to contradicting representations of identic positions.

It was really only a matter of time, when you would start your defamation campain against the new Shredder Chess960-FEN also here in this forum, after having done this already in every other computer chess forum!
(Oh, I?ve overlooked something - the r.g.c.c. forum is still missing in your list, maybe you should try it there, too!?)

Franz.

Re: An FRC compatible xboard (sort of)

PostPosted: 18 Jul 2005, 09:01
by Alessandro Scotti
Hi Tord,
thanks for this great job! :D When you don't plan to work on it for a while (meaning the code will stay free of changes) I can try adding the missing features... BTW what could be used for testing?

Re: An FRC compatible xboard (sort of)

PostPosted: 18 Jul 2005, 09:12
by Reinhard Scharnagl
F.Huber wrote:your defamation campain

In contrast to you I am posting arguments and facts. So you seem to mix up something.

Additionally being convinced of the value of my arguments, when I am posting I am using my real name instead of hiding away anonymously by using a pseudonym.

Reinhard Scharnagl.

P.S.: Please distinguish between my critic on Shredders incompatible FEN extension and my exitement, that such a famous person like SMK now has entered the Chess960 scene with a more than competitive program. But I am sad actually having to play the role of an advocatus diaboli, preventing Chess960 to be infected by such incompatible approaches.

Re: An FRC compatible xboard (sort of)

PostPosted: 18 Jul 2005, 09:41
by Tord Romstad
Alessandro Scotti wrote:Hi Tord,
thanks for this great job! :D

Thanks, but let's not use adjectives like "great" before we have done some testing. :wink:

When you don't plan to work on it for a while (meaning the code will stay free of changes) I can try adding the missing features... BTW what could be used for testing?

That's one of the problems right now -- there is hardly anything at all which can be used for testing. When I (or Fabien) have finished adding FRC support to PolyGlot, it should be possible to use UCI engines with SMK's new UCI extensions in xboard/Winboard. At the moment, I think there are only three such engines (Homer, Glaurung and Shredder), but I am sure there will soon be many more.

I think it would also be quite easy to modify most FRC capable Winboard engines (like The Baron or Frenzee) to work in my FRC xboard. The only things that would need to be changed are the encoding of castling moves ("e1h1" instead of "e1g1" or "O-O") and the setboard command. Whether the authors are interested in doing these changes is of course a different question.

Tord

Re: An FRC compatible xboard (sort of)

PostPosted: 18 Jul 2005, 10:23
by Richard Pijl
I think it would also be quite easy to modify most FRC capable Winboard engines (like The Baron or Frenzee) to work in my FRC xboard. The only things that would need to be changed are the encoding of castling moves ("e1h1" instead of "e1g1" or "O-O") and the setboard command. Whether the authors are interested in doing these changes is of course a different question.

Hi Tord,

Perhaps you've missed it, but in the winboard specification it says that FRC castling is to be specified with O-O and O-O-O. Or did you have a reason to deviate from that?

From the Winboard specification:
FischerRandom castling: O-O, O-O-O (oh, not zero)


I'll add the new FEN specification to the Baron though
Richard.

Re: An FRC compatible xboard (sort of)

PostPosted: 18 Jul 2005, 13:36
by Tord Romstad
Hi Richard!
Richard Pijl wrote:Perhaps you've missed it, but in the winboard specification it says that FRC castling is to be specified with O-O and O-O-O. Or did you have a reason to deviate from that?

Both, really. First of all, I missed it. I didn't know the Winboard specification had anything to say about FRC castling. In addition, the "e1h1" notation was easier to implement, for two reasons. The first reason is that modifying just a single place in the code is sufficient to handle move input with the mouse and move input from the engine. I simply tell xboard that king captures friendly rook always means castling. The second reason is that it makes it easier to update the internal board array in xboard correctly when moves are made. If I use the O-O notation, it is not quite as obvious which rook to move (it's not a big problem, of course, I could just look for the friendly rook closest to the king on the right side).

Neither of these reasons are terribly important, of course. I can switch to the O-O notation if people prefer that. I'll keep the Shredder-style FEN strings, though.

Tord

Re: An FRC compatible xboard (sort of)

PostPosted: 19 Jul 2005, 08:39
by Fabien Letouzey
Hi Richard,

Richard Pijl wrote:Perhaps you've missed it, but in the winboard specification it says that FRC castling is to be specified with O-O and O-O-O. Or did you have a reason to deviate from that?


Can (public) WinBoard move the king+rook "correctly" (Chess960 rules) on its own, including when a "self capture" is involved?

Fabien.

Re: An FRC compatible xboard (sort of)

PostPosted: 19 Jul 2005, 08:45
by Fabien Letouzey
Hi Tord,

Tord Romstad wrote:When I (or Fabien) have finished adding FRC support to PolyGlot, it should be possible to use UCI engines with SMK's new UCI extensions in xboard/Winboard.


I will do it this week, when it's clear to me what FRC support the public WinBoard has. I expect it not to handle any castling rights though, even in starting positions. If WinBoard changes are necessary, I will adapt to whatever is available.

[quote]At the moment, I think there are only three such engines (Homer, Glaurung and Shredder), but I am sure there will soon be many more./quote]

I wouldn't expect many releases before Mainz, so you're going to see many more Shredder-Glaurung matches ...

Fabien.

Re: An FRC compatible xboard (sort of)

PostPosted: 19 Jul 2005, 09:17
by Richard Pijl
Can (public) WinBoard move the king+rook "correctly" (Chess960 rules) on its own, including when a "self capture" is involved?

I don't know. I never used winboard to play fischerandom on a chess-server myself.
Richard.

Re: An FRC compatible xboard (sort of)

PostPosted: 19 Jul 2005, 11:35
by Tord Romstad
Hi all,

I have now tried to make my modified xboard understand "O-O" and "O-O-O". The new code is found in the HandleMachineMove() function in backend.c. I simply replace "O-O" with strings like "e1h1" before calling ParseOneMove(). Unfortunately there is no easy way for me to test that this works. It is possible that I have gotten it completely wrong.

Fabien comlains that my modified xboard crashes all the time, and that the initial FEN strings are incorrect. I haven't been able to reproduce either problem. No crashes here, and all FENs I have seen have been correct. I haven't tested much, though (it's not easy to do much testing without a compatible engine). If somebody finds some obvious, easily reproducible problems, I would like to hear about it.

The updated source code can be found at the link I gave in the first post of this thread.

Tord

Re: An FRC compatible xboard (sort of)

PostPosted: 22 Jul 2005, 08:55
by Fabien Letouzey
Hi all,

There is also a 960-only version of PolyGlot which is compatible with Tord's XBoard/WinBoard-FRC.

Unix users (e.g. Linux, Mac OS X) should ask Tord for the source code.

If Windows users are interested (e.g. I don't know if Arena has been updated for UCI-960 yet) it is more complex, as we have to produce binaries for them. Please post here in this case, and Dann or Leo could compile PolyGlot-960 if needed.

Please note both XBoard-FRC and PolyGlot-960 are of course in ultra-alpha stage. They could be useful for a couple of authors prepating for Mainz though ...

Fabien.

Re: An FRC compatible xboard (sort of)

PostPosted: 22 Jul 2005, 10:01
by Tord Romstad
Fabien Letouzey wrote:Hi all,

There is also a 960-only version of PolyGlot which is compatible with Tord's XBoard/WinBoard-FRC.

Unix users (e.g. Linux, Mac OS X) should ask Tord for the source code.

PolyGlot-960 can now be downloaded here. It will not work with my original xboard-frc, you will have to download an updated version. Thanks to Fabien for numerous bug fixes, and to Alessandro for pointing out a bug in my code for handling castling moves in the "O-O" format.

Please note both XBoard-FRC and PolyGlot-960 are of course in ultra-alpha stage.

XBoard-960 (I changed the name to make it more consistent with PolyGlot-960) certainly is, but PolyGlot-960 is already very stable, useful and complete. In their current state, the programs work fine as long as you only use them for running automated matches between UCI engines which use SMK's recent UCI extensions. Saving the games to PGN files also works. However, it is not yet possible to read the generated PGN files back into XBoard.

With just a small amount of work, it should also be possible to make XBoard-960 work with FRC compatible Winboard engines (like Frenzee and Baron). In the engine, support for FRC FEN strings in SMK's notation must be added. I am not sure exactly which changes would be necessary in the XBoard-960 code, but I think they should be very minor.

They could be useful for a couple of authors prepating for Mainz though ...

Yes, there is already one author preparing for Mainz who finds them very useful. As always, thanks for your help, Fabien! :D

Tord

Re: An FRC compatible xboard (sort of)

PostPosted: 22 Jul 2005, 10:08
by Reinhard Scharnagl
For those, who are interested,

there is a german language X-FEN specificaton (formerly called FRC-FEN)
at: http://www.chessbox.de/xfen.html.

Also a very short explanation could be found at:
http://www.chessbox.de/Compu/fullchess5b_e.html (eng) and http://www.chessbox.de/Compu/fullchess5b.html (ger).

Regards, Reinhard.

Re: An FRC compatible xboard (sort of)

PostPosted: 23 Jul 2005, 09:13
by Fabien Letouzey
Tord Romstad wrote:PolyGlot-960 can now be downloaded here.


For Windows users,

Don't try this at home!

PolyGlot not only requires Cygnus GCC as the compiler on that platform, but also a couple of changes are necessary; from memory:

- BlockSignal = true in main.cpp
- SendCR = true in io.cpp
- UseNice = false in engine.cpp

I think I am forgetting one ...

Better: look for the string "Windows" in the source code.

Fabien.

Re: An FRC compatible xboard (sort of)

PostPosted: 23 Jul 2005, 11:17
by milix
Hi!
I also made some mods in xboard 4.2.7 to add support for FRC. My mods can be downloaded here http://www.milix.net/aice/downloads.html

All mods are marked with the '// milix hack' remark, so it will be easy for someone to merge Tord's mods with mine.

I tested my mods in human vs engine in Linux and it works fine so far (I will use my version of xboard in Mainz).

Re: An FRC compatible xboard (sort of)

PostPosted: 24 Jul 2005, 08:39
by Fabien Letouzey
milix wrote:I also made some mods in xboard 4.2.7 to add support for FRC. My mods can be downloaded here http://www.milix.net/aice/downloads.html


Hi,

I'll have a look at your changes.

I suggest we agree on a single XBoard version. Maybe we should discuss it in this thread?

After that, I will adapt PolyGlot-960 to whathever has been decided. That way you will be able to use Glaurung FRC for testing.

Fabien.

Re: An FRC compatible xboard (sort of)

PostPosted: 24 Jul 2005, 12:06
by Volker Pittlik
Fabien Letouzey wrote:...
I suggest we agree on a single XBoard version. Maybe we should discuss it in this thread?

After that, I will adapt PolyGlot-960 to whathever has been decided. That way you will be able to use Glaurung FRC for testing.

Fabien.


Maybe it should be considered also that X/Winboard already supports FRC on servers (although http://www.tim-mann.org/xboard/engine-intf.html#8 is possibly misleading).

I have tested it on ICC and it works fine altough one have to enter the FRC castling move manually at the command line. It understands O-O-O (or o-o-o, letter "O" not zero) as FRC castling move. It might be a good idea to keep this feature alive.

Regards

Volker

Re: An FRC compatible xboard (sort of)

PostPosted: 24 Jul 2005, 17:48
by Bryan Hofmann
I don't know much about the rule of Chess960 but wanted to try out a xboard-960,polyglot-960 with Glaurung FRC on FICS. It plays fine until a castling move occurs. Here is the debug output from the xboard-960;

Code: Select all
Creating: FRCEngine (++++) DevilBoy (++++) unrated wild/fr 2 12
{Game 206 (FRCEngine vs. DevilBoy) Creating unrated wild/fr match.}
Parsing board: rqbbnkrn pppppppp -------- -------- -------- -------- PPPPPPPP RQBBNKRN W -1 1 1 1 1 0 206 FRCEngine DevilBoy 1 2 12 39 39 120000 120000 1 none (0:00.000) none 0 0 0

recognized 'ICS unrated wild/fr match' (-1) as variant fischerandom
Remembered ratings: W 0, B 0
68329 >first : variant fischerandom
68329 >first : force
68329 >first : setboard rqbbnkrn/pppppppp/8/8/8/8/PPPPPPPP/RQBBNKRN w GAga - 0 1
68329 >first : level 0 2 12
68329 >first : name DevilBoy
68329 >first : rating 0 0
68329 >first : time 12000
otim 12000
68329 >first : go
68330 <first : Error (unknown command): variant fischerandom
fics% 75594 <first : move f1g1
xboard-960: Internal error; bad moveType 5 (5,0-6,0)
>ICS: say Internal error; bad moveType 5 (5,0-6,0)


I don't know if it is the engine or xboard that is the issue. Above the 1st move was a castleing one. Also while it states above that variant fischerandom is a unknown command it plays fine up until a castling move happens.

Bryan