Engine development to play a chess variant

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Engine development to play a chess variant

Post by Ferdy »

hgm wrote:Well, it is not really FEN-like to explicitly mention the location of each piece; the whole idea of FEN is that the location is implied by the ordering of the pieces.
The FEN was already done, it is for on-board pieces, side to move and others.
The extension I am proposing is for on-hand pieces and its ordering if there is.
If any piece in on-hand is placeable in any square then just use
FEN [CL] [-]
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Engine development to play a chess variant

Post by Evert »

Ferdy wrote:
hgm wrote:Well, it is not really FEN-like to explicitly mention the location of each piece; the whole idea of FEN is that the location is implied by the ordering of the pieces.
The FEN was already done, it is for on-board pieces, side to move and others.
The extension I am proposing is for on-hand pieces and its ordering if there is.
If any piece in on-hand is placeable in any square then just use
FEN [CL] [-]
There are already FEN strings for variants that include drops. I would stick as close as possible to something like Seirawan notation. Otherwise it just makes things needlessly complicated.
We don't need two or three incompaible wys todo essentially the same thing.

So I would go with "order matters" and explicitly list the gating moves independently from castling rights.

Having said that, I don't think it's likely that I'll implement this in SjaakII: it uses a "virgin state" for both castling rights and gating opportunities, so they cannot be separated easily. I'm not keen to introduce more bookkeeping in the board state because it will slow everything down. There may be a work-around if gating honours the drop-mask, but I need to check if I implemented that. If I did I would just need to tweak those after loading a new FEN, which isn't really any different from the castling masks. I'll see.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Engine development to play a chess variant

Post by hgm »

Ferdy wrote:
hgm wrote:Well, it is not really FEN-like to explicitly mention the location of each piece; the whole idea of FEN is that the location is implied by the ordering of the pieces.
The FEN was already done, it is for on-board pieces, side to move and others.
The extension I am proposing is for on-hand pieces and its ordering if there is.
If any piece in on-hand is placeable in any square then just use
FEN [CL] [-]
But I was asking for notation of stacks of pieces on the board...
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Engine development to play a chess variant

Post by Evert »

I have the following definition for Musketeer with Seirawan gating rules and without the Fortress in SjaakII:

Code: Select all

################
# Musketeerish #
################
Variant: Musketeerish
Board: 8x8
FEN: "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[EACOHDULeacohdul] w KQkq -"
XBoard pieces: "PNBRQ.EAC..O.....HD.ULKpnbrq.eac..o.....hd.ulk"
XBoard parent: "seirawan"

Zone: rank8 = a8,b8,c8,d8,e8,f8,g8,h8
Zone: rank7 = a7,b7,c7,d7,e7,f7,g7,h7
Zone: rank2 = a2,b2,c2,d2,e2,f2,g2,h2
Zone: rank1 = a1,b1,c1,d1,e1,f1,g1,h1

# Define the pieces
Piece: Knight
Move: leap (2,1)
Symbol: "N", "N,n"
Value: 320

Piece: Bishop
Move: slide (D,A)
Symbol: "B", "B,b"
Value: 325

Piece: Rook
Move: slide (H,V)
Symbol: "R", "R,r"
Value: 500

Piece: Queen
Move: slide (D,A,H,V)
Symbol: "Q", "Q,q"
Value: 950

Piece: Dragon
Move: slide (D,A,H,V)
Move: leap (2,1)
Symbol: "D", "D,d"
Value: 1200

Piece: Chancellor
Move: slide (H,V)
Move: leap (2,1)
Symbol: "C", "C,c"
Value: 875

Piece: Archbishop
Move: slide (A,D)
Move: leap (2,1)
Symbol: "A", "A,a"
Value: 825

Piece: Elephant
Move: leap (2,0)|(2,2)|(1,1)|(1,0)
Symbol: "E", "E,e"
Value: 500

Piece: Hawk
Move: leap (2,0)|(2,2)|(3,3)|(3,0)
Symbol: "H", "H,h"
Value: 300

Piece: Leopard
Move: leap (2,1)
Move: step 2NE,2NW,2SE,2SW
Symbol: "L", "L,l"
Value: 500

Piece: Cannon
Move: aleap (2,0)|(-2,0)|(0,2)|(0,-2)|(1,0)|(-1,0)|(0,1)|(0,-1)|(1,1)|(1,-1)|(-1,1)|(-1,-1)|(2,1)|(2,-1)|(-2,1)|(-2,-1)
Symbol: "O", "O,o"
Value: 500

Piece: Unicorn
Move: leap (2,1)|(3,1)
Symbol: "U", "U,u"
Value: 300

Piece: King
Move: leap (0,1)|(1,1)
Symbol: "K", "K,k"
Flags: royal
Castle: white e1-g1 with h1
Castle: white e1-c1 with a1
Castle: black e8-g8 with h8
Castle: black e8-c8 with a8

Piece: Pawn
Move: step N
Capture: step NE,NW
Special: rank2, rank7, step 2N
Symbol: " ", "P,p"
Flags: set_ep,take_ep
Promotion: rank8, rank1, "QRBN"
Value: 100

Rule: checkmate = win
Rule: stalemate = draw
Rule: repeat3 = draw
Rule: gate drops
It currently has all pieces defined in holdings, which is wrong, but you can feed it any FEN that only has two for each side and it will work fine. However, because it defines all pieces in the piece-to-char string , you run into an interface issue: XBoard's holding size needs to be larger than the board size to accomodate them all.
So really all possible combinations of pieces need to be defined as separate variants (to keep the holding size at 8) or SjaakII needs to send the setup command after setboard (when the pieces that participate are known), which I don't think is supposed to work for XBoard.

SjaakII produces the following move descriptors for the pieces, which look alright to me:

Code: Select all

piece N& N
piece B& B
piece R& R
piece Q& Q
piece D& QN
piece C& RN
piece A& BN
piece E& WFDA
piece H& DAHG
piece L& NF2
piece O& WFDllrrN
piece U& NC
piece K& KisO2
piece P& fmWfceFifmW2@7
Gating moves don't honour the piece-drop bitmasks, but that would be a one-line change.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Engine development to play a chess variant

Post by Ferdy »

hgm wrote:
Ferdy wrote:
hgm wrote:Well, it is not really FEN-like to explicitly mention the location of each piece; the whole idea of FEN is that the location is implied by the ordering of the pieces.
The FEN was already done, it is for on-board pieces, side to move and others.
The extension I am proposing is for on-hand pieces and its ordering if there is.
If any piece in on-hand is placeable in any square then just use
FEN [CL] [-]
But I was asking for notation of stacks of pieces on the board...
So what exactly is this "notation of stacks of pieces on the board"?
I proposed this format.

Code: Select all

<on-board pieces> <side to move> <castling rights> <ep> <hmvc> <fmvn> <on-hand pieces> <on-hand piece drop squares>
Then you ask me this,
HGM wrote:How else could you write a FEN-like position description for the general case of games that allow stacking of multiple pieces on the same square?
And I answer that with this,
Ferdy wrote:White Cannon, and Leopard at b1

Code: Select all

FEN &#91;CL&#93; &#91;b1,b1&#93;
FEN = the std. six fields.

What I have added are the 7th and 8th fields and those are
[CL] [b1,b1]
Here the Cannon C must be droped in b1 sq, and the Leopard L must be be dropped in b1 too. So the C and L are stacked in b1 square.

Something like.

Code: Select all

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 &#91;CL&#93; &#91;b1,b1&#93;
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Engine development to play a chess variant

Post by hgm »

OK, for defineteness sake, suppose we have the following variant (which I made up on the spot):

The rules are the same as for orthodox Chess, with the following exceptions:
Two pieces of the same color can stand on the same square, in stead of one. So you can move to (but not over) squares that already contain a single piece of your own. The piece that moves last into the square is designated the 'upper' piece. When there are two pieces in a square, the lower one can only make its non-capture moves, carrying the upper piece with him. The upper piece can only make all its moves moves.

All Pawns start on top of a Checker, which count as different pieces. The Pawns themselves have only their capture moves, no non-captures, while the Checkers only have the non-capture moves of a FIDE Pawn.

How should a FEN for the start position of this variant look? And how after

1 Ra1-b1 Nf6 2. NRb1-c3

?
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Engine development to play a chess variant

Post by Ferdy »

Evert wrote:I have the following definition for Musketeer with Seirawan gating rules and without the Fortress in SjaakII:
Tried it but it rejected gating move. This is SjaakII 1.0.0.exe
6819 >first : variant musketeerish
6819 >first : level 0 1 1
6819 >first : post
6819 >first : hard
6819 >first : easy
6819 >first : ping 3
Impossible move , type = 0
6819 <first : pong 2
6835 <first : setup (PNBRQ.EAC..O.....HD.ULKpnbrq.eac..o.....hd.ulk) 8x8+13_seirawan rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[EACOHDULeacohdul] w KQkq -
recognized 'seirawan' (-1) as variant musketeerish
shuffleOpenings = 0
6850 <first : piece N& N
6850 <first : piece B& B
6850 <first : piece R& R
6850 <first : piece Q& Q
6850 <first : piece D& QN
6850 <first : piece C& RN
6850 <first : piece A& BN
6850 <first : piece E& WFDA
6850 <first : piece H& DAHG
6850 <first : piece L& NF2
6850 <first : piece O& WFDllrrN
6866 <first : piece U& NC
6866 <first : piece K& KisO2
6866 <first : piece P& fmWfceFifmW2@7
6866 <first : pong 3
14962 >first : force
14962 >first : analyze
Impossible move , type = 0
14978 <first : 2 0 0 70 1. Nc3 Nc6
Impossible move , type = 32
14978 <first : 3 996 1 318 1. Nc3 Nf6 2. Rb1/D
Impossible move , type = 32
14978 <first : 4 0 1 973 1. Nc3 Nf6 2. Rb1/D Rg8/D
Impossible move , type = 32
15009 <first : 5 47 4 2955 1. Nf3 d6 2. Rg1/D Kd7/D 3. Nc3
Impossible move , type = 32
15071 <first : 6 0 11 12859 1. d3 e6 2. Kd2/D Ke7/D 3. Kc3 Kf6
Impossible move , type = 32
15103 <first : 7 96 14 18762 1. d3 g6 2. Kd2/D Bh6 3. Kc3 Bg7 4. Kb4 Kf8/D
Impossible move , type = 32
15617 <first : 8 20 65 91428 1. f3 Nc6 2. Kf2/D Rb8/D 3. d4 Db6 4. Dc3 Nf6
Impossible move , type = 32
15773 <first : 9 -17 81 119001 1. f3 Nc6 2. Kf2/D Rb8/D 3. Nc3 Nf6 4. Rb1/C Rg8/C 5. Ke3
Impossible move , type = 32
16195 <first : 10 0 123 184768 1. Nc3 Nc6 2. Rb1/D Rb8/D 3. Nf3 Nf6 4. Rg1/C Rg8/C 5. Db3 Db6
Impossible move , type = 32
16304 <first : 11 34 134 202764 1. Nc3 Nc6 2. Rb1/D Rb8/D 3. Nf3 Nf6 4. Rg1/C Rg8/C 5. Db3 Db6 6. Cg3 Dxb3 7. cxb3
Impossible move , type = 32
16678 <first : 12 0 171 268731 1. Nc3 Nf6 2. Rb1/D Rg8/D 3. Nf3 Nc6 4. Rg1/C Rb8/C 5. d3 e6 6. Kd2/A Ke7/A
Impossible move , type = 32
16990 >first : .
17614 <first : 13 70 265 421709 1. Nc3 Nc6 2. Rb1/D Rb8/D 3. Nf3 Nh6 4. Rg1/C Rg8/C 5. Db3 Db6 6. Dxb6 cxb6 7. Cg3
Impossible move , type = 32
18301 <first : 14 41 333 538128 1. Nc3 Nc6 2. Rb1/D Rb8/D 3. Nf3 Nh6 4. Rg1/C Rg8/C 5. Db3 Db6 6. Cg3 Cg6 7. Cxg6 Dxb3 8. cxb3 hxg6
Impossible move , type = 32
19096 >first : lift d2
19096 <first : highlight 8/8/8/8/3Y4/3Y4/8/8
19549 >first : put d4
19549 >first : d2d4
19564 <first : 15 71 458 744752
19564 <first : 2 -765 0 137 2. ... Nc6 2. Kd2/D Nxd4
19564 <first : 3 120 0 425 2. ... Nc6 2. Kd2/D Rb8/D
19564 <first : 4 -92 0 1639 2. ... Nc6 2. Kd2/D Rb8/D 3. Kc3
19580 <first : 5 -10 1 3019 2. ... Nc6 2. Kd2/D Rb8/D 3. Kc3 Db6
19580 <first : 6 -76 1 4774 2. ... Nc6 2. Kd2/D Rb8/D 3. Kc3 Db6 4. Df3
19642 <first : 7 97 7 16021 2. ... Nc6 2. Nf3 Rb8/D 3. Rg1/D Db6 4. Nc3 Nf6
19876 <first : 8 38 31 49440 2. ... Nc6 2. Nc3 Rb8/D 3. Rb1/D Nf6 4. Nf3 Rg8/C 5. Rg1/C
20703 >first : lift d7
20703 <first : highlight 8/8/3Y4/3Y4/8/8/8/8
20812 <first : 9 15 124 196419 2. ... Na6 2. f3 f6 3. Kf2/D Kf7/D 4. Nc3 Rb8/C 5. Rb1/C Kg6
21077 >first : put d5
21077 >first : d7d5
21093 <first : 10 46 151 241888 2. ... Nc6 2. Nf3 Rb8/D 3. Rg1/D Nf6 4. Kd2/C Rg8/C 5. Kc3 Db6 6. e4
88 0 47 45 46 48 87 46 45 47 1 8
88 0 44 44 44 88 44 44 44 44 1 7
88 0 88 88 88 88 88 88 88 88 1 6
88 0 88 88 88 44 88 88 88 88 0 88
88 0 88 88 88 0 88 88 88 88 0 88
88 0 88 88 88 88 88 88 88 88 0 88
88 0 0 0 0 88 0 0 0 0 0 88
88 0 3 1 2 4 43 2 1 3 0 88
Impossible move _1c1h, type = 25
21093 <first : 2 0 1 128 2. K1d2/D Kd7/D
Impossible move e1d2d, type = 25
21093 <first : 3 195 1 294 2. K1d2/D Kd7/D 3. Kc3
Impossible move e1d2d, type = 25
21093 <first : 4 0 1 2756 2. K1d2/D Kd7/D 3. Kc3 Kc6
Impossible move e1d2d, type = 25
21109 <first : 5 166 3 3137 2. K1d2/D Kd7/D 3. Kc3 Kc6 4. Kb4
Impossible move e1d2d, type = 25
21171 <first : 6 1 9 16685 2. K1d2/D Nf6 3. Nf3 Rg8/D 4. Rg1/C Kd7/C
Impossible move e1d2d, type = 25
21218 <first : 7 222 14 23479 2. K1d2/D Nf6 3. Nf3 Rg8/D 4. Rg1/C Kd7/C 5. Kc3
Impossible move e1d2d, type = 25
21452 <first : 8 65 37 60524 2. K1d2/D Nf6 3. Nf3 Rg8/D 4. Rg1/C Kd7/C 5. Ne5 Ke6 6. Kc3
Impossible move e1d2d, type = 25
21733 <first : 9 139 65 107390 2. K1d2/D Nf6 3. Nc3 Rg8/D 4. Rb1/C Kd7/C 5. Ke3 Kc6 6. Kf3
Impossible move e1d2d, type = 25
21951 <first : 10 156 87 145610 2. K1d2/D Nf6 3. Nf3 Kd7/D 4. Rg1/C Rg8/A 5. Ke3 Ke6 6. Kf4 Nc6
Impossible move e1d2d, type = 25
22981 >first : lift j7
23121 <first : 11 169 204 335631 2. K1d2/D Nc6 3. Nc3 Rb8/D 4. Rb1/C Kd7/C 5. Nf3 Db6 6. Ke3 Dc4 7. Kf4 Ke6
Impossible move e1d2d, type = 25
27910 <first : 12 13 681 1074419 2. Nf3 Nc6 3. Rg1/C Nf6 4. Na3 Rg8/D 5. Rb1/D Ne4 6. Qd3 Rb8/C 7. Kd1/A Kd7/A
29751 >first : lift c1
29751 <first : highlight 8/8/7Y/6Y1/5Y2/4Y3/3Y4/8
30859 >first : put f4
30859 >first : c1f4a
30874 <first : Illegal move: c1f4a

32606 <first : 13 103 1152 1808451 2. Nf3 Nf6 3. K1d2/D Kd7/D 4. Dd3 Dd6 5. Rg1/C Rg8/C 6. Nc3 Ne4 7. Ke1 Nxc3 8. Ne5 Ke8 9. Dxc3
35773 <first : 14 103 1469 2299187 2. Nf3 Nf6 3. K1d2/D Kd7/D 4. Dd3 Dd6 5. Rg1/C Rg8/A 6. Nc3 Nc6 7. Ne5 Ke8 8. Nxf7 Rb8/C 9. Nxd6 cxd6
GameEnds(29, xboard exit, 2)
write FEN 50-move: 0 2 0
e0. p=-6
e1. p=-3
e2. p=-3
37522 >first : exit
37522 >first : quit
When I tried to play with seirawan it does not allow me to gate but the engine is making gate moves when it is his turn.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Engine development to play a chess variant

Post by Ferdy »

musketeerchess wrote:Hi
I developed myself an engine playing on zillions using only Leopard and Cannon as the sole 2 new added pieces.
I agree with you, a challenging and very rich and interesting game. Plenty of tactics and new strategical themes that give creativity new highs.

I'm interested to see your games and play them on a classic chess board with classic pieces and my latest designed pieces. They are very beautiful especially the Leopard !
Lets play with your engine, with my engine, I want to see if rules are correctly implemented. My engine can only play Cannon and Leopard as additional pieces.

Sample game.

Code: Select all

&#91;Event "Computer Chess Game"&#93;
&#91;Site "Home"&#93;
&#91;Date "2015.07.20"&#93;
&#91;Round "-"&#93;
&#91;White "Human"&#93;
&#91;Black "Lapu v1-1"&#93;
&#91;Result "0-1"&#93;
&#91;TimeControl "120+1"&#93;
&#91;Variant "musketeer"&#93;
&#91;VariantMen "N&#58;N;C&#58;llNrrNDK;L&#58;NB2"&#93;
&#91;FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR&#91;CLcl&#93; w KGFDCBQkgfdcbq - 0 1"&#93;
&#91;SetUp "1"&#93;

&#123;--------------
r n b q k b n r
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
P P P P P P P P
R N B Q K B N R
white to play
--------------&#125;
1. d4 Nf6/L &#123;-0.08/13 6&#125; 2. Bg5/L h6 &#123;+0.42/15 4&#125; 3. Bxf6 Lxf6
&#123;+0.45/13 1.7&#125; 4. c4 e6 &#123;+0.88/14 6&#125; 5. Nc3/C Be7 &#123;+0.52/13 5&#125; 6. e4 O-O
&#123;+0.65/14 5&#125; 7. e5 Le8 &#123;+0.24/15 5&#125; 8. Nf3 d6 &#123;+0.23/13 5&#125; 9. exd6 cxd6
&#123;+0.13/14 1.2&#125; 10. Bd3 Nc6/C &#123;+0.06/14 4&#125; 11. O-O Nb4 &#123;+0.12/13 4&#125; 12. Be2
a6 &#123;+0.00/13 4&#125; 13. a3 Nc6 &#123;-0.10/13 4&#125; 14. Cd2 Bd7 &#123;-0.01/12 4&#125; 15. Qc2 f5
&#123;+0.06/11 4&#125; 16. Re1 e5 &#123;+0.19/12 4&#125; 17. d5 Na7 &#123;-0.04/13 3&#125; 18. Cf1 Cc7
&#123;+0.12/11 3&#125; 19. b4 b6 &#123;+0.16/12 2.8&#125; 20. Ch1 Bf6 &#123;+0.25/12 3&#125; 21. Nd2 e4
&#123;+0.85/12 3&#125; 22. Nf1 g6 &#123;+1.20/11 2.7&#125; 23. Rb1 Kg7 &#123;+1.17/11 2.7&#125; 24. f3
Bd4+ &#123;+2.59/11 2.6&#125; 25. Cf2 Bxf2+ &#123;+4.17/11 2.1&#125; 26. Kxf2 b5 &#123;+4.08/11 2.5&#125;
27. Kg1 bxc4 &#123;+3.81/12 2.5&#125; 28. Bxc4 exf3 &#123;+4.12/12 2.0&#125; 29. gxf3 Lf6
&#123;+4.20/11 2.4&#125; 30. Ne2 Bb5 &#123;+4.17/10 2.4&#125; 31. Nd4 Lxd4 &#123;+9.40/14 2.3&#125; 32.
Qc3 Lxc3 &#123;+15.67/12 2.3&#125;
&#123;White resigns&#125; 0-1
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Engine development to play a chess variant

Post by Evert »

Ferdy wrote:
Evert wrote:I have the following definition for Musketeer with Seirawan gating rules and without the Fortress in SjaakII:
Tried it but it rejected gating move. This is SjaakII 1.0.0.exe
6819 >first : variant musketeerish
6819 >first : level 0 1 1
6819 >first : post
6819 >first : hard
6819 >first : easy
6819 >first : ping 3
Impossible move , type = 0
6819 <first : pong 2
6835 <first : setup (PNBRQ.EAC..O.....HD.ULKpnbrq.eac..o.....hd.ulk) 8x8+13_seirawan rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[EACOHDULeacohdul] w KQkq -
recognized 'seirawan' (-1) as variant musketeerish
shuffleOpenings = 0
6850 <first : piece N& N
6850 <first : piece B& B
6850 <first : piece R& R
6850 <first : piece Q& Q
6850 <first : piece D& QN
6850 <first : piece C& RN
6850 <first : piece A& BN
6850 <first : piece E& WFDA
6850 <first : piece H& DAHG
6850 <first : piece L& NF2
6850 <first : piece O& WFDllrrN
6866 <first : piece U& NC
6866 <first : piece K& KisO2
6866 <first : piece P& fmWfceFifmW2@7
6866 <first : pong 3
14962 >first : force
14962 >first : analyze
Impossible move , type = 0
14978 <first : 2 0 0 70 1. Nc3 Nc6
Impossible move , type = 32
14978 <first : 3 996 1 318 1. Nc3 Nf6 2. Rb1/D
Impossible move , type = 32
14978 <first : 4 0 1 973 1. Nc3 Nf6 2. Rb1/D Rg8/D
Impossible move , type = 32
15009 <first : 5 47 4 2955 1. Nf3 d6 2. Rg1/D Kd7/D 3. Nc3
Impossible move , type = 32
15071 <first : 6 0 11 12859 1. d3 e6 2. Kd2/D Ke7/D 3. Kc3 Kf6
Impossible move , type = 32
15103 <first : 7 96 14 18762 1. d3 g6 2. Kd2/D Bh6 3. Kc3 Bg7 4. Kb4 Kf8/D
Impossible move , type = 32
15617 <first : 8 20 65 91428 1. f3 Nc6 2. Kf2/D Rb8/D 3. d4 Db6 4. Dc3 Nf6
Impossible move , type = 32
15773 <first : 9 -17 81 119001 1. f3 Nc6 2. Kf2/D Rb8/D 3. Nc3 Nf6 4. Rb1/C Rg8/C 5. Ke3
Impossible move , type = 32
16195 <first : 10 0 123 184768 1. Nc3 Nc6 2. Rb1/D Rb8/D 3. Nf3 Nf6 4. Rg1/C Rg8/C 5. Db3 Db6
Impossible move , type = 32
16304 <first : 11 34 134 202764 1. Nc3 Nc6 2. Rb1/D Rb8/D 3. Nf3 Nf6 4. Rg1/C Rg8/C 5. Db3 Db6 6. Cg3 Dxb3 7. cxb3
Impossible move , type = 32
16678 <first : 12 0 171 268731 1. Nc3 Nf6 2. Rb1/D Rg8/D 3. Nf3 Nc6 4. Rg1/C Rb8/C 5. d3 e6 6. Kd2/A Ke7/A
Impossible move , type = 32
16990 >first : .
17614 <first : 13 70 265 421709 1. Nc3 Nc6 2. Rb1/D Rb8/D 3. Nf3 Nh6 4. Rg1/C Rg8/C 5. Db3 Db6 6. Dxb6 cxb6 7. Cg3
Impossible move , type = 32
18301 <first : 14 41 333 538128 1. Nc3 Nc6 2. Rb1/D Rb8/D 3. Nf3 Nh6 4. Rg1/C Rg8/C 5. Db3 Db6 6. Cg3 Cg6 7. Cxg6 Dxb3 8. cxb3 hxg6
Impossible move , type = 32
19096 >first : lift d2
19096 <first : highlight 8/8/8/8/3Y4/3Y4/8/8
19549 >first : put d4
19549 >first : d2d4
19564 <first : 15 71 458 744752
19564 <first : 2 -765 0 137 2. ... Nc6 2. Kd2/D Nxd4
19564 <first : 3 120 0 425 2. ... Nc6 2. Kd2/D Rb8/D
19564 <first : 4 -92 0 1639 2. ... Nc6 2. Kd2/D Rb8/D 3. Kc3
19580 <first : 5 -10 1 3019 2. ... Nc6 2. Kd2/D Rb8/D 3. Kc3 Db6
19580 <first : 6 -76 1 4774 2. ... Nc6 2. Kd2/D Rb8/D 3. Kc3 Db6 4. Df3
19642 <first : 7 97 7 16021 2. ... Nc6 2. Nf3 Rb8/D 3. Rg1/D Db6 4. Nc3 Nf6
19876 <first : 8 38 31 49440 2. ... Nc6 2. Nc3 Rb8/D 3. Rb1/D Nf6 4. Nf3 Rg8/C 5. Rg1/C
20703 >first : lift d7
20703 <first : highlight 8/8/3Y4/3Y4/8/8/8/8
20812 <first : 9 15 124 196419 2. ... Na6 2. f3 f6 3. Kf2/D Kf7/D 4. Nc3 Rb8/C 5. Rb1/C Kg6
21077 >first : put d5
21077 >first : d7d5
21093 <first : 10 46 151 241888 2. ... Nc6 2. Nf3 Rb8/D 3. Rg1/D Nf6 4. Kd2/C Rg8/C 5. Kc3 Db6 6. e4
88 0 47 45 46 48 87 46 45 47 1 8
88 0 44 44 44 88 44 44 44 44 1 7
88 0 88 88 88 88 88 88 88 88 1 6
88 0 88 88 88 44 88 88 88 88 0 88
88 0 88 88 88 0 88 88 88 88 0 88
88 0 88 88 88 88 88 88 88 88 0 88
88 0 0 0 0 88 0 0 0 0 0 88
88 0 3 1 2 4 43 2 1 3 0 88
Impossible move _1c1h, type = 25
21093 <first : 2 0 1 128 2. K1d2/D Kd7/D
Impossible move e1d2d, type = 25
21093 <first : 3 195 1 294 2. K1d2/D Kd7/D 3. Kc3
Impossible move e1d2d, type = 25
21093 <first : 4 0 1 2756 2. K1d2/D Kd7/D 3. Kc3 Kc6
Impossible move e1d2d, type = 25
21109 <first : 5 166 3 3137 2. K1d2/D Kd7/D 3. Kc3 Kc6 4. Kb4
Impossible move e1d2d, type = 25
21171 <first : 6 1 9 16685 2. K1d2/D Nf6 3. Nf3 Rg8/D 4. Rg1/C Kd7/C
Impossible move e1d2d, type = 25
21218 <first : 7 222 14 23479 2. K1d2/D Nf6 3. Nf3 Rg8/D 4. Rg1/C Kd7/C 5. Kc3
Impossible move e1d2d, type = 25
21452 <first : 8 65 37 60524 2. K1d2/D Nf6 3. Nf3 Rg8/D 4. Rg1/C Kd7/C 5. Ne5 Ke6 6. Kc3
Impossible move e1d2d, type = 25
21733 <first : 9 139 65 107390 2. K1d2/D Nf6 3. Nc3 Rg8/D 4. Rb1/C Kd7/C 5. Ke3 Kc6 6. Kf3
Impossible move e1d2d, type = 25
21951 <first : 10 156 87 145610 2. K1d2/D Nf6 3. Nf3 Kd7/D 4. Rg1/C Rg8/A 5. Ke3 Ke6 6. Kf4 Nc6
Impossible move e1d2d, type = 25
22981 >first : lift j7
23121 <first : 11 169 204 335631 2. K1d2/D Nc6 3. Nc3 Rb8/D 4. Rb1/C Kd7/C 5. Nf3 Db6 6. Ke3 Dc4 7. Kf4 Ke6
Impossible move e1d2d, type = 25
27910 <first : 12 13 681 1074419 2. Nf3 Nc6 3. Rg1/C Nf6 4. Na3 Rg8/D 5. Rb1/D Ne4 6. Qd3 Rb8/C 7. Kd1/A Kd7/A
29751 >first : lift c1
29751 <first : highlight 8/8/7Y/6Y1/5Y2/4Y3/3Y4/8
30859 >first : put f4
30859 >first : c1f4a
30874 <first : Illegal move: c1f4a

32606 <first : 13 103 1152 1808451 2. Nf3 Nf6 3. K1d2/D Kd7/D 4. Dd3 Dd6 5. Rg1/C Rg8/C 6. Nc3 Ne4 7. Ke1 Nxc3 8. Ne5 Ke8 9. Dxc3
35773 <first : 14 103 1469 2299187 2. Nf3 Nf6 3. K1d2/D Kd7/D 4. Dd3 Dd6 5. Rg1/C Rg8/A 6. Nc3 Nc6 7. Ne5 Ke8 8. Nxf7 Rb8/C 9. Nxd6 cxd6
GameEnds(29, xboard exit, 2)
write FEN 50-move: 0 2 0
e0. p=-6
e1. p=-3
e2. p=-3
37522 >first : exit
37522 >first : quit
When I tried to play with seirawan it does not allow me to gate but the engine is making gate moves when it is his turn.
I can reproduce it, it looks like a simple error when terminating the LAN string (it duplicates the gated piece ID, so it expects c1f4aa). Should be easy to fix, but unfortunately I will be from home until Thursday. I have my laptop here, so I can fix the problem, but I won't be able to make Windows compiles until then.
Anyway, this is a good one to fix for the next release. :)
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Engine development to play a chess variant

Post by Ferdy »

hgm wrote:OK, for defineteness sake, suppose we have the following variant (which I made up on the spot):

The rules are the same as for orthodox Chess, with the following exceptions:
Two pieces of the same color can stand on the same square, in stead of one. So you can move to (but not over) squares that already contain a single piece of your own. The piece that moves last into the square is designated the 'upper' piece. When there are two pieces in a square, the lower one can only make its non-capture moves, carrying the upper piece with him. The upper piece can only make all its moves moves.

All Pawns start on top of a Checker, which count as different pieces. The Pawns themselves have only their capture moves, no non-captures, while the Checkers only have the non-capture moves of a FIDE Pawn.

How should a FEN for the start position of this variant look? And how after

1 Ra1-b1 Nf6 2. NRb1-c3

?
One way of representing this is like the following.
Create 2 piece fields or FEN, one for Upper board say chess, and the other for lower board say for checker.
<fen upper (start as chess)> <fen lower (start as checker)>

Image



Sample move would be 1. e3Le4L, a checker move at lower board, that moves like a fide pawn. See comments in light green.

Image

The move 1. e3Le4U, could be illegal since the pawn should be in upper board only, and there is no board above upper board.

The pawn in e3U (from startpos) has no legal move because there are no captures that can be made.