It seems that ChessV only knows the baring rule at game level, but not in search. If there is baring, it claims (after the move, i.e. according to WinBoard one move too early), but on the move before it did not show a mate score. In fact it seems incredibly naive about it, and ShaMax exploits this incredibly well. I do a 40moves/min match ShaMax-ChessV now, and ShaMax leads by 37+, 0-, 25=. Although in the middle-game it is at -1 often enough. Many nearly-equal end-games it eventually wins by baring.
The version I am running (the private development version that also does Xiangqi and Spartan) is a bit unstable, however. Windows has thrown 5 popups so far that "ChessV.exe is no longer working". Funny thing is that this seems to hang its GUI window, (it grays out), but that it continues playing through WinBoard like nothing happened.
Chess variant tournament: Shatranj
Moderator: Ras
-
hgm
- Posts: 28491
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
-
enhorning
- Posts: 342
- Joined: Wed Jan 05, 2011 10:05 pm
Re: Chess variant tournament: Shatranj
I'm still not getting it to work - the error message now is that it exits unexpectedly.hgm wrote:OK, I managed to make it play. To circumvent the piece-naming problem, you have to make a shatranj.sgf file in the ChessV folder, containing the lines:
(Not sure the last line is important, as you cannot promote to Elephant in Shatranj.)Code: Select all
ICS Shatranj:shatranj $array="rnbkqbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBKQBNR" change-piece-name("Ferz", "Queen", "Q") change-piece-name("Elephant", "Bishop", "B")
You can then install ChessV through the Load Engine dialog with
.exe: ChessV_WinBoard.exe (point out by browsing to automatically set directory)
command-line parameters: shatranj.sgf
Special WinBoard options: -xreuse -firstFeatures "ping=1"
Tick checkboxes "WB protocol v1" and "Force current variant with this engine" (assuming you already set WinBoard for Shatranj).
That should do it, and give you the engine line in the winboard.ini file
"ChessV_WinBoard.exe shatranj.sgf" -fd "C:\Engines\ChessV" -variant shatranj -firstProtocolVersion 1 -xreuse -firstFeatures "ping=1"
This fully repairs ChessV's ping support, but suppresses the misleading info ChessV gives about the variants it supports. Not sure if the -xreuse was really needed, but better safe than sorry.
I created the shatranj.sgf file (copied & pasted from what you wrote) in C:\WinBoard-4.7.0\ChessV , and added it as a new engine through the dialog box, which gave me this line in my .ini-file:
"ChessV_WinBoard.exe shatranj.sgf" -fd "C:\WinBoard-4.7.0\ChessV" -firstProtocolVersion 1 -variant shatranj -xreuse -firstFeatures "ping=1"
-
hgm
- Posts: 28491
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Chess variant tournament: Shatranj
Oh sh**, my bad. I had to retype the contents of the file her, because I did the test where I had ChessV installed, which was on a machine without internet connection. And of course the variant names ChessV uses internally are all capitalized. So in the first line, which specifies behind the colon from which base variant ('Shatranj') this sub-variant ('ICS Shatranj') is derived, the 'Shatranj' should have started with upper-case S:
Sorry about that.
Code: Select all
ICS Shatranj:Shatranj
$array="rnbkqbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBKQBNR"
change-piece-name("Ferz", "Queen", "Q")
change-piece-name("Elephant", "Bishop", "B") -
enhorning
- Posts: 342
- Joined: Wed Jan 05, 2011 10:05 pm
Re: Chess variant tournament: Shatranj
Great, that works now (with ChessV popping up its own user interface in a Window as well, but I guess I can just ignore that). I assume the way to get it to play other chess variants through Winboard (e.g. Grand Chess) is similar?
Going to run it through the gauntlet of the other programs (at blitz), but hopefully, no further problems should arise.
Going to run it through the gauntlet of the other programs (at blitz), but hopefully, no further problems should arise.
-
hgm
- Posts: 28491
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Chess variant tournament: Shatranj
Indeed, this set of work-arounds should work in general. Running it as WB v1 engine subverts WinBoard's testing if the engine plays the requested variant, with the -firstFeatures option (which is new in WB 4.7.0) you can then repair the essential features by providing them 'by hand'.
As to getting ChessV (which ignores the WB variant command completely) to play a certain variant, the simple method is to name the internal ChessV variant name (which you can see if you use it through its own interface) on its command line. This can sometimes be tricky, because it requires the ChessV engine command to contain a space (between ChessV.exe and the variant name), while many variant names also contain spaces. So it might require nested quoting. Like
'ChessV_WinBoard.exe "Capablanca Chess"'
In cases like this the parameters on the engine command line always need double quotes, while the total engine line (passed as WinBoard's -fcp option) must use the single quotes to not conflict with it. This is what WinBoard does automatically, however, when you specify "Capablanca Chess" (including the quotes) in the command-line parameters field of the Load Engine dialog.
This simple method does not work if ChessV uses other piece naming (messing up promotion moves), or if the name is too troublesome (containing quotes itself). In that case there exists the more complex method of defining the variant in an SGF file, and naming that in ChessV's engine command:
"ChessV_WinBoard.exe filename.sgf"
The file needs to at least contain a line for defining the base variant, as
new name:base variant
Then it will always need a line to set up the initial position, in FEN-like notation (but no stm field etc.)
$array="..."
The rest is optional as far as ChessV is concerned, but for WinBoard it is essential to at least define the correct letters for pieces that can be promoted to. The ChessV distribution contains a text file to explain what you can configure with such an SGF file. For Grand Chess I suppose you have to redefine piece names as well, I am not sure if WB and ChessV use the same name for the RN compound. I wonder if there could be a problem with rank numbering, though. WinBoard starts counting ranks at 0 for 10-deep boards.
As to getting ChessV (which ignores the WB variant command completely) to play a certain variant, the simple method is to name the internal ChessV variant name (which you can see if you use it through its own interface) on its command line. This can sometimes be tricky, because it requires the ChessV engine command to contain a space (between ChessV.exe and the variant name), while many variant names also contain spaces. So it might require nested quoting. Like
'ChessV_WinBoard.exe "Capablanca Chess"'
In cases like this the parameters on the engine command line always need double quotes, while the total engine line (passed as WinBoard's -fcp option) must use the single quotes to not conflict with it. This is what WinBoard does automatically, however, when you specify "Capablanca Chess" (including the quotes) in the command-line parameters field of the Load Engine dialog.
This simple method does not work if ChessV uses other piece naming (messing up promotion moves), or if the name is too troublesome (containing quotes itself). In that case there exists the more complex method of defining the variant in an SGF file, and naming that in ChessV's engine command:
"ChessV_WinBoard.exe filename.sgf"
The file needs to at least contain a line for defining the base variant, as
new name:base variant
Then it will always need a line to set up the initial position, in FEN-like notation (but no stm field etc.)
$array="..."
The rest is optional as far as ChessV is concerned, but for WinBoard it is essential to at least define the correct letters for pieces that can be promoted to. The ChessV distribution contains a text file to explain what you can configure with such an SGF file. For Grand Chess I suppose you have to redefine piece names as well, I am not sure if WB and ChessV use the same name for the RN compound. I wonder if there could be a problem with rank numbering, though. WinBoard starts counting ranks at 0 for 10-deep boards.
-
Evert
- Posts: 2929
- Joined: Sat Jan 22, 2011 12:42 am
- Location: NL
Re: Chess variant tournament: Shatranj
I need a function to rename (or alias) piece-names in Sjaak. Would solve some of these problems (by the way, you do need to redefine Elephant->Bishop for Shatranj iff you intend to start from a FEN rather than the initial position).hgm wrote: For Grand Chess I suppose you have to redefine piece names as well, I am not sure if WB and ChessV use the same name for the RN compound. I wonder if there could be a problem with rank numbering, though. WinBoard starts counting ranks at 0 for 10-deep boards.
I also need to make it possible to report defined variants (in the config file) using "feature variants" rather than just listing them in the drop-down menu for variant "fairy".
Sjaak actually relabels the ranks with base 0 (instead of 1) when it is switched to XBoard mode.
-
hgm
- Posts: 28491
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Chess variant tournament: Shatranj
Indeed, Fairy-Max also derives its feature variants command from what it finds in the fmax.ini file. If the name defined there is fairy/something then it puts something in the combo option.
Shatranj FENs sent by WinBoard would also contain B and Q. In WinBoard this is all controlled by the /pieceToCharTable, which by default is "PN.R.QBKpn.r.qbk" in Shatranj. WinBoard uses the same pieceToCharTable for engine communication (setboard/edit, and promo-piece in long-algebraic) and for external communication (copy-paste of FENs, reading/writing of SAN). I once considered to split that, so it could be defined per engine, but I was not sure this would be a good idea.
I did make it possible for WinBoard to read non-standard FEN and promo-piece by allowing defenition of /pieceNickNames. This would give a pieceToCharTable only used on reading, before the regular pieceToCharTable, which then is only used if the piece ID could not be found amongst the nicknames. This mainly to allow WinBoard to read games in localized notation (e.g. /pieceNickNames="BSLTDKbsltdk" to read German games, etc.).
Note that starting at 0 is only for boards of depth>9, and that there has been discussion in the past whether it should be used only for boards with 10 ranks, and larger boards should again start counting at 1. The conclusion was that we should only do it for exactly 10 ranks. At that time this was a moot point, as WinBoard did not support any variants with more than 10 ranks, and could not process double-digit rank numbers at all. This is now fixed in 4.7.0 as well as the Alien Edition, however. The Alien Edition still did seem to start at 0 for 12x12 boards, so that is what I used for HaChu as well. (I wrote it such that it can be easily changed, by #defining a macro ONE as (ranks < 10), and using that in all coordinate conversions).
Shatranj FENs sent by WinBoard would also contain B and Q. In WinBoard this is all controlled by the /pieceToCharTable, which by default is "PN.R.QBKpn.r.qbk" in Shatranj. WinBoard uses the same pieceToCharTable for engine communication (setboard/edit, and promo-piece in long-algebraic) and for external communication (copy-paste of FENs, reading/writing of SAN). I once considered to split that, so it could be defined per engine, but I was not sure this would be a good idea.
I did make it possible for WinBoard to read non-standard FEN and promo-piece by allowing defenition of /pieceNickNames. This would give a pieceToCharTable only used on reading, before the regular pieceToCharTable, which then is only used if the piece ID could not be found amongst the nicknames. This mainly to allow WinBoard to read games in localized notation (e.g. /pieceNickNames="BSLTDKbsltdk" to read German games, etc.).
Note that starting at 0 is only for boards of depth>9, and that there has been discussion in the past whether it should be used only for boards with 10 ranks, and larger boards should again start counting at 1. The conclusion was that we should only do it for exactly 10 ranks. At that time this was a moot point, as WinBoard did not support any variants with more than 10 ranks, and could not process double-digit rank numbers at all. This is now fixed in 4.7.0 as well as the Alien Edition, however. The Alien Edition still did seem to start at 0 for 12x12 boards, so that is what I used for HaChu as well. (I wrote it such that it can be easily changed, by #defining a macro ONE as (ranks < 10), and using that in all coordinate conversions).
-
enhorning
- Posts: 342
- Joined: Wed Jan 05, 2011 10:05 pm
Re: Chess variant tournament: Shatranj
Okay, I've started the tournament.
6 double-round robin cycles (opening moves 1. d3, 1. e3, 1. Nc3, 1. Nf3, 1. Bd3, 1. Be3, as suggested by various programs). 8 participants, so that means 330 games in total.
Tiyaga 1.0
Nebiyu 1.43
Sjaak 5.24
ShaMax 4.8S
HaChu 0.5beta
ChessV
Pulsar 2009-9b
Dabbaba 6.52 JA
1-cpu, 40 moves in 20 minutes, 512 megabyte hash (for those program that take it from the interface or where I've seen how to set it in the .ini-file - not all programs are using that much memory).
Running two matches concurrently for now... hope to up that to four matches concurrently once a few other things I am running wrap up.
Hoping for some enjoyable games here - this is a variant I quite enjoy watching and occasionally playing myself!
6 double-round robin cycles (opening moves 1. d3, 1. e3, 1. Nc3, 1. Nf3, 1. Bd3, 1. Be3, as suggested by various programs). 8 participants, so that means 330 games in total.
Tiyaga 1.0
Nebiyu 1.43
Sjaak 5.24
ShaMax 4.8S
HaChu 0.5beta
ChessV
Pulsar 2009-9b
Dabbaba 6.52 JA
1-cpu, 40 moves in 20 minutes, 512 megabyte hash (for those program that take it from the interface or where I've seen how to set it in the .ini-file - not all programs are using that much memory).
Running two matches concurrently for now... hope to up that to four matches concurrently once a few other things I am running wrap up.
Hoping for some enjoyable games here - this is a variant I quite enjoy watching and occasionally playing myself!
-
hgm
- Posts: 28491
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Chess variant tournament: Shatranj
Nice turn-up, 8 engines. When I first made ShaMax there was only Pulsar. (ChessV was not yet WB compatible at that time). Actually ShaMax was just Fairy-Max then; the match with Pulsar demonstrated the importance of knowing the baring rule and that stalemate is a loss, which led to the ShaMax patch. Jim Ablett tried to convert another engine to it, but this was not a success: its idea of King safety was that (without castling rights) it would immediately step its King to g1, locking in the Rook at h1, which subsequently would never get into the game. 
The conclusion was that changing the move generator was not enough to make a Shatranj engine. (While for Knightmate thi worked quite well.)
Sorry I could not find the time to make Spartacus play Shatranj.
The conclusion was that changing the move generator was not enough to make a Shatranj engine. (While for Knightmate thi worked quite well.)
Sorry I could not find the time to make Spartacus play Shatranj.
-
enhorning
- Posts: 342
- Joined: Wed Jan 05, 2011 10:05 pm
Re: Chess variant tournament: Shatranj
Hmm... this game makes me wonder about Pulsar:
[Event "Computer Chess Game"]
[Site "ENHORNING"]
[Date "2013.03.01"]
[Round "1"]
[White "Pulsar2009-9b"]
[Black "HaChu 0.5beta"]
[Result "0-1"]
[TimeControl "40/1200"]
[Variant "shatranj"]
[Annotator "2. -0.12 1... -0.03"]
1. Nc3 Nf6 {-0.03/8 13} 2. Nf3 {-0.12/9 30} Nc6 {+0.00/7 3} 3. d3
{-0.08/9 30} d6 {-0.03/8 17} 4. h3 {-0.07/9 30} Qd7 {+0.00/7 4} 5. d4
{-0.01/9 30} Qe6 {+0.00/8 20} 6. Ng5 {+1.06/9 30} Nxd4 {+0.84/8 15} 7. e3
{+2.52/10 30} Nc6 {+0.84/8 9} 8. Bd3 {-0.40/9 30} h6 {+0.86/8 17} 9. Nf3
{-1.54/9 30} h5 {+0.85/8 26} 10. Ng5 {-0.48/9 30} h4 {+0.90/8 25} 11. g3
{-0.39/9 30} hxg3 {+0.98/8 21} 12. fxg3 {-0.82/9 30} Rh5 {+0.93/8 37} 13.
h4 {-0.81/9 30} Ng4 {+1.03/7 12} 14. Rf1 {+0.35/9 30} f6 {+0.87/8 38} 15.
Rf4 {-1.66/9 30} Nge5 {+0.87/8 13} 16. Nge4 {-1.91/9 30} Ng6 {+1.00/7 10}
17. Rf2 {-1.84/9 30} Qd5 {+1.04/7 9} 18. Nxf6 {+6.46/9 30} gxf6
{+3.05/8 11} 19. Rf5 {+1.26/9 30} Rxf5 {+3.12/9 25} 20. Bxf5 {-4.82/10 30}
Qe6 {+3.09/9 45} 21. Bh3 {-4.84/10 30} Nge5 {+3.09/8 10} 22. a3
{-4.83/10 30} a6 {+3.09/8 12} 23. a4 {-4.81/10 30} a5 {+3.09/8 13} 24. b3
{-4.81/10 30} Ra6 {+3.11/8 14} 25. Ke2 {-4.80/10 30} Nb4 {+3.17/8 15} 26.
Qd2 {-4.80/10 30} Nxc2 {+3.90/8 12}
{Xboard: Forfeit due to invalid move: d2c2 (d2c2) res=23} 0-1
Along with seeing illegal moves due to it ignoring its King being in check, I wonder if Pulsar believes that it starts with the Kings on the e-file, instead of the d-file. I do know that the only place where I've played turn-based Shatranj (Scheming Mind), uses that starting set-up, with Kings on the e-file, as in normal chess.
[Event "Computer Chess Game"]
[Site "ENHORNING"]
[Date "2013.03.01"]
[Round "1"]
[White "Pulsar2009-9b"]
[Black "HaChu 0.5beta"]
[Result "0-1"]
[TimeControl "40/1200"]
[Variant "shatranj"]
[Annotator "2. -0.12 1... -0.03"]
1. Nc3 Nf6 {-0.03/8 13} 2. Nf3 {-0.12/9 30} Nc6 {+0.00/7 3} 3. d3
{-0.08/9 30} d6 {-0.03/8 17} 4. h3 {-0.07/9 30} Qd7 {+0.00/7 4} 5. d4
{-0.01/9 30} Qe6 {+0.00/8 20} 6. Ng5 {+1.06/9 30} Nxd4 {+0.84/8 15} 7. e3
{+2.52/10 30} Nc6 {+0.84/8 9} 8. Bd3 {-0.40/9 30} h6 {+0.86/8 17} 9. Nf3
{-1.54/9 30} h5 {+0.85/8 26} 10. Ng5 {-0.48/9 30} h4 {+0.90/8 25} 11. g3
{-0.39/9 30} hxg3 {+0.98/8 21} 12. fxg3 {-0.82/9 30} Rh5 {+0.93/8 37} 13.
h4 {-0.81/9 30} Ng4 {+1.03/7 12} 14. Rf1 {+0.35/9 30} f6 {+0.87/8 38} 15.
Rf4 {-1.66/9 30} Nge5 {+0.87/8 13} 16. Nge4 {-1.91/9 30} Ng6 {+1.00/7 10}
17. Rf2 {-1.84/9 30} Qd5 {+1.04/7 9} 18. Nxf6 {+6.46/9 30} gxf6
{+3.05/8 11} 19. Rf5 {+1.26/9 30} Rxf5 {+3.12/9 25} 20. Bxf5 {-4.82/10 30}
Qe6 {+3.09/9 45} 21. Bh3 {-4.84/10 30} Nge5 {+3.09/8 10} 22. a3
{-4.83/10 30} a6 {+3.09/8 12} 23. a4 {-4.81/10 30} a5 {+3.09/8 13} 24. b3
{-4.81/10 30} Ra6 {+3.11/8 14} 25. Ke2 {-4.80/10 30} Nb4 {+3.17/8 15} 26.
Qd2 {-4.80/10 30} Nxc2 {+3.90/8 12}
{Xboard: Forfeit due to invalid move: d2c2 (d2c2) res=23} 0-1
Along with seeing illegal moves due to it ignoring its King being in check, I wonder if Pulsar believes that it starts with the Kings on the e-file, instead of the d-file. I do know that the only place where I've played turn-based Shatranj (Scheming Mind), uses that starting set-up, with Kings on the e-file, as in normal chess.