Grand Chess

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Ultima chess available

Post by Evert »

Daniel Shawul wrote:How is sjaak and grand chess going ? cheers.
Getting there. I haven't had time to do anything with it over the past week.
There are, of course, many places in the code where I don't really distinguish between a bitboard and a 64 bit integer, which needs to be fixed for when a bitboard is not a 64 bit integer but a tuple of two 64 bit integers.
User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Ultima chess available

Post by hgm »

XBoard has a -noGUI option, which suppresses all time-consuming display actions. (Provided you also leave the Engine-Output window closed.) Internal self-play is certainly an option, as it is best to do this in self-play anyway. (To be sure the score is due to the materal imbalance, and not to difference in player strength.)

It is important to either have the engine do hefty randomzing in the first few moves, or to create the diversity by hand by giving a huge set of initial positions. I usually take opening positions (pieces behind a cosed rank of Pawns) because they are usually tactically quiet, and completey symmetric, apart from the imbalance. (The first-move advantage can be averaged out.) Even then you have to be careful, as it seems that deleting multipe Pawns can make the position non-quiet in 10x8 Chess, and for some hopper pieces (e.g. Grasshopper) a closed second rank of Pawns is not quiet at all, because it suffocates the pieces for Grasshopper attack.

Different starting positions can for instance be acheived by permuting the back-rank pieces.
User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Ultima chess available

Post by hgm »

The WinBoard name is "normal".

I tried Ultima by playing a few moves by hand, but NebiuAien gets stuck:

Code: Select all

[Event "Computer Chess Game"]
[Site "CHESS_LAPTOP"]
[Date "2011.03.19"]
[Round "-"]
[White "hgm"]
[Black "NebiyuAlien_1.2"]
[Result "*"]
[TimeControl "40/60"]
[Annotator "1... +0.10"]

1. e4 h5 {+0.10/8 1.5} 2. f4 b7b4 {+0.00/7 1.1} 3. a4 b4b5 {+0.10/7 1.2} 4.
c2c5 Ba6 {+0.00/6 1.2} 5. a5
{xboard exit} *
It says "Unknown command: a4a5". But I don't see anything wrong with that move.

I am not sure if there is any notation standard for Ultima, but it seems the letters you use now are not very suitable. Problem is that Coordinator and Chamelion both start with a C. I also don't like the use of an I too much, but it seems this is standard. Perhaps D can be used for CoorDinator. (I also dislike O, as t is associated wth castling.) The Wikipedia identifies Chamelion with C, although I would think it better to use H there, and keep C for the Coordinator.

I also dislike the use of standard Chess pieces for all these weird beasts. It seems an Ultima font wouldbe needed, but when played with the built-in bitmaps, I would prefer some different symbols. How about a pieceToCharTable "......I....D.L.WCPK......i....d.l.wcpk" ?
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Ultima chess available

Post by Daniel Shawul »

I can replay the game here with no problem. a4a5 is a capture which removes the b5 pawn. I suspect it may occure when the engine corrupts a data while thinking. I didn't have problems with self play so far. I tried to play against it but I had problems with making legal moves ;) Seems too complicated to figure that out without the help of the GUI. Anyway I will try to fix the problem once I duplicate the problem.

You can change the piceToCharTable in alien.ini as you wish it to be. I just used the wikipedia representation to test the positions shown there while doing move gen. http://en.wikipedia.org/wiki/Baroque_chess

Code: Select all

.*PpKkQqRrBbNnIi
rnbqkbni/pppppppp/8/8/8/8/PPPPPPPP/INBQKBNR w - - 0 1
#PNBRQFEACWMOHIJGDVLSUKpnbrqfeacwmohijgdvlsuk
 PNBRQ........I.......Kpnbrq........i.......k
First line --> Symbol for pieces white and black alternating
Second line --> start position
Third line --> commen
Fourth --> pieceToCharTable

So how do I fit your suggestion "......I....D.L.WCPK......i....d.l.wcpk" ? It confuses me sometimes how winboard handles this conversions internally. I thought I could use any symbols internally as long as I specified an appropriate pieceToCharTable to map the characters. But I had some problems with promotion pieces. So I just used what fairy uses for pieceToCharTable to be safe. I am not sure I completley understand how it works after all this time :(
User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Ultima chess available

Post by hgm »

The position in the pieceToCharTable string corresponds to the bitmap. So the first letter is what shows up as a white Pawn, etc. The standard setting for variant fairy serves as a kind of mnemonic, as it assigns the 'most obvious' letter to the piece symbol. (As there are 22 piece types and only 26 letters, the choice narrowed quickly, so 'most obvious' has to be taken with a grain of salt...)

So what I propose should be interpreted as:

Code: Select all

#PNBRQFEACWMOHIJGDVLSUKpnbrqfeacwmohijgdvlsuk
 ......I....D.L.WC.P  K......i....d.l.wc.p  k
i.e. the I(mmobilizer) will be represented by the symbol usually called 'E', which is the Elephant. Coordinator D wll be represented by what is usually 'O', or Cannon. (Well, what could I do? C(hancellor), A(rchbishop) and (k)N(ight) were already in use...). L(ong leaper) would be the flat-mitre Bishop 'I', W(ithdrawer) the 'narrow' Queen (more commonly used for G(rasshopper)), Chamelion the D-piece (Rook-Knight chimera), while the Pincer pawns would be represented by the L(ance) (because it is narrow and looks opticaly nice in a filled rank).

(OK, I see now my orginal string was wrong; there needed to be an extra . between C and P.)

If less than 22 letters are given, the gaps are placed before the last piece of each color (which by convention is used for the King symbol), for compatibility with older versions that support fewer piece types.

B.t.w, I do have the winboard.debug of that game. Just in case it might be helpfull:

Code: Select all

7 0 4 7 0 4 Legality test? e2e4
TC string = ':40/60'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=0 (4,1)-(4,3) -
7 0 4 7 0 4 Legality test? e2e4
movetype=21, promochar=0=-
MateTest: K=1, my=16, his=16
move: e2e4
, parse: e4 (
)
repeat test fmm=1 bmm=0 ep=-4, reps=3
1 ep=-3
0 ep=-4
nps: w=-1, b=-1
112794 >first : name hgm
nps: w=-1, b=-1
time odds: 1.000000 1.000000 
112794 >first : time 6000
112794 >first : otim 6000
book hit = (NULL)
112794 >first : e2e4
112814 <first : Hello hgm!
112814 <first : setup rnbqkbni/pppppppp/8/8/4P3/8/PPPP1PPP/INBQKBNR b - e3e4 0 1
112814 <first : [st = 1388ms, mt = 29250ms , moves_left 40]
112814 <first : 3 29996 0 346  h7h6 e4e5 h6h7
112834 <first : 4 0 2 1667  h7h5 e4e5 b7b5 c2c5
112874 <first : 5 0 6 3563  h7h5 c2c5 g7h7 g2g7 h5e5
112874 <first : 5 0 6 3866  h7h5 c2c5 g7h7 g2g7 h5e5
112974 <first : 6 -5 15 8537  h7h5 c2c5 g7g6 e4e5 b7b5 g2g4
113134 <first : 6 5 32 18582  f7f5 a2a4 g8e6 c2c3 f8f6 b1d3
113134 <first : 6 5 32 18626  f7f5 a2a4 g8e6 c2c3 f8f6 b1d3
113414 <first : 7 5 59 34421  f7f5 f2f4 g8e6 f1d3 c7c5 g2e2 e8f7
113504 <first : 7 5 69 41112  f7f5 f2f4 g8e6 f1d3 c7c5 g2e2 e8f7
113825 <first : 8 -20 100 58505  f7f5 f2f4 g8e6 f1d3 g7f7 g2g7 h7h5 g1c5
114145 <first : 8 -10 132 80239  h7h5 c2c4 b7b5 f1d3 a8d5 b2c2 b5b2 g2g4
114286 <first : nodes = 88210 <53 qnodes> time = 1472ms nps = 59925
114286 <first : splits = 0 badsplits = 0
114286 <first : move h7h5
machine move 1, castling = 7 0 4 7 0 4
trial 7,7,7,5  type 2121
7 0 4 7 0 4 Legality test? h7h5
returned 21 'h7h5'
TC string = ':40/60'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=22 (7,6)-(7,4) -
7 0 4 7 0 4 Legality test? h7h5
movetype=21, promochar=0=-
MateTest: K=1, my=16, his=16
move: h7h5
, parse: h5 (
)
repeat test fmm=2 bmm=0 ep=-4, reps=3
2 ep=-3
1 ep=-3
0 ep=-4
silence
114286 <first : 
114286 <first : setup rnbqkbni/ppppppp1/8/7p/4P3/8/PPPP1PPP/INBQKBNR w - h6h5 0 2
7 0 4 7 0 4 Legality test? f2f4
TC string = ':40/60'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=0 (5,1)-(5,3) -
7 0 4 7 0 4 Legality test? f2f4
movetype=21, promochar=0=-
MateTest: K=1, my=16, his=16
move: f2f4
, parse: f4 (
)
repeat test fmm=3 bmm=0 ep=-4, reps=3
3 ep=-3
2 ep=-3
1 ep=-3
0 ep=-4
time odds: 1.000000 1.000000 
117420 >first : time 5850
117420 >first : otim 5686
book hit = (NULL)
117420 >first : f2f4
117440 <first : setup rnbqkbni/ppppppp1/8/7p/4PP2/8/PPPP2PP/INBQKBNR b - f3f4 0 2
117440 <first : [st = 1387ms, mt = 28500ms , moves_left 39]
117440 <first : 3 29996 0 414  h5h6 e4e5 h6h7
117510 <first : 4 -5 7 4745  h5e5 g2g6 h8h5 h1f3
117540 <first : 5 5 9 6140  h5e5 g2g6 h8h5 h1f3 d7d5
117540 <first : 5 5 10 6290  h5e5 g2g6 h8h5 h1f3 d7d5
117720 <first : 6 -50 28 16295  h5e5 g1e3 e5d5 c2c6 b7b6 a2a6 d5c5
117800 <first : 6 -20 35 20108  h5e5 g1e3 e5d5 c2c6 b7b6 a2a6 d5c5
117971 <first : 6 0 52 31539  b7b4 f1b5 c7c4 b5d5 b8d6 d2d4
117971 <first : 6 0 53 32139  b7b4 f1b5 c7c4 b5d5 b8d6 d2d4
118121 <first : 7 -65 68 40433  b7b4 f1b5 c7c4 b5d5 b8d6 d5c5 a8c6
118321 <first : 7 0 87 51926  b7b4 a2a4 b4b5 h2h4 a8d5 g1c5 e7e5
118491 <first : 7 0 105 64113  b7b4 a2a4 b4b5 h2h4 a8d5 g1c5 e7e5
118501 <first : nodes = 64113 <59 qnodes> time = 1051ms nps = 61001
118501 <first : splits = 0 badsplits = 0
118501 <first : move b7b4
machine move 3, castling = 7 0 4 7 0 4
trial 1,7,1,4  type 2121
7 0 4 7 0 4 Legality test? b7b4
returned 23 'b7b4'
TC string = ':40/60'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=22 (1,6)-(1,3) -
7 0 4 7 0 4 Legality test? b7b4
7 0 4 7 0 4 Legality test? b7b4
MateTest: K=1, my=16, his=16
move: b7b4
, parse: b7b4 (
)
repeat test fmm=4 bmm=0 ep=-4, reps=3
4 ep=-3
3 ep=-3
2 ep=-3
1 ep=-3
0 ep=-4
silence
118501 <first : 
118501 <first : setup rnbqkbni/p1ppppp1/8/7p/1p2PP2/8/PPPP2PP/INBQKBNR w - - 0 3
7 0 4 7 0 4 Legality test? a2a4
TC string = ':40/60'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=0 (0,1)-(0,3) -
7 0 4 7 0 4 Legality test? a2a4
movetype=21, promochar=0=-
MateTest: K=1, my=16, his=16
move: a2a4
, parse: a4 (
)
repeat test fmm=5 bmm=0 ep=-4, reps=3
5 ep=0
4 ep=-3
3 ep=-3
2 ep=-3
1 ep=-3
0 ep=-4
time odds: 1.000000 1.000000 
122797 >first : time 5742
122797 >first : otim 5257
book hit = (NULL)
122797 >first : a2a4
122817 <first : setup rnbqkbni/p1ppppp1/8/7p/Pp2PP2/8/1PPP2PP/INBQKBNR b - a3a4 0 3
122817 <first : [st = 1397ms, mt = 27960ms , moves_left 38]
122837 <first : 3 -5 2 1027  b4b5 g1d4 a8d5
122867 <first : 4 -10 5 3440  b4b6 g2g6 a8d5 h1f3
122937 <first : 5 0 11 6495  b4b6 c2c4 a8d5 g1d4 h5f5
122937 <first : 5 0 12 6923  b4b6 c2c4 a8d5 g1d4 h5f5
123037 <first : 6 -45 21 12047  b4b6 f1d3 a8d5 g1d4 c7c5 a4c4
123077 <first : 6 -15 24 14046  b4b5 g1d4 b8b6 g2g4 a8d5 a4c4
123258 <first : 6 -15 44 28591  b4b5 g1d4 b8b6 g2g4 a8d5 a4c4
123808 <first : 7 -10 98 63408  b4b5 c2c4 h5e5 h2h6 e5g5 h6c6 a8b7
123969 <first : 7 -10 114 75215  b4b5 c2c4 h5e5 h2h6 e5g5 h6c6 a8b7
123969 <first : nodes = 75215 <60 qnodes> time = 1142ms nps = 65862
123969 <first : splits = 0 badsplits = 0
123969 <first : move b4b5
machine move 5, castling = 7 0 4 7 0 4
trial 1,4,1,5  type 2121
7 0 4 7 0 4 Legality test? b4b5
returned 23 'b4b5'
TC string = ':40/60'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=22 (1,3)-(1,4) -
7 0 4 7 0 4 Legality test? b4b5
7 0 4 7 0 4 Legality test? b4b5
MateTest: K=1, my=16, his=16
move: b4b5
, parse: b4b5 (
)
repeat test fmm=6 bmm=0 ep=-4, reps=3
6 ep=-3
5 ep=0
4 ep=-3
3 ep=-3
2 ep=-3
1 ep=-3
0 ep=-4
silence
123969 <first : 
123979 <first : setup rnbqkbni/p1ppppp1/8/1p5p/P3PP2/8/1PPP2PP/INBQKBNR w - - 0 4
7 0 4 7 0 4 Legality test? c2c5
TC string = ':40/60'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=0 (2,1)-(2,4) -
7 0 4 7 0 4 Legality test? c2c5
7 0 4 7 0 4 Legality test? c2c5
MateTest: K=1, my=16, his=16
move: c2c5
, parse: c2c5 (
)
repeat test fmm=7 bmm=0 ep=-4, reps=3
7 ep=-3
6 ep=-3
5 ep=0
4 ep=-3
3 ep=-3
2 ep=-3
1 ep=-3
0 ep=-4
time odds: 1.000000 1.000000 
130698 >first : time 5625
130698 >first : otim 4584
book hit = (NULL)
130698 >first : c2c5
130718 <first : setup rnbqkbni/p1ppppp1/8/1pP4p/P3PP2/8/1P1P2PP/INBQKBNR b - - 0 4
130718 <first : [st = 1405ms, mt = 27375ms , moves_left 37]
130718 <first : 3 29996 0 632  b5b6 a4a5 b6b7
130868 <first : 4 -10 15 8275  a7a5 c5c6 a8a7 d2d5
130888 <first : 5 40 17 9529  a7a5
130938 <first : 5 -5 21 11740  a7a5 c5c4 f7f5 d1g4 e7e5
130948 <first : 5 -5 23 12697  a7a5 c5c4 f7f5 d1g4 e7e5
131088 <first : 6 -25 36 21225  a7a5 d2d5 h5g5 f4f5 h8h5 g1d4
131188 <first : 6 45 47 27744  h5d5
131479 <first : 6 -15 75 46472  h5d5 g1c5 c7b7 c5e5 c8c5 e4d4
131759 <first : 6 0 103 61186  c8a6 c5c4 a8d5 f1f2 h5e5 b1d3
131859 <first : 6 0 114 67773  c8a6 c5c4 a8d5 f1f2 h5e5 b1d3
131859 <first : nodes = 67773 <65 qnodes> time = 1141ms nps = 59397
131859 <first : splits = 0 badsplits = 0
131859 <first : move c8a6
machine move 7, castling = 7 0 4 7 0 4
trial 2,8,0,6  type 2121
7 0 4 7 0 4 Legality test? c8a6
returned 21 'c8a6'
TC string = ':40/60'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=24 (2,7)-(0,5) -
MateTest: K=1, my=16, his=16
move: c8a6
, parse: Ba6 (
)
repeat test fmm=8 bmm=0 ep=-4, reps=3
8 ep=-4
7 ep=-3
6 ep=-3
5 ep=0
4 ep=-3
3 ep=-3
2 ep=-3
1 ep=-3
0 ep=-4
silence
131869 <first : 
131869 <first : setup rn1qkbni/p1ppppp1/b7/1pP4p/P3PP2/8/1P1P2PP/INBQKBNR w - - 1 5
7 0 4 7 0 4 Legality test? a4a5
TC string = ':40/60'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=0 (0,3)-(0,4) -
7 0 4 7 0 4 Legality test? a4a5
movetype=21, promochar=0=-
MateTest: K=1, my=16, his=16
move: a4a5
, parse: a5 (
)
repeat test fmm=9 bmm=0 ep=-4, reps=3
9 ep=-3
8 ep=-4
7 ep=-3
6 ep=-3
5 ep=0
4 ep=-3
3 ep=-3
2 ep=-3
1 ep=-3
0 ep=-4
time odds: 1.000000 1.000000 
139300 >first : time 5509
139300 >first : otim 3840
book hit = (NULL)
139300 >first : a4a5
139320 <first : Error (unknown command): a4a5
GameEnds(28, xboard exit, 2)
157654 >first : result * {xboard exit}
157654 >first : force
157654 >first : quit
It does seem to report the proper FEN before the move...
User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Ultima chess available

Post by hgm »

Btw, engines that are non-compliant in their illegal-move message are kind of useless for human vs engine play with legality testing off. If you do an illegal move, it goes completely unnoticed, and wnBoard accepts the move anyway, but the engine will not start thinking. And after a few moves in Edit-Game mode, the engine willstart to play for the color that doesn't have the move, which WinBoard won't accept even with legality testing off...
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Ultima chess available

Post by Daniel Shawul »

The protocol specifies if a move is not 'recongnizably a move', which opens door for interpretation. For orthodox chess, a check of the first four characters to see if it is in coordinate notation should suffice.. But in alien mode , we have nullmove, drop moves, checkers moves, suicide moves etc... so that can be difficult. If I can rely on the fact that winboard never sends me a command that I didn't request with the features option that would be safe. The bug we had last time was with a very long 'name', I have fixed that now. But other GUIs send unrequested commands (I know Arena does it). Well they dont play with fairy pieces anyway so I can switch to "illegal move" command.

The board looks great with the new pieces. Lets make that a standard. Hmm... you are not going to make Ultima recognizable variant, are you ? :)
I am still trying to reproduce the illegal move problem. Earlier I had the 'attacks' routine disabled so this time I may be lucky..

Edit: May be it is also because of different piece values I am using now that I couldn't reproduce the problem..

Code: Select all

variant ultima
8 8
.*PpKkWwDdCcLlIi
dlcwkcli/pppppppp/8/8/8/8/PPPPPPPP/ILCWKCLD w - - 0 1
#PNBRQFEACWMOHIJGDVLSUKpnbrqfeacwmohijgdvlsuk
 ......I....D.L.WC.P..K......i....d.l.wc.p..k 
P  150  pincherpawn
p  150  pincherpawn
K 1000  king
k 1000  king
W  400  withdrawer
w  400  withdrawer
D  300  coordinator
d  300  coordinator
C  700  chameleon
c  700  chameleon
L  400  longleaper
l  400  longleaper
I  900  immobilizer
i  900  immobilizer
0 8 8
46 1

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

Re: Ultima chess available

Post by hgm »

The solution to this is to send

feature usermove=1

at startup. WinBoard will then prefix all moves with the keyword usermove, so that you never have to doubt whether the string you could not parse was a move or not. :idea:
Daniel Shawul wrote: Hmm... you are not going to make Ultima recognizable variant, are you ? :)
No, this is too much even for me... (Although WinBoard does support Atomic, which I wouldclassify in the same category as Ultima: moves with potentially weird and massive side effects.) But this is exactly why I included the pieceToCharTable in the setup command. So the engine can set the standard when WinBoard doesn't.

I am working on an Ultima font, though. (Still have to do the Kings.)
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Ultima chess available

Post by Daniel Shawul »

feature usermove=1
Hmm.. what took you so long ? :D That is just exactly what I needed.
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Ultima chess available

Post by Daniel Shawul »

I noticed something strange. In engine-engine mode the boards are correctly updated on every move. But in human-engine mode captures are displayed one step late. Obviously the human can't send a 'setup to update' his board. Nebiyu sends setup after it gets any move so winboard is probably keeping it for itself without displaying ... Because it does make the update correctly when Nebiyu makes its own move.