Winboard_F and shatranj and ics play

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

Winboard_F and shatranj and ics play

Postby PulsarMike » 29 Nov 2007, 09:49

hi,

when i found out winboard f played shatranj i pulled out my old shatranj code that i never got to use with the old winboard, i coded it and found out winboard didnt support it and tried it with winboard_f.

I had to change the piece mapping to get it to work with the ics. chessclub.com uses queen and bishop not f and e so i used this piece mapping: /pieceToCharTable="PNERFQWBMOUHACGSKpnerfqwbmouhacgsk"

It played most of the game fine but on 98 qb7+ was delivered. now moves like Qe3 were parsed by winboard_f earlier but with the + it seemed to fail. I got in the winboard debug file:

accepted move Qb7+ from ICS, parse it.
board = 0-8 x 8
move to parse: Qb7+
Impossible move a1a16, type = 34
Illegal move from ICS 'Qb7+'
board L=0, R=8, H=8, holdings=0
Move parsed to 'Qb7+ (0:27)'


now the move was legal and was played by my opponent 'fegor'. icc doesnt allow illegal moves in a shatranj game.

Earlier it accepted this:

accepted move Qe3 from ICS, parse it.
board = 0-8 x 8
move to parse: Qe3
Disambiguate in: 5(-1,-1)-(4,2) = 0 (

copy and paste doesnt seem to want to do 10 lines but the move it spitted out to my engine was:
1321891 >first : f2e3


i have the pgn and winboard.debug saved.
1. e3 Be6 2. d3 Bd6 3. e4 f6 4. d4 c6 5. c3 Kc8 6. f3 Qf7 7. Be3 Kc7 8. Bd3
g6 9. Nd2 Bf8 10. Kc2 d6 11. c4 Na6 12. d5 Bc8 13. dxc6 Nb4+ 14. Kc3 Nxc6
15. Nb3 Be6 16. Nd4 Nxd4 17. Kxd4 Rc8 18. Qd2 Kb8 19. Rc1 f5 20. exf5 gxf5
21. Ne2 Rc6 22. Bxf5 Nf6 23. Bd3 h6 24. h3 Rg8 25. g3 Ra6 26. a3 Rc6 27. c5
dxc5+ 28. Rxc5 Rd6+ 29. Kc3 Nd5+ 30. Kc2 b6 31. Rb5 a6 32. Rb3 Rc6+ 33. Nc3
Rxg3 34. Kb1 Nc7 35. Ne4 Rg6 36. Rc1 Rxc1+ 37. Kxc1 b5 38. Rc3 Nd5 39. Rc2
Rg8 40. Qe1 Ka8 41. Nd2 Kb8 42. Nb1 h5 43. Nc3 Nxc3 44. bxc3 Kc8 45. Kd1 Kd7
46. f4 Bd6 47. f5 Bc8 48. Rf2 Rg3 49. Bc5 Rxd3+ 50. Kc2 Rxh3 51. Bxe7 Bb8
52. Rd2+ Kc7 53. Bc5 b4 54. axb4 Kc6 55. Qf2 Kc7 56. Rd3 Rxd3 57. Kxd3 Qe8
58. Qe3 Qd7 59. Qd4 Qc6 60. Be3 Bd6 61. Bg5 Qb7 62. Be7 Bb8 63. Bc5 Qc6 64.
Kc4 Qb5+ 65. Kb3 Qc6 66. Kc4 Qb5+ 67. Kb3 Qc6 68. f6 Qb5 69. f7 Qc6 70. Qe3
h4 71. Qd4 h3 72. Qe3 h2 73. Qd4 Qd7 74. Qe3 Qe6 75. Qf4 Kb7 76. Qg3 a5 77.
bxa5 Ba6 78. Qf4 Bc8 79. Qe5 Qxf7 80. Qf4 Qg8 81. Qg3 Qf7 82. Be3 h1=Q 83.
Qf2 Qe6 84. Bc5 Kc6 85. Qe3 Qg2 86. Qd4 Ba6 87. Be3 Qh3 88. c4 Bxc4 89. Kxc4
Kc7 90. Bc5 Kc8 91. Kb5 Qd7 92. Kb6 Qe8 93. a6 Qf7 94. a7 Qe6 95. a8=Q Qg2
96. Qe5 Bd6 97. Qxd6 Qd5 98. Qb7+ {Black forfeits on time} 1-0


oddly enough i'm just running the winboard_f.exe that was made to be updated to send teh fischer random fen string. i just have winboard_f.exe and help on getting the rest would be appreciated. My pieces are not shatranj pieces. I went to the link in the beta release post and saw the winboard_x download link but it wasnt a clickable hyperlink for me.


i'd love to run it on the icc. maybe i made a mistake.

thanks
Mike
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Re: Winboard_F and shatranj and ics play

Postby H.G.Muller » 09 Dec 2007, 11:04

Hi, I'm back!

This is very mysterious. It is obviously a parser error, and I would suspect the in-check '+' as a source of trouble too. If I didn't know better, I would think it confuses it for a Shogi-style promotion indicator (note it reports the move 'a1a16', i.e. the promotion character (6) is non-zero). I had trouble with this earlier, and solved it by not recognizing the '+' as promotion in Shogi anymore (as promotion is default anyway), so that in Shogi PGN it recognizes all the promotion plusses as check indicators (which are ignored anyway). It is almost like I have accidentally linked this with an old version of the parser.

Except...

After a move of style 'Qb7' the parser should call 'Disambiguate' to figure out the FromSquare, and Disambiguate should give debug output like the case you report where it did work. (Which unfortunately contained a NULL character as promotion character, causing the copy-paste problems you had.) So Disambiguate is not even called, and yet it decides that this is an impossible move (type 34).

Now the only way the parser should abstain from calling Disambiguate after a move like Qb7 is if the square that is given is off-board to begin with. But then it returns move type = 0, not 34. (And b7 is not off board!)

So it is like if the parser considers this a completely different case, which requires no Disambiguation. I have no idea which case, it seems none of the other parser rules could match it... So for the moment I am completely baffled by this behavior. :(

I have uploaded a new alpha test version that prints some more debug output from the parser. Could you try it again with that one?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Winboard_F and shatranj and ics play

Postby PulsarMike » 09 Dec 2007, 11:38

hi,

Its bedtime now but tommorow ( or really later today ) i'll give it a shot. played several more games and the error is very consistent. It says illegal move whenever a elephant or general administers check. I'm using piece mapping to accomadate icc conditions. on icc an elephant is a bishop and a general is a queen. so i have to map the queen to general and elephant to bishop. This is because icc sends moves saying the bishop moved so and so when normally it would be the elephant moved so and so.

by the way if ics play of shatranj is to be supported the piece mapping is limited. you see icc uses bishops and queens in all games including shatranj. If you map for shatranj you cant play other games. if you play other games you cant play shatranj.

but for homeplay the board set is nice, from an image i've seen. myself i only found the executable link. i dont have the new piece sets.

what is the link by the way to the alpha version?

thanks
Mike Adams
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Re: Winboard_F and shatranj and ics play

Postby PulsarMike » 16 Dec 2007, 01:34

I ran a test of shatranj with winboard f and got the followin error in the debug log, couldnt parse qb5. I have posted the debug log at:

http://www.adammr.com/shat/winboardf-shat-1.txt

the pgn is:

1. Nc3 Nc6 2. Bh3 Nf6 3. Nf3 e6 4. d3 e5 5. b3 Be6 6. b4 d6 7. Rb1 Bh6 8.
Be3 a6 9. b5 axb5 10. Rxb5 b6 11. g3 g6 12. Rg1 Ng4 13. Rh1 f6 14. Rb2 Ra5
15. Rb5 Rxb5 16. Nxb5 d5 17. c3 Bf8 18. a3 Bd6 19. Rf1 g5 20. Bc1 Nh6 21. d4
g4 22. dxe5 fxe5 23. Ng5 Bc8 24. f3 gxh3 25. Nxh3 Rg8 26. e3 Nf7 27. e4 Ne7
28. exd5 Nxd5 29. Rf2 Be6 30. Rd2 c6 31. Nf2 Kd7 32. Ne4 Bc4 33. Rd3 Ke6 34.
Na7 Qd7 35. Nd2 Ra8 36. Nxc6 Qxc6 37. Nxc4 Qb5 38. Nd2 Rc8 39. Ne4 Qc4 40.
Rd2 Qb3 41. Rd3 Bf8 42. Qf2 h6 43. Be3 Nd6 44. Ke1 Nxe4 45. fxe4 Nxc3 46.
Bg1 Qa4 47. Re3 Rc4 48. Rf3 Bd6 49. Rd3 Nxe4 50. Be3 Rd4 51. Rxd4 exd4 52.
Bg1 Kd5 53. Qe3 Nc3 54. Kd2 Nb1+ 55. Ke2 dxe3 56. Kxe3 Nxa3 57. Kd3 Nc4 58.
h3 b5 59. Be3 b4 60. Bc1 b3 61. Be3 b2 62. h4 Ne5+ 63. Kc3 Ke4 64. Bc5 b1=Q
65. Ba3 Qb5 {White forfeits on time} 0-1

mike
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Re: Winboard_F and shatranj and ics play

Postby PulsarMike » 16 Dec 2007, 01:40

This is the piece to char table i'm using.


/pieceToCharTable="PNERFQWBMOUHACGSKpnerfqwbmouhacgsk"

its neccesary to convert both elephant to bishop so winboard f doesnt send elephant to icc and bishop to elephant to winboard f understands icc sending a bishop move.

I will be available to do more testing now that i got winboard_f and the piece to char table set up again, i did not have that on my computer earlier this week fully set up and went to try to run tests on wednesday but ran out of time dealing with setup issues, was trying to squeeze it in before dinner.

Mike
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Re: Winboard_F and shatranj and ics play

Postby H.G.Muller » 16 Dec 2007, 10:10

I don't seem to be able to download the debug file. The link is active, but both the browser and 'save target as' seem to choke on it, and just hang forever without further output when I try to access it.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Winboard_F and shatranj and ics play

Postby PulsarMike » 16 Dec 2007, 20:02

hi,

I zipped it, maybe that will work:

http://www.adammr.com/shat/winboardf-shat-1.zip

mike
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Re: Winboard_F and shatranj and ics play

Postby H.G.Muller » 19 Dec 2007, 15:51

OK, this definitely works.

I have not solved it yet (I just started looking), but I already see a few irregularities:

* It seems I have the initial position of Shatranj wrong: King and Ferz should be reversed. That doesn't seem to matter much here, as you play from a setup position. However, when I just paste in the moves ('paste game from clipboard'), it complains about an illegal move already on move 34, because apparently pasting a game restores the normal openning position. The game really should contain the setup position before the moves to prevent that.

* The problem seems related to promotion. (Or there is another unrelated problem with promotion.) When I paste the given game after editing a correct initial position into it, move 64 promotes to a FIDE Queen (the spiky crown), rather than a Ferz.

This is most likely caused because in variant Shatranj I overrule the give promotion character to 'f', while I probably should have overruled it to PieceToChar(BlackFerz). And you redefined 'f'to mean Queen!
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Winboard_F and shatranj and ics play

Postby PulsarMike » 19 Dec 2007, 18:25

I think that might be teh direction of the problem. and yes the icc setboard's with winboard at the start of the game.

king and queen are reversed.

there is a general problem with using winboard_f on icc which i have as a computer account and others will have logging onto human accounts. you have to piece map to play shatranj. but this means you cant play other variants i believe like regular chess becuase now a queen really is a queen.


Icc always sends moves and receives moves as pnbrqk PNBRQK

Mike
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Re: Winboard_F and shatranj and ics play

Postby H.G.Muller » 19 Dec 2007, 23:20

PulsarMike wrote:there is a general problem with using winboard_f on icc which i have as a computer account and others will have logging onto human accounts. you have to piece map to play shatranj. but this means you cant play other variants i believe like regular chess becuase now a queen really is a queen.

This is a very fundamental problem, and I don't know if it can be solved. The problem is of course that icc uses the wrong piece names, but they are not likely to change this.

One could make the /pieceToCharTable variant dependent, as the defaults are variant dependent. But there still would be problems if you would have an engine that uses one set of names, and want to play it against an engine that uses another set of names. So the table should not only be variant specific, but also different for first engine and second engine (or server). Very quickly the scheme falls victim to the maximum-flexibility-minimum-usefulness principle.

I think the option of having a different shortcut for a WinBoard that only can play Shatranj is a very acceptable work-around for a problem that is really someone else's fault.

An alternative would be to allow alternate piece naming on any of the variants, using names of FIDE Chess pieces as much as possible, and switch that on by ticking a box in the 'new variant...' menu as you select the variant.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Winboard_F and shatranj and ics play

Postby H.G.Muller » 23 Dec 2007, 17:02

OK, I think I fixed it. Part of the observed symptoms were due to what I already suspected above: in the 'ApplyMove' routine I overruled the entered promotion character by a hard 'f', and this was not compatible with redefining the piece names. I fixed that by using PieceToChar(BlackFerz) in stead.

But the fact that you had to redefine piece names at all was due to another bug: I simply had forgotten to define the pieceToCharTable on a variant switch to variantShatranj at all. So it would use the default table for FIDE Chess, which did define the pieces B and Q, for use in FEN and SAN, but of course as normal Bishop and Queen, not as Elephant and Ferz. And E and F remained undefined pieces. So it would never have been possible to play Shatranj without defining a user pieceToChar mappping, and such a mapping would always interfere with other games. Not even with servers or engines that would use E and F as piece names.

So I now put in a call to SetPieceToCharTable() when initializing for Shatranj, and to remain compatible to old WinBoard versions I use the characters B for Elephant and Q for Ferz as variant defaults (however obnoxious that might be). That should cure all problems, without any need for a /pieceToCharTable option. At startup the K and Q are now put in the right place, and when pasting in a FEN with B and Q, the symbols for Elephant and Ferz appear. Promotion is always to Ferz. You can freely switch to other variants. The only thing that still looks a bit stupid is that it asks what you would like to promote to, and whatever you select, gives you a Ferz. I will fix that in a future release too.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Winboard_F and shatranj and ics play

Postby PulsarMike » 15 Jan 2008, 22:59

hi,

I'm going to release a beta sometime soon, today tommrow probably, of pulsar that can play shatranj, includes a tiny book and handicapping ablity as well. I was wondering what is the link to the most current winboard_f so i can link to it on my beta page. Also what is the link to the winboard_f home page ( i recall some confusion early on were it was on one page then somone volunteered another page) and from that page is it obvious were the link to the most current winboard_f is?

thanks
Mike adams
www.adam16mr.org/pulsar.html
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Re: Winboard_F and shatranj and ics play

Postby H.G.Muller » 16 Jan 2008, 00:03

I have a page describing WinBoard_F, with lots of screenshots, on my website, at

http://home.hccnet.nl/h.g.muller/winboardF.html

It containst links to all the sites that host it for download.
The most recent unreleased version is alpha.tst, but I hope to release it soon. I still have to check out the FRC stuff, and when it works, generalize it to CRC (and shuffle-Shatranj... :D ). And I am currently working on implementing secondary and tertiary time controls through an extended level command. To activate them (for engines that support them), one would have to type someting like:

40+25/15+0/5

in the field where one would normally type the time in the time-control menu, to get the specified number of moves (in another field) in 40 minutes, then 25 moves in 10 minutes, and then the rest of the game in 5 minutes. In stead of minutes you can of course also give min:sec everywhere. For time-odds games you would enter

40|20+25/15|7:30+0/5|2:30

to have black play twice as fast.

Is the problem with the ICS in Shatranj completely solved now?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Winboard_F and shatranj and ics play

Postby PulsarMike » 16 Jan 2008, 01:35

i had scrapped working with winboard f in favor of winboard_x modified to support shatranj, but in preparing a release i was thinking winboard-f would be best due to piece support ( graphical piece set ) and i believe f handles game results and legality.

I reread your post and noticed you no longer have to use a piece to char table at all for shatranj were you have p-n-b-r-q-k pieces ( i believe is this ics only?) which makes me more interested in it so i'll test it tonight.

On my last test i ran out of time trying to figure out how to set up a piece to char table again ( i had deleted my orgiinal bat file that had one) and i never got back to it.

Mike
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Re: Winboard_F and shatranj and ics play

Postby PulsarMike » 16 Jan 2008, 01:38

on the subject of ics play on icc and also in this case fics, existing crazyhouse engines, my program plays as well as others like sunsetter and sjeng, all use p-b-n-r-q-k for the pieces and the ics ( fics icc others ) use this as well. I noticed there are piece to char values for crazyhouse pieces ( i think promoted queens etc) Will this be an issue for my program and others that use standard chess pieces? I havent done any testing with winboardf and crazyhouse.

Mike
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Re: Winboard_F and shatranj and ics play

Postby PulsarMike » 16 Jan 2008, 03:40

unfortunately no it still cant play on icc. I couldnt get it to run without a piece to char table for starters. It wouldnt accept the bishop jumping over pieces by me when i played against it.

when i used a piece to char ( the same one i used at the top of this thread) it ran ok but at the end of the game, after promotions it hanged.

this was in the debug log:

<ICS: No such command (f7f8=F).\015\012aics%

Mike
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Re: Winboard_F and shatranj and ics play

Postby H.G.Muller » 16 Jan 2008, 11:35

Could you send me the debug file for the case where you run without piece to char table?

What is the appearance of the Alfil when it refuses it jumping over a piece? Does it look like a Bishop or like an Elephant?

It almost sounds like the ICS switches the variant back to normal.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Winboard_F and shatranj and ics play

Postby PulsarMike » 17 Jan 2008, 08:51

the debug file can be found at:

www.adam16mr.org/stuff/shatdebug1-16-08.zip

its a rtf or word pad document inside the zip file. I cut out from the beginning of the games inception to the quit command i typed when it hanged on move 1.. when i played a bishop jump. I had move legality off and was not using a piece to char table. the error message was could not parse move from ics. I only have the alpha.txt file which i renamed alpha.exe and do not have any pieces sets. Dont know if this factors into that. I couldnt find the piece sets originally. It seems when i look at the winboard that pieces are invisible at times on board but it normally just plays on and i can observe it on icc.

Mike
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Re: Winboard_F and shatranj and ics play

Postby H.G.Muller » 17 Jan 2008, 11:49

If you play without font-based rendering (so using the native WB bitmaps) the non-FIDE pieces (as yet) are only defined in board sizes Bulky and Middling (and for the alpha.tst some in Petite). In other board sizes they show up as empty squares. This should not affect operation: the pieces are there, it is just that WB doesn't know how to display them.

Note that WB not only changes board size through the "options->board ... " menu, but also when you grab and drag the window with the mouse. Sometimes also when your only intention was to displace it, rather than resize it. This is annoying. But I suppose eventually all board sizes will have bitmaps for the fairy pieces, or at least for the more common ones (A, C, E and F, to allow Gothic and Shatranj at all sizes).

As to the problem: from the debug I can see that WB uses the mapping for FIDE chess. So it interprets "B" as Bishop, (piece code 19), and it probably was was also displayed like a Bishop, rather than an Elephant. Yet it must have been aware that the variant was Shatranj, as it does not generate Pawn double moves during its legality test.

My current best guess is that WB somehow skips the 'InitPosition' routine (which I also made redefines the piece-to-char table in a way suitable for the variant) when the variant is switched by the ICS, rather than from the menu. Indeed it is not really needed to set up an initial position in ICS mode, as the ICS sends the current board position before every move. But redefining the piec-to-char map is of course essential, and it should not be possible to skip it. I will see if I can fix it this evening.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Winboard_F and shatranj and ics play

Postby PulsarMike » 17 Jan 2008, 18:47

One issue that comes to mind, and i think it occured in the game that i used the piece to char and it failed, was that if you map a q to f, needed to interpert icc queen moves, if the engine promotes a7a8q it send it back to icc as a7a8f.

Mike
User avatar
PulsarMike
 
Posts: 83
Joined: 27 Nov 2007, 00:01
Location: California

Next

Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 13 guests