OK, I fixed the WB mate-detection problem, and uploaded a WinBoard Grand Chess package to http://hgm.nubati.net/WinBoard-GC.zip . You can take the winboard.exe from there. The package also contains Fairy-Max and a number of shortcuts and ini files they are based on, and a winboard.ini master file, but you can discard these, as apart from the fact it now supports "variant grand" it is a normal 4.5.1, and needs no additional configuration. This stuff is just included for some human Grand Chess players that do not have WinBoard at all, and to which I want to distribute it.
Note that this is NOT a version from the "alien" branch, so that things like Go and Checkers will not work. I still have to transplant the Grand-Chess patch to this branch (but there were some conflicts). There also is still no menu support for Grand Chess.
Grand Chess
Moderator: Ras
-
- Posts: 28395
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
-
- Posts: 28395
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Grand Chess
Nebiyu uses the stalemate claim very erratically. In the 50 games against Spartacus, there were 15 cases where it made a false claim. This happened both when it was checkmated and when it was checkmating. In two additional cases it did not claim mate at all, leading to an illegal move of Spartacus (who does not claim at all, and does not mind continuing after it is checkmated...
).
By correction of the forfeits to the value they should have had (you cannot forfeit after checkmate!), plus the earlier stalemate claim in game 4, Nebiyu earned 5 extra points, so 44% in stead of 34%.
I have started new games with the fixed WinBoard, where the mate detection should work now, so that this problem will disappear. But it would be good to fix it in Nebiyu as well. I also got the impression that Nebiyu undervalues the Archbishop. (e.g. try what happens if you let it self-play a couple of hundred games where on one side you delete A+P, and at the other Q.)

By correction of the forfeits to the value they should have had (you cannot forfeit after checkmate!), plus the earlier stalemate claim in game 4, Nebiyu earned 5 extra points, so 44% in stead of 34%.
I have started new games with the fixed WinBoard, where the mate detection should work now, so that this problem will disappear. But it would be good to fix it in Nebiyu as well. I also got the impression that Nebiyu undervalues the Archbishop. (e.g. try what happens if you let it self-play a couple of hundred games where on one side you delete A+P, and at the other Q.)
-
- Posts: 4186
- Joined: Tue Mar 14, 2006 11:34 am
- Location: Ethiopia
Re: Grand Chess
Yes there were some serious bugs.
Not updating the in_check flag after making a move was what was causing the problem.
Piece values for the archbishop was B + N = 600 pawns and the Marshal had R + N = 800. I guess this was wrong. Where can I find the suggested values ?
I am trying to make a "templetized" code that will allow me to add variants instantaneously. (1 hour still too long). So I just define a piece with three features (movement, attack, piece value), then define the game... That is why the piece values are added like that ! The values do actually depend on the presence/absense of other similar pieces so something like you do i.e material table could be better. But I belive this is not worth more than 30 elo.
Also history tables were screwed up once more ?! Instead of update history for non-caps , I did it only for caps. I found this after a little adventure with Hex Rays which gave me ippolitish kind of Nebiyu_16xx c-like code to compare with current version.
I will upload a corrected version later.
Not updating the in_check flag after making a move was what was causing the problem.
Piece values for the archbishop was B + N = 600 pawns and the Marshal had R + N = 800. I guess this was wrong. Where can I find the suggested values ?
I am trying to make a "templetized" code that will allow me to add variants instantaneously. (1 hour still too long). So I just define a piece with three features (movement, attack, piece value), then define the game... That is why the piece values are added like that ! The values do actually depend on the presence/absense of other similar pieces so something like you do i.e material table could be better. But I belive this is not worth more than 30 elo.
Also history tables were screwed up once more ?! Instead of update history for non-caps , I did it only for caps. I found this after a little adventure with Hex Rays which gave me ippolitish kind of Nebiyu_16xx c-like code to compare with current version.
I will upload a corrected version later.
-
- Posts: 4186
- Joined: Tue Mar 14, 2006 11:34 am
- Location: Ethiopia
Re: Grand Chess
Evert, this is not a good challengeSjaak, of course, is a bitboard program. Wink
That's not really an obstancle though, the easiest way to make the translation is to switch from C to C++ and define bitwise operators for the bitboard class. The main issue is that size of the lookup tables increases exponentially.
It may not be the most suitable data structure for a general board size, but I view that as a challenge rather than an obstacle. Very Happy

Grand chess took me 1hour to implement which I am not happy with. My target is to make a templetized code that will allow me to add 10 variants per day:) Something like the engine for zillions of games.
Major nuisance are pawn movements & promotions. Other weird games such as jetan could be problematic too. Every pieces movement is redifined and the implementation of attacks(from,to) is very difficult. Other than that most variants are rather similar IMO.
I use 10 bits each for from & to squares and the rest for capture/promotion piece and other flags == 32 bits. For checkers I had to drop that all in all and use a struct there.<quote>The biggest problem I had in the conversion was with my move encoding.</quote>
That's another issue: Sjaak uses six bits to encode a square, I'd need to bump that up to seven bits. I think I have enough empty space in the move definition to make that work though.
xboard can handle max 10x12. Waiting on HG to get his hands dirty on larger board sizesMy main reservation for doing this would be that if I enable 10x10, I'd want to enable 10x12, 11x11 and 12x10 as well (not all of these will be equally interesting) and I need to think a bit on how to do that effectively.
Does XBoard handle board sizes larger than 10x10?

-
- Posts: 4186
- Joined: Tue Mar 14, 2006 11:34 am
- Location: Ethiopia
perft
My perft results.
Code: Select all
a0b0. 1
a0c0. 1
a0d0. 1
a0e0. 1
a0f0. 1
a0g0. 1
a0h0. 1
a0i0. 1
d1c0. 1
d1e0. 1
d1d0. 1
e1d0. 1
e1f0. 1
e1e0. 1
f1d0. 1
f1g3. 1
f1h0. 1
f1e3. 1
f1f0. 1
g1e0. 1
g1h3. 1
g1i0. 1
g1f3. 1
g1f0. 1
g1h0. 1
nodes 65
time 0.03 sec
perft 2
a2a3. 65
a2a4. 65
b2b3. 65
b2b4. 65
c2c3. 65
c2c4. 65
d2d3. 65
d2d4. 65
e2e3. 65
e2e4. 65
f2f3. 65
f2f4. 65
g2g3. 65
g2g4. 65
h2h3. 65
h2h4. 65
i2i3. 65
i2i4. 65
j2j3. 65
j2j4. 65
b1c3. 65
b1d0. 65
b1a3. 65
i1g0. 65
i1j3. 65
i1h3. 65
c1b0. 65
c1d0. 65
h1g0. 65
h1i0. 65
a0a1. 65
a0b0. 65
a0c0. 65
a0d0. 65
a0e0. 65
a0f0. 65
a0g0. 65
a0h0. 65
a0i0. 65
j0j1. 65
j0i0. 65
j0h0. 65
j0g0. 65
j0f0. 65
j0e0. 65
j0d0. 65
j0c0. 65
j0b0. 65
d1c0. 65
d1e0. 65
d1d0. 65
e1d0. 65
e1f0. 65
e1e0. 65
f1d0. 65
f1g3. 65
f1h0. 65
f1e3. 65
f1f0. 65
g1e0. 65
g1h3. 65
g1i0. 65
g1f3. 65
g1f0. 65
g1h0. 65
nodes 4225
time 0.05 sec
perft 3
j2j3. 4160
j2j4. 4290
i2i3. 4355
i2i4. 4356
h2h3. 4290
h2h4. 4421
g2g3. 4548
g2g4. 4614
f2f3. 4612
f2f4. 4743
e2e3. 4612
e2e4. 4678
d2d3. 4806
d2d4. 4872
c2c3. 4290
c2c4. 4356
b2b3. 4290
b2b4. 4291
a2a3. 4160
a2a4. 4290
i1g0. 3445
i1j3. 4095
i1h3. 4160
b1c3. 4225
b1d0. 3250
b1a3. 4095
h1g0. 3510
h1i0. 3575
c1b0. 3705
c1d0. 3380
j0j1. 3770
j0i0. 3965
j0h0. 3900
j0g0. 3835
j0f0. 3705
j0e0. 3640
j0d0. 3445
j0c0. 3640
j0b0. 3575
a0a1. 3770
a0b0. 4030
a0c0. 3965
a0d0. 3640
a0e0. 3705
a0f0. 3640
a0g0. 3640
a0h0. 3575
a0i0. 3510
d1c0. 4030
d1e0. 3900
d1d0. 3770
e1d0. 3510
e1f0. 3640
e1e0. 3640
f1d0. 3640
f1g3. 5001
f1h0. 3900
f1e3. 5001
f1f0. 3770
g1e0. 3250
g1h3. 4418
g1i0. 3380
g1f3. 4610
g1f0. 3250
g1h0. 3380
nodes 259514
time 0.08 sec
perft 4
e2e3. 282750
e2e4. 286815
g2g3. 278934
g2g4. 282654
a2a3. 255521
a2a4. 263444
c2c3. 263064
c2c4. 267074
j2j3. 255521
j2j4. 263445
i2i3. 267178
i2i4. 267685
d2d3. 295139
d2d4. 298765
b2b3. 263559
b2b4. 263757
h2h3. 263378
h2h4. 271176
f2f3. 283127
f2f4. 291043
i1g0. 211600
i1j3. 251461
i1h3. 255270
b1c3. 259206
b1d0. 199622
b1a3. 251465
h1g0. 215591
h1i0. 219584
c1b0. 227572
c1d0. 207607
j0j1. 231563
j0i0. 243542
j0h0. 239549
j0g0. 235556
j0f0. 227570
j0e0. 223577
j0d0. 211598
j0c0. 223577
j0b0. 219584
a0a1. 231563
a0b0. 247535
a0c0. 243542
a0d0. 223577
a0e0. 227570
a0f0. 223577
a0g0. 223577
a0h0. 219584
a0i0. 215591
d1c0. 247535
d1e0. 239549
d1d0. 231563
e1d0. 215591
e1f0. 223577
e1e0. 223577
f1d0. 223580
f1g3. 303412
f1h0. 239552
f1e3. 303026
f1f0. 231566
g1e0. 199623
g1h3. 267180
g1i0. 207609
g1f3. 282232
g1f0. 199623
g1h0. 207609
nodes 15921643
time 2.98 sec
perft 5
d2d3. 20558631
d2d4. 21173790
j2j3. 15367374
j2j4. 16356335
b2b3. 16419335
b2b4. 16456911
c2c3. 16463387
c2c4. 17005137
h2h3. 16408383
h2h4. 17446890
f2f3. 18838940
f2f4. 20038699
i2i3. 16917022
i2i4. 16963081
a2a3. 15359339
a2a4. 16352149
e2e3. 19023413
e2e4. 19661346
g2g3. 18436602
g2g4. 18946140
i1g0. 11278456
i1j3. 15019899
i1h3. 15526790
b1c3. 16045647
b1d0. 10157473
b1a3. 15051919
h1g0. 11685865
h1i0. 12124009
c1b0. 12953543
c1d0. 10896240
j0j1. 13213096
j0i0. 14289959
j0h0. 13966863
j0g0. 13619836
j0f0. 12905797
j0e0. 12522765
j0d0. 11461666
j0c0. 12482981
j0b0. 12112018
a0a1. 13213091
a0b0. 14664989
a0c0. 14301987
a0d0. 12458911
a0e0. 12873837
a0f0. 12558816
a0g0. 12546871
a0h0. 12175893
a0i0. 11780984
d1c0. 14896359
d1e0. 14194968
d1d0. 13337307
e1d0. 11758577
e1f0. 12596477
e1e0. 12551455
f1d0. 12408183
f1g3. 22145139
f1h0. 13960181
f1e3. 22056078
f1f0. 13242112
g1e0. 10079599
g1h3. 17500245
g1i0. 10829733
g1f3. 19179865
g1f0. 10115639
g1h0. 10948562
nodes 959883584
time 187.27 sec
-
- Posts: 28395
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Grand Chess
I usually use B+N=875 and R+N=900 (when Q=950). See for instance http://z13.invisionfree.com/Gothic_Ches ... c=389&st=0 andDaniel Shawul wrote:Yes there were some serious bugs.
Not updating the in_check flag after making a move was what was causing the problem.
Piece values for the archbishop was B + N = 600 pawns and the Marshal had R + N = 800. I guess this was wrong. Where can I find the suggested values ?
http://z13.invisionfree.com/Gothic_Ches ... wtopic=421 .
Well, Grand Chess is a nasty case for several reasons. But now that you have it, I am sure you can meet your "10-min per variant" target by adding the following variants: gothic, capablanca and knightmate. Gothic and Capablanca are actually the same, except for the initial setup. They are on 10x8, with normal 1-rank promotion zone and promotion to any piece, like normal Chess. Only novelty is that the King moves 3 squares on castling, so that you have to test one more square for occupance and in-check. But if you can already do FRC castlings, this is nothing new either. And in Knightmate it is just a matter of swapping the King and Knight moves. This might be a 1-min implementation! (Plus a guarantee there will be future tournaments, as there are already many WB engines that play these variants.)I am trying to make a "templetized" code that will allow me to add variants instantaneously. (1 hour still too long). So I just define a piece with three features (movement, attack, piece value), then define the game... That is why the piece values are added like that ! The values do actually depend on the presence/absense of other similar pieces so something like you do i.e material table could be better. But I belive this is not worth more than 30 elo.
Also history tables were screwed up once more ?! Instead of update history for non-caps , I did it only for caps. I found this after a little adventure with Hex Rays which gave me ippolitish kind of Nebiyu_16xx c-like code to compare with current version.
I will upload a corrected version later.
-
- Posts: 4186
- Joined: Tue Mar 14, 2006 11:34 am
- Location: Ethiopia
Re: Grand Chess
Ok I have added the first two but I have doubts on the castling rules.
The king moves three squares and the rook is put to the right/left of the king right ? I will try knightmate later. I want to have code where the game is defined from ini like fairy max's.
Piece values are changed as your suggestion in that link.
The king moves three squares and the rook is put to the right/left of the king right ? I will try knightmate later. I want to have code where the game is defined from ini like fairy max's.
Piece values are changed as your suggestion in that link.
-
- Posts: 28395
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Grand Chess
Indeed, Rook ends next to King. They are exactly like FRC castlings, you end normally, relative to the corner.
-
- Posts: 4186
- Joined: Tue Mar 14, 2006 11:34 am
- Location: Ethiopia
Re: Grand Chess
Ok those are implemented fully now.
Knightmate looks even simpler. If I understood the game it is same as standard chess except the king moves like a knight and the knight like a king ? At first it seems there were two kings only it is NOT
For the first time the new engine beat the old one after the history fix !
I will include this new variants along with the new strong version and upload later.
This week is a break so I am going add in as much variants as I can.
EDIT:
Is it possible to "standardize" the pieceCharName string based on piece movement ? (f.i archbishop represented by A in all games it is in). This helps me in handling the setup command automatically.
Knightmate looks even simpler. If I understood the game it is same as standard chess except the king moves like a knight and the knight like a king ? At first it seems there were two kings only it is NOT

For the first time the new engine beat the old one after the history fix !
I will include this new variants along with the new strong version and upload later.
This week is a break so I am going add in as much variants as I can.
EDIT:
Is it possible to "standardize" the pieceCharName string based on piece movement ? (f.i archbishop represented by A in all games it is in). This helps me in handling the setup command automatically.
-
- Posts: 28395
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Grand Chess
Good choices (for which there would be opponents) are shatranj, makruk and perhaps courier (the latter requires 12x8). They are similar in evaluation, as the Pawns there promote to the nearly worthless Ferz. Makruk (Thai Chess) is actually one of the World's major Chess variants, played by millions (all Thai, of course. But you would be famous there!Daniel Shawul wrote:This week is a break so I am going add in as much variants as I can.

Now you can do promotion only to captured piece, Great Shatranj should also be trivial (but played by no one...), as it is the only uncommon thing there (except that all pieces move in unorthodox ways).
The hard point of Berolina (Pawns move as Spartan Hoplites, but no jump) is e.p. capture, as the e.p. square does not unambiguously determine if you can capture the left or the right Pawn. So you need to indicate both what you can capture, and where to (or with which).
Cylinder Chess might be tricky, depending on how you do the attack test. For Spartacus it would be aproblem, as I do something 0x88-like, with a ray scan for sliders. But on a cylinder board, there can be multiple rays connecting two squares (e.g. b3-g3 can go over c3, but also over a3).
Chess with Different Armies is also quite easy; just differently moving pieces, otherwise quite normal rules.
Of course there also are the ICS variants played by Pulsar, such as Atomic, TwoKings, 3Check, Suicide/Giveaway, Losers. The latter require completely different strategy, which might be hard. 3Check should be easy, the only problem is how to evaluate the number of checks you still have. Two-Kings is not very special (the two Kings are handled a bit different from Spartan Chess, though). Atomic just requires a more elaborate MakeMove for captures.
It would be nice if you could do Ultima, as a true demo for the use of variant alien, as due to all the funny capture rules, you really need it there. (In other words, it is not really a Chess variant...)
The really exotic stuff might be difficult. Like Xiangqi, with board zones some pieces may not leave, and (much worse) complex but crucial rules for scoring repetitions. I would not recommend that in a general variant playing engine, it needs lots of dedicated code, not useful for any other variant. On the other hand it is played by a huge number of people, and many dozens of engines are available.
This is a problem due to external constraints. For instance, to play Shatranj on ICC, you must use the ICC piece names, and the ICS uses B for Elephant, Q for Ferz. In Chess you would want to use B for Bishop. But now in Courer, both the Bishop and the Elephant participate, and then what? WinBoard is also not set up to separate engine names from PGN names. It would be very inconvenient to not be able to make standard PGN because the engine uses names taken from another variant that uses the same piece. (Like Archbishop was W(arlord) in Spartan Chess.) This is already a problem in Grand Chess, which really should use C for B+N and M for R+N, rather than A and C used in Gothic/Capablanca. Janus Chess uses J for B+N, Superchess S...EDIT:
Is it possible to "standardize" the pieceCharName string based on piece movement ? (f.i archbishop represented by A in all games it is in). This helps me in handling the setup command automatically.
Last edited by hgm on Sat Mar 12, 2011 10:47 pm, edited 1 time in total.