Shartranj!

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

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

Shartranj!

Post by hgm »

For those interested in variants:

I opened my live viewing port to my Chess PC for broadcasting Shatranj games. (You might have to click 'refresh' once to make the game start, first time you browse there.)

Currently I am playing 40/5' games of Fairy-Max vs. Pulsar there; I hope to add Dabbaba to the playing list soon. (For some reason WinBoard did not accept Dabbaba's moves as legal. I still have to look at the debug files to diagnose the problem.)
User avatar
Jim Ablett
Posts: 1384
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Shartranj!

Post by Jim Ablett »

hgm wrote:For those interested in variants:

I opened my live viewing port to my Chess PC for broadcasting Shatranj games. (You might have to click 'refresh' once to make the game start, first time you browse there.)

Currently I am playing 40/5' games of Fairy-Max vs. Pulsar there; I hope to add Dabbaba to the playing list soon. (For some reason WinBoard did not accept Dabbaba's moves as legal. I still have to look at the debug files to diagnose the problem.)
Hi Harm,

I think this is a bug in Winboard-F. Winboard-F accepts of course coords with optional piece letter in front (perfectly legal)
which Dabbaba sends, e.g Nb1-d2 but it doesn't accept Shatranj piece letters in front 'E' or 'F'.

I've modified Dabbaba not to send the piece letter and this is working ok.
Download here >
http://www.mediafire.com/?7vzy0e4khvi

This version should play better too. A serious bug was found which cause zero evaluation of pawns.

regards,
Jim.
User avatar
hgm
Posts: 27811
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Shartranj!

Post by hgm »

OK, I suspected that the problem would be caused by sending moves in SAN. I am not sure why it did not occur before; I remember I did play Dabbaba against Fairy-Max, and I do't remember having made a version of Fairy-Max using alternate piece names in Shatranj.

The problem is that WinBoard uses Elephant B and Ferz = Q in Shatranj. Obnoxious as that is, I saw no other solution, as this game is played on ICC, and ICC uses those names for the pieces there. Plus that there already existed WB engines that played Shatranj, (Pulsar), and they use those piece indicators too. (Since they want to be able to play on ICC, of course.) I did not feel like altering the logic of WinBoard to allow the use of different piece names on ICS compared to what the engines are using.

So I decided to stick with the existing 'standard', using B and Q in stead of E and F in Shatranj. This can be changed with the /pieceToCharTable option, but the problem is that it would change it for both engines. (This limits the usefulness of this option. Perhaps I should rethink it, and supply options /firstPiceToChartable and /secondPieceToCharTable. If it was only for sending setboard FENs that would still be doable, but for parsing moves coming from the engine it would be a disaster, as the move parser is called all over the place to parse moves from a large number of sources. In fact allowing the engines to send moves in SAN is a very bad idea from the start. It can only invite trouble, because SAN is dependent on piece naming (which is language dependent) and relies on exact knowledge of the game rules (for disambiguation). I can only rcommend that engines should never do it, especially not in variants. Perhaps I should add this to the protocol definition. But even in long algebraic notation the problem of promotion-piece indicators will occur.)
Tony

Re: Shartranj!

Post by Tony »

hgm wrote:OK, I suspected that the problem would be caused by sending moves in SAN. I am not sure why it did not occur before; I remember I did play Dabbaba against Fairy-Max, and I do't remember having made a version of Fairy-Max using alternate piece names in Shatranj.

The problem is that WinBoard uses Elephant B and Ferz = Q in Shatranj. Obnoxious as that is, I saw no other solution, as this game is played on ICC, and ICC uses those names for the pieces there. Plus that there already existed WB engines that played Shatranj, (Pulsar), and they use those piece indicators too. (Since they want to be able to play on ICC, of course.) I did not feel like altering the logic of WinBoard to allow the use of different piece names on ICS compared to what the engines are using.

So I decided to stick with the existing 'standard', using B and Q in stead of E and F in Shatranj. This can be changed with the /pieceToCharTable option, but the problem is that it would change it for both engines. (This limits the usefulness of this option. Perhaps I should rethink it, and supply options /firstPiceToChartable and /secondPieceToCharTable. If it was only for sending setboard FENs that would still be doable, but for parsing moves coming from the engine it would be a disaster, as the move parser is called all over the place to parse moves from a large number of sources. In fact allowing the engines to send moves in SAN is a very bad idea from the start. It can only invite trouble, because SAN is dependent on piece naming (which is language dependent) and relies on exact knowledge of the game rules (for disambiguation). I can only rcommend that engines should never do it, especially not in variants. Perhaps I should add this to the protocol definition. But even in long algebraic notation the problem of promotion-piece indicators will occur.)
For every game, decide on an order. Then use a number (or letter) to indicate the index. (A=King, B=queen, C=Rook)

Normally, don't use it e2e4 g8f6, but for promotion use g7g8C

That should also solve dropping-piece-games (D@b4)

Enable it with a feature command. That way, you at least give everybody the possibility to choose for a standard.

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

Re: Shartranj!

Post by hgm »

I still have problems. Dabbaba won't move. I guess it chokes on the FEN for the initial position, because it has B and Q in it.

(Unfortunately I have to play from a setup position, as Pulsar does not use a correct opening array if you let it play without sending a setboard first.)

Can you make it such that Dabbaba will never use E and F when playing Shatranj, (not even as promochar) and understand B as an Elephant and Q as a Ferz on input for setting up positions?
User avatar
Jim Ablett
Posts: 1384
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Shartranj!

Post by Jim Ablett »

hgm wrote:OK, I suspected that the problem would be caused by sending moves in SAN. I am not sure why it did not occur before; I remember I did play Dabbaba against Fairy-Max, and I do't remember having made a version of Fairy-Max using alternate piece names in Shatranj.

The problem is that WinBoard uses Elephant B and Ferz = Q in Shatranj. Obnoxious as that is, I saw no other solution, as this game is played on ICC, and ICC uses those names for the pieces there. Plus that there already existed WB engines that played Shatranj, (Pulsar), and they use those piece indicators too. (Since they want to be able to play on ICC, of course.) I did not feel like altering the logic of WinBoard to allow the use of different piece names on ICS compared to what the engines are using.

So I decided to stick with the existing 'standard', using B and Q in stead of E and F in Shatranj. This can be changed with the /pieceToCharTable option, but the problem is that it would change it for both engines. (This limits the usefulness of this option. Perhaps I should rethink it, and supply options /firstPiceToChartable and /secondPieceToCharTable. If it was only for sending setboard FENs that would still be doable, but for parsing moves coming from the engine it would be a disaster, as the move parser is called all over the place to parse moves from a large number of sources. In fact allowing the engines to send moves in SAN is a very bad idea from the start. It can only invite trouble, because SAN is dependent on piece naming (which is language dependent) and relies on exact knowledge of the game rules (for disambiguation). I can only rcommend that engines should never do it, especially not in variants. Perhaps I should add this to the protocol definition. But even in long algebraic notation the problem of promotion-piece indicators will occur.)
Ok, I switched Dabbba back to 'B' & 'Q' to make it compliant with existing standard.
Download here >
http://www.mediafire.com/?hazo7f9yltr

Jim.
User avatar
hgm
Posts: 27811
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Shartranj!

Post by hgm »

Well, it still doesn't work. Seems Dabbaba sends something that is not recognized as a move, as '_' is not recognized by the WinBoard parser as a captital that could be a piece name. So the line _f1-g3 below is simply ignored. So the game hangs, while WinBoard is waiting for a move from Dabbaba.

It seems a bit strange too that even without the '_' prefix g1-f3 would be a white move, while Dabbaba is playing black...

Code: Select all

27577 >first : variant shatranj
27577 >first : ics -
27577 >first : level 40 1 0
27578 >first : post
27578 >first : hard
27578 >first : easy
27578 >first : ping 2
27578 >first : force
write FEN 50-move: 0 0 0
e0. p=-1
27579 >first : setboard rnbkqbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBKQBNR w 0 1
EditPosDone
27582 <first &#58; playing shatranj
27582 <first &#58; 
27582 <first &#58; 
27583 <first &#58; Ready for a new game now...
27583 <first &#58; 
27583 <first &#58; 
27583 <first &#58; 
27583 <first &#58; 
27583 <first &#58; 
27583 <first &#58; 
27583 <first &#58; 
27584 <first &#58; 
27584 <first &#58; 
27584 <first &#58; pong 2
27584 <first &#58; 
27584 <first &#58; 
release
-1 -1 -1 -1 -1 -1 Legality test? e2e3
TC string = '+40/1'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=0 &#40;4,1&#41;-&#40;4,2&#41; -
-1 -1 -1 -1 -1 -1 Legality test? e2e3
movetype=31, promochar=0=-
move&#58; e2e3
, parse&#58; e3 (
)
39346 >first &#58; e2e3
59668 >first &#58; name hgm
59669 >first &#58; white
time odds&#58; 1 1 
59669 >first &#58; time 6000
59669 >first &#58; otim 6000
59669 >first &#58; black
go
nps&#58; w=-1, b=-1
59670 <first &#58; 
59670 <first &#58; 
59670 <first &#58; 
59670 <first &#58; 
59671 <first &#58; &#91;dabbaba&#93; move no.1
59671 <first &#58; _g1-f3 
59671 <first &#58; 
59671 <first &#58;   sel.depth=2g1f3 
GameEnds&#40;38, aborted, 2&#41;
GameEnds&#40;38, aborted, 2&#41; clock stopped
GameEnds&#40;38, aborted, 2&#41; after test
78184 >first &#58; result * &#123;aborted&#125;
78184 >first &#58; quit
User avatar
Jim Ablett
Posts: 1384
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Shartranj!

Post by Jim Ablett »

hgm wrote:Well, it still doesn't work. Seems Dabbaba sends something that is not recognized as a move, as '_' is not recognized by the WinBoard parser as a captital that could be a piece name. So the line _f1-g3 below is simply ignored. So the game hangs, while WinBoard is waiting for a move from Dabbaba.

It seems a bit strange too that even without the '_' prefix g1-f3 would be a white move, while Dabbaba is playing black...

Code: Select all

27577 >first &#58; variant shatranj
27577 >first &#58; ics -
27577 >first &#58; level 40 1 0
27578 >first &#58; post
27578 >first &#58; hard
27578 >first &#58; easy
27578 >first &#58; ping 2
27578 >first &#58; force
write FEN 50-move&#58; 0 0 0
e0. p=-1
27579 >first &#58; setboard rnbkqbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBKQBNR w 0 1
EditPosDone
27582 <first &#58; playing shatranj
27582 <first &#58; 
27582 <first &#58; 
27583 <first &#58; Ready for a new game now...
27583 <first &#58; 
27583 <first &#58; 
27583 <first &#58; 
27583 <first &#58; 
27583 <first &#58; 
27583 <first &#58; 
27583 <first &#58; 
27584 <first &#58; 
27584 <first &#58; 
27584 <first &#58; pong 2
27584 <first &#58; 
27584 <first &#58; 
release
-1 -1 -1 -1 -1 -1 Legality test? e2e3
TC string = '+40/1'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=0 &#40;4,1&#41;-&#40;4,2&#41; -
-1 -1 -1 -1 -1 -1 Legality test? e2e3
movetype=31, promochar=0=-
move&#58; e2e3
, parse&#58; e3 (
)
39346 >first &#58; e2e3
59668 >first &#58; name hgm
59669 >first &#58; white
time odds&#58; 1 1 
59669 >first &#58; time 6000
59669 >first &#58; otim 6000
59669 >first &#58; black
go
nps&#58; w=-1, b=-1
59670 <first &#58; 
59670 <first &#58; 
59670 <first &#58; 
59670 <first &#58; 
59671 <first &#58; &#91;dabbaba&#93; move no.1
59671 <first &#58; _g1-f3 
59671 <first &#58; 
59671 <first &#58;   sel.depth=2g1f3 
GameEnds&#40;38, aborted, 2&#41;
GameEnds&#40;38, aborted, 2&#41; clock stopped
GameEnds&#40;38, aborted, 2&#41; after test
78184 >first &#58; result * &#123;aborted&#125;
78184 >first &#58; quit
I think there is a bug in Dabbaba setboard command. Dabbaba actually doesn't need to be fed the opening postition with setboard. It's set internally after the new command. I could disable setboard (setboard=0)
till a fix is done.

Jim.
User avatar
hgm
Posts: 27811
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Shartranj!

Post by hgm »

True, according to WB protocol the setboard is not needed here. (At least, I suppose Dabbaba starts with Kings on d1/d8?) The problem is that its opponent (Pulsar) is buggy and needs the setboard, and that there is no way to tell WinBoard to send the setboard only to one engine.

But of course we could have wanted to start from a shuffled position, and then there would be no way around the setboard.

I think that feature setboard=0 would not work, unless Dabbaba also implements the WB edit command. (which is kind of unusual for engines that know setboard).
adams161
Posts: 626
Joined: Sun May 13, 2007 9:55 pm
Location: Bay Area, CA USA
Full name: Mike Adams

Re: Shartranj!

Post by adams161 »

i think i'm going to set up pulsar to play shatranj without set board by the end of the weekend, were not takling about a huge job there ( just flip king and queen ). I was tweaking it last night but i had other concerns as well namely 1) how is book working ( -33 which i uploaded last night seems to be the one that can play with book with setboard ) 2) i think i found out why it was hanging ( i had changed some scoring and i asked it not to move if it was game over but the scoring change might have confused it ( so let me know if it hangs before game completes and 3) i'm most curious about winboard_f's fischer random support since i'm preety sure my own engine can handle fiscer random with the right interface ( i had no problems with xboard960 and pulsar ). Well i left it running last night and it got 17 or so games of fr ( before windows update rebooted me but i got everythign back on line this morning ) and no flags so that is good.

Mike