Grand Chess

Discussion of chess software programming and technical issues.

Moderators: Harvey Williamson, bob, hgm

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
TonyJH
Posts: 163
Joined: Tue Jun 20, 2006 2:41 am
Location: USA
Contact:

Re: Grand Chess

Post by TonyJH » Fri Mar 18, 2011 4:06 am

Thanks for the instructions. Looks like crazyhouse960 is almost working, except promoted pieces are not reverting to pawns, which eventually causes a false illegal move in some games. This is with /pieceToCharTable="PNBRQ.......++++Kpnbrq.......++++k", and I also tried /pieceToCharTable="PNBRQ.......~~~~Kpnbrq.......~~~~k" with the same results (after I read a little bit about how pieceToCharTable table works).
I also notice that new games aren't automatically re-shuffled unless I use "New Shuffle Game..." instead of "New Game..." but maybe that is intended.
Still, many games play out just fine, and FRC castling works as expected in this mode.

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

Re: Grand Chess

Post by hgm » Fri Mar 18, 2011 8:59 am

Oh, I was mistaken. :oops: You should indeed use ~ in stead of +. (I have been doing Shogi for too long...) When you use + a piece from the 'promoted' family (the second group of 11) will be demoted on capture not to Pawn but to its unpromoted counterpart (11 earlier in the list).

You are also right about it not working as I intended. I had a look at the WB code, and in the routine to apply the move, I was still testing directly the variant type on a Pawn promotion, and only using the promoted form of the piece (which would revert automatically) in variants bughouse and crazyhouse. This was the way I initially implemented it, before designing the more general method of programming the behavior through the pieceToCharTable. I made a new version of WB doing it as I intended, nowavailable in the http://hgm.nubati.net/WinBoard-GC.zip package.

About the shuffling: when the initial-position number in the New Shuffle Variant is set to -1, it should make a new shuffle each game. Only when you put a number >= 0 there,all games will start with the corresponding position, untill you change that number. The "Random" button is only for selecting a fixed random position. Perhaps this is a bit confusing, and there should be two buttons, "Fixed" and "Randomize", where "Fixed" does what "Random" does now, (put a random number in the number field), and "Randomize" would put a -1 there.

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

Re: Grand Chess

Post by hgm » Fri Mar 18, 2011 9:23 am

Another 'Oops'...

When you play variants with Fischer castling (FRC or CRC) with holdings, because of the internal representation of such castlings as KxR, castling adds a Rook to your own holdings! :shock:

I guess I should only put _opponent_ pieces that are captured into the holdings...

[edit] fixed that too now, in the Grand-Chess package.

Daniel Shawul
Posts: 4050
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Ultima chess available

Post by Daniel Shawul » Fri Mar 18, 2011 6:28 pm

Ultima chess is finished. It is very slow but it works.
Nps has gone down 4x yet again mostly due to attack calculation.
When I removed that and let it capture the king, nps has gone up by 2x.
It also did the same for other variants as well which begs the question why
I should that anyway ? I don't need in_check except for extensions..
It should work in winboard except for some suicide moves it sometimes pops .

I used random piece values (i never really played the game). Chameleon has the largest, then immobilizer then the rest.

Bugs & sugestions welcome.

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

Re: Ultima chess available

Post by hgm » Fri Mar 18, 2011 8:59 pm

I tried again 10 bullet games in Gothic Chess, and Nebiyu got stuck in one of them:

Code: Select all

[Event "Computer Chess Game"]
[Site "CHESS_LAPTOP"]
[Date "2011.03.18"]
[Round "6"]
[White "NebiyuChess_1.2"]
[Black "Spartacus 1.00"]
[Result "0-1"]
[TimeControl "40/60"]
[Variant "gothic"]
[Annotator "1. +0.15   1... +0.29"]

1. Nc3 {+0.15/8} Nc6 {+0.29/8 1.8} 2. Nh3 {+0.15/9 1.5} Nh6 {+0.17/8 1.3}
3. Af3 {+0.10/7 1.8} d6 {+0.10/8 1.4} 4. a4 {+0.10/8 1.5} Bg4 {+0.69/8 1.5}
5. Ag5 {+0.15/6 1.4} f6 {+0.41/8 1.5} 6. Ai3 {+0.25/7 1.7} Bd7
{+0.38/8 2.6} 7. f3 {+0.15/9 1.7} g5 {+0.17/9 1.2} 8. g4 {+0.10/9 1.4} i6
{+0.39/9 0.9} 9. d4 {+0.25/10 1.3} Bj6 {+1.59/10 1.2} 10. Cg2
{+0.10/10 1.2} Nb4 {+0.82/9 1.5} 11. Be3 {+0.20/9 1.3} Ac4 {+1.13/9 2.7}
12. Nxg5 {+1.60/11 1.7} O-O {+0.82/9 1.1} 13. Aj4 {+1.50/11 1.4} Cg8
{+0.52/9 1.7} 14. Nge4 {+1.50/9 1.2} Qf8 {+0.70/8 1.0} 15. Bf4
{+1.40/8 1.2} e5 {+1.15/8 0.7} 16. Bc1 {+1.30/8 1.1} c6 {+1.11/7 1.1} 17.
h4 {+1.20/6 1.1} Be6 {+1.13/7 1.1} 18. b3 {+1.30/8 1.4} Ab6 {+0.60/8 1.0}
19. g5 {+1.65/9 2.5} fxg5 {+0.42/8 0.8} 20. hxg5 {+1.80/9 2.3} Ng4
{+0.81/9 1.1} 21. Axf8 {+1.75/12 1.3} Cxf8 {+0.83/9 0.8} 22. dxe5
{+1.80/11 1.1} dxe5 {+0.59/10 2.8} 23. Bd2 {+1.70/11 1.3} Rd8 {+1.36/9 0.8}
24. Rc1 {+1.20/10 1.4} Cg6 {+1.80/9 1.6} 25. Ri1 {+1.25/9 1.1} Ne3+
{+2.27/9 1.0} 26. Bxe3 {+1.70/13 9} Rxd1+ {+2.16/11 2.1} 27. Nxd1
{+1.75/12 0.9} Ad8 {+2.23/10 0.9} 28. c4 {+1.90/9 0.8} Bh4 {+2.28/10 1.4}
29. j4 {+2.05/9 0.7} Aa5 {+2.52/9 0.9} 30. Rb1 {+2.10/9 0.7} Bf5
{+2.58/10 1.4} 31. Ndf2 {+2.25/11 0.7} Nc2 {+2.25/9 1.1} 32. Bd2
{+2.00/10 0.7} Ab6 {+2.27/10 1.9} 33. c5 {+2.10/11 0.8} Ad7 {+2.40/10 2.1}
34. Rb2 {+1.60/10 1.5} Nd4 {+2.55/10 1.2} 35. Be3 {+1.60/9 0.6} Ae6
{+2.95/8 1.2} 36. i3 {+1.50/10 0.6} Bxf2 {+3.04/10 1.2} 37. Cxf2
{+1.40/11 0.7} Bxe4 {+3.31/10 1.3} 38. fxe4 {+0.75/12 0.6} Rf8
{+2.98/11 2.3} 39. Bf3 {+0.50/13 0.7} Axc5 {+3.17/11 3} 40. Rh1
{+0.70/10 0.9} Aa3 {+3.38/10 1.1} 41. Bc1 {+0.75/12 1.5} Nxf3 {+3.15/9 1.6}
42. exf3 {+1.00/10 0.3} Ac5 {+3.42/10 1.3} 43. Rh6 {+1.15/11 1.2} Ce7
{+3.55/11 1.4} 44. Kg2 {+0.30/11 1.3} Axf2 {+3.74/11 0.8} 45. Rxf2
{+0.15/15 1.6} Cd7 {+3.62/12 1.4} 46. Rf6 {+0.15/15 1.5} Rxf6
{+4.35/13 1.2} 47. gxf6 {+0.20/17 1.5} Cxf6 {+4.27/13 1.1} 48. Kh2
{+0.25/16 1.6} Cd6 {+4.17/13 1.4} 49. Rd2 {+0.20/17 1.5} Ch6+
{+4.04/13 1.0} 50. Kg2 {+0.15/18 1.5} Cf7 {+3.88/13 1.0} 51. Rd1
{+0.20/16 1.2} Cg7+ {+3.94/12 0.8} 52. Kf2 {+0.05/16 1.2} h5 {+3.66/13 1.3}
53. Be3 {+0.00/17 1.2} a6 {+3.61/13 1.3} 54. Rd6 {+0.00/18 1.3} Cf7
{+3.68/14 1.4} 55. Rh6 {+0.00/20 1.6} Cd7 {+3.79/13 1.0} 56. Ke2
{+0.00/21 1.6} Cg7 {+3.82/14 1.1} 57. Kf2 {+0.00/20 1.4} a5 {+3.89/14 1.7}
58. Rd6 {+0.55/16 1.2} Cf7 {+3.55/14 0.9} 59. Rd3 {+0.30/16 1.6} j6
{+3.74/13 1.4} 60. Bb6 {+0.00/17 1.5} Kh7 {+3.65/13 1.0} 61. Bxa5
{+0.60/17 1.4} i5 {+3.58/14 1.2} 62. jxi5 {+0.60/15 1.5} jxi5
{+3.38/14 1.3} 63. b4 {+0.55/13 1.7} h4 {+3.42/13 1.6} 64. ixh4
{+0.65/17 1.3} ixh4 {+3.49/14 1.2} 65. Rd2 {+0.60/16 1.4} Cg7
{+3.59/13 1.3} 66. Ke3 {+0.00/17 3} Kh6 {+3.78/13 2.1} 67. b5
{+0.00/15 1.3} Cg1 {+3.56/12 1.2} 68. bxc6 {+0.60/18 2.3} Cf1+
{+3.39/16 2.3} 69. Ke2 {+0.50/20 1.5} Cc1+ {+3.43/16 1.4} 70. Kf2
{+0.30/17 1.5} bxc6 {+3.49/16 4} 71. Rd6+ {+0.45/17 1.5} Ki5 {+4.08/15 1.3}
72. Be1 {-1.10/17 1.4} h3 {+4.51/14 4} 73. Rd8 {-2.50/17 1.3} h2
{+5.17/15 1.1} 74. Rh8 {-1.15/18 1.5} Ki4 {+5.15/16 1.1} 75. Kf1
{-1.50/19 1.3} Cd3 {+5.55/15 1.6} 76. Ri8+ {-1.80/18 1.3} Kj5
{+6.76/17 1.1} 77. Ri5+ {-4.00/18 1.5} Kj4 {+8.37/19 1.4} 78. Rh5
{-6.35/21 1.6} Cxf3+ {+8.47/19 1.4} 79. Bf2 {-6.55/21 2.0} Ki4
{+8.58/19 2.2} 80. Rxh2 {-7.30/20 1.7} Cxh2+ {+11.92/20 2.6} 81. Ke2
{-9.90/22 2.9} c5 {+11.96/20 2.0} 82. a5 {-7.50/20 1.3} c4 {+12.05/19 0.8}
83. a6 {-7.35/21 1.7} c3 {+12.23/19 1.8} 84. a7 {-7.80/17 1.5} c2
{+319.95/23 1.2} 85. a8=Q {-7.00/17 1.1} c1=C+ {+319.97/22 0.9}
{Black wins on time} 0-1
I guess it did not like Spartacus promoting to a second Chancellor (which in Gothic and Capablanca is perfectly allowed). It also doesn't see the mate coming, so apparently it had not expected the move. There was no "Illegal move" claim, however. (WinBoard would have forfeited it for such a claim.)

Spartacus also does still have a problem in Gothic: it plays O-O-O when b1 is occupied! :lol:

About the Ultima piece values:

I don't really know those either. I played a handful of Ultima games as a student, and from that I got the impression that the Immobilizer is the strongest piece. I think logic dictates that the Chameleon cannot be the strongest piece, as every piece sees it as itself. So its value must be some kind of average of that of the other piece values, which must always ly below the maximum.

The Withdrawer and Coordinator are pretty weak, but probably still stronger than the 'Pawn'. Perhaps a good zeroth approximation would be

Immobilizer 10
Long Leaper 7
Chameleon 6.5
Whithdrawer 4
Coordinator 3.5
Pawn 2.5

With that as a starting point we could do some imbalanced-material self-play to get some real data. (For that it is important that no two pieces have exactly the same value, because then it trades them too easily, which obscures a possible value difference.)

Daniel Shawul
Posts: 4050
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: Ultima chess available

Post by Daniel Shawul » Sat Mar 19, 2011 12:19 am

Yes I forgot to update adding promotion to the two fairy pieces since I had that loop unrolled. The Alien version would have understood the promotion. I have fixed that now. Nebiyu sends "Unknown command" for an illegal move. I chose to do that because I use the same code to process input not only from winboard.

About piece values , I really need to get my hands dirty with material tuning staff after I finish what I am doing now. I searched around for ultima and other variant piece values and couldn't find not one bit of information! It seems this whole concept is absent in the fairy piece world.
I gave the chameleon the largest just because it took me some time to get the implementation right , I thought it must be important ;) The immobilizer is indeed very strong.

I will look into your post about tuning when I get to it.

User avatar
Evert
Posts: 2929
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: Ultima chess available

Post by Evert » Sat Mar 19, 2011 1:07 am

Daniel Shawul wrote:I used random piece values (i never really played the game). Chameleon has the largest, then immobilizer then the rest.
There's some discussion of piece values here: http://www.chessvariants.org/index/list ... mid=Ultima

TonyJH
Posts: 163
Joined: Tue Jun 20, 2006 2:41 am
Location: USA
Contact:

Re: Grand Chess

Post by TonyJH » Sat Mar 19, 2011 6:21 am

Thanks. I tried a few games with the new Winboard and it's working well now.

Btw, I was curious: how does Spartacus's playing strength compare to Joker80 in Capablanca chess?

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

Re: Grand Chess

Post by hgm » Sat Mar 19, 2011 8:10 am

TonyJH wrote:Btw, I was curious: how does Spartacus's playing strength compare to Joker80 in Capablanca chess?
This is not really tested. I played ten 40/1 games gothic between Spartacus and Joker80, and Spartacus won 7-3. Hardly statistically significant, of course. And Spartacus does illegal Q-side castlings on 10x8, I still have to fix that.

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

Re: Ultima chess available

Post by hgm » Sat Mar 19, 2011 8:33 am

Daniel Shawul wrote:I searched around for ultima and other variant piece values and couldn't find not one bit of information! It seems this whole concept is absent in the fairy piece world.
It is not that variantists do not believe in piece values. But the classical piece values of orthodox Chess are based on empirical reslults of tens of thousands of games and end-game studies, that have accumulated over the centuries. For most variants that many human games are simply not available.

If you search on the internet, you might find piece values for the most-widely known variants, such as the B+R and B+N compound, but they cannot be considered reliable. In fact they are totally wrong more often than not. Because the only thing they are based on is educated guessing. Now it does not take very much effort (or education :lol: ) to do such guessing, so many, many people take a shot at it. And then usually all come to approximately the same result, as there aren't that many ways you could do it.

For instance, it is known that that Q, which is an R+B compound, is worth about 1.5 Pawn more than a separate R+B. (Namely 950-975 vs 500 + 325 on a certain scale) So this tells you there is some synergy bonus. So it is easy to guess that the B+N compound (Archbishop) would be about 1 Pawn stronger than separate B+N, (take slightly less synergy bonus because the total was weaker), which gets you at 2*325+ 100 = 750. So most guestimates you will find range from 700-750 on this scale. Unfortunately these are all off by 1-2 Pawns, as the empirical value seems to be 875-900, as in practice a Q vs A+P imbalance early in the game has an advantage (scorewise) in favor of the side that has A+P, and A still has a light advantage over R+N+P (on 10x8, where the Knight is somewhat weaker). In every imbalance I have tried the A consistently outperforms other combinations of pieces with a total value of 850.

So don't believe a thing from what you read on the internet about piece values. The only way is to determine them yourself.

For Xiangqi the situation is a bit different. This game also has a history of many centuries. But the situation is complicated there, because it is basially a race to mate, rather than a strategic battle to wear your opponent down. That makes tempo far more important compared to material than in orthodox Chess, obscuring the piece values, and causng a huge gradient in the piece-square tables for the slower pieces (a bit similar to passer bonuses in Chess). Furthermore, you have the concept of defensive pieces there, which cannot cross into the other half. Such pieces can only be used to protect your King, and hence are worth only something is there is something to defend against (and then they can be extremely valuable).

Post Reply