Grand Chess

Discussion of chess software programming and technical issues.

Moderator: Ras

Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Ultima chess available

Post by Daniel Shawul »

Finally got it. It is a problem with chamelon attacks movement. Like I suspected it was because I disabled attacks that I couldn't find the problem.
When the chamelon can become in contact with opposing king, it can capture it so it is illegal. In your example pos, the pawn is actually captured and it opened a line for the chamelon to move close to the king and capture..
So it thought it is illegal because chamelon can move close to king!

My attacks routine thought two more steps ahead when what it actually needed is to check if a chamelon is actually in contact with a king. Now that I think about it , this line of though may be what led me to a stupendously expensive attacks() :!: More later...
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Ultima chess available

Post by Daniel Shawul »

I guess that was the only one. Nps has slightly increased but still far from the one that doesn't do attacks. I will keep that one for later. I am pretty sure it is much stronger from the games I saw but I need to figure out how to filter legal moves at the root. In one of the games the game went on even after the king got captured which was a bit funny!
Here is the new version with the new usermove option for all games. https://sites.google.com/site/dshawul/N ... ects=0&d=1.
In checkers one could got away with a move to the unused squares against Nebiyu but not now...

Edit: There is still the issue of suicide moves ofcourse. I still have it at same from and to squares such as 'c5c5' to be suicide.
User avatar
George Tsavdaris
Posts: 1627
Joined: Thu Mar 09, 2006 12:35 pm

Re: Nebiyu 1.2 with 6 more variants

Post by George Tsavdaris »

Daniel Shawul wrote:Nebiyu 1.2 is available at https://sites.google.com/site/dshawul/N ... edirects=0

New variants added :

Code: Select all

            
            Gothic chess
            
Thanks for the new opponent: :D

[Event "Computer Chess Game"]
[Site "George"]
[Date "2011.03.20"]
[Round "1"]
[White "George"]
[Black "NebiyuChess_1.2"]
[Result "1-0"]
[TimeControl "40/300"]
[Variant "gothic"]
[Annotator "1... +0.10"]

1. f4 d5 {+0.10/14 1.8} 2. d4 Nh6 {+0.15/14 1.9} 3. g3 Nc6 {+0.00/14 1.1}
4. h3 g6 {+0.30/13 0.7} 5. c3 Be6 {+0.25/13 0.8} 6. Ah2 Qd7 {+0.30/12 1.9}
7. Bf3 a6 {+0.20/12 3} 8. Nj3 Bg7 {+0.25/11 3} 9. Cg2 f5 {+0.40/13 5} 10.
O-O Cd6 {+0.55/14 14} 11. e3 Re8 {+0.55/13 3} 12. Rf1 j5 {+0.60/14 1.0} 13.
g4 fxg4 {+0.60/13 1.5} 14. hxg4 Rj6 {+0.50/13 10} 15. Nh4 i5 {+0.75/14 8}
16. Nj3 Ni4 {+0.70/14 1.1} 17. Ag1 h6 {+0.70/13 6} 18. Nd2 b5 {+0.55/12 6}
19. e4 b4 {+0.25/10 1.9} 20. f5 gxf5 {+1.05/11 1.6} 21. gxf5 Bf7
{+0.85/10 32} 22. Bg4 Qd8 {+1.15/10 16} 23. e5 Nxe5 {+0.65/13 0.8} 24. dxe5
Bxe5+ {+0.65/15 2.5} 25. Kj1 bxc3 {+0.65/15 0.7} 26. bxc3 Bxc3 {+0.50/14 7}
27. Rb1 Af6 {+0.70/13 4} 28. Rb3 d4 {+1.20/12 4} 29. Nf3 Ag7 {+1.40/11 8}
30. Ah3 Bxb3 {+0.75/12 4} 31. Qxb3 Qb8 {-0.55/12 7} 32. Qc2 Qb5
{+0.80/13 6} 33. Qf2 Cf6 {+0.70/13 4} 34. Bf4 d3 {+0.15/15 10} 35. Bd2 Qb4
{+0.00/14 2.9} 36. Bxc3 Qxc3 {-0.35/17 1.0} 37. Nd4 Ng5 {-2.00/16 4} 38.
Ne6+ Nxe6 {-1.75/16 2.2} 39. fxe6 Cxf2 {-2.25/15 5} 40. Cxf2+ Kg8
{-1.20/16 1.3} 41. Cf7 Qd4 {-2.65/15 3} 42. Rg1 Qxg1+ {-6.80/18 2.5} 43.
Axg1 j4 {-8.90/18 19} 44. Af3 d2 {-11.75/19 2.2} 45. Ae4 d1=C+
{-299.79/19 2.8} 46. Bxd1 h5 {-299.83/18 10} 47. Cg5
{Black resigns} 1-0
After his son's birth they've asked him:
"Is it a boy or girl?"
YES! He replied.....
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: Ultima chess available

Post by Greg Strong »

Daniel Shawul wrote: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.
Wow, congratulations. I so happy there's finally interest in universal chess programs. For the long time it's been a very small field.

Ultima - ChessV uses these values:

Immobilizer = 8.2
Long Leaper = 5.3
Chameleon = 4.3
Withdrawer = 3.1
Coordinator = 2.9
Ultima Pawn = 1

They aren't based on computer analysis though. They are based on input from experienced players at chessvariants.org, primarily Roberto Lavieri if memory serves me correctly ...

In your program is the victory condition to capture the king or checkmate the king? Playing for checkmate makes for harder programming, but it's how the rules are written (thereby creating the possibility of stalemate, although I don't know if stalemate would ever happen in practice in Ultima.) The Zillions-of-Games implementation only plays for king capture.
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 »

Being stalemated counts as a loss in Ultima. That is equivalent to King capture, right?

For games where stalemate is a draw the programming also isn't a big deal. Normally you would award +INF for a King capture, so an illegal move would get score -INF. That would also be the value to which you initialize bestScore (outside QS). So if you end up with a bestScore equal to -INF, you know there are no legal moves, and you either correct to a checkmated score -INF+1 (the delayed-loss bonus would take care of that automatically in my engines), or to 0 when you are not in check. The latter you would know from the fact that the null move returned -INF. So in micro-Max the whole business of stalemates is only a single line:

Code: Select all

bestScore = bestScore > -INF || nullScore == -INF ? bestScore : 0;
In the Shatranj and Xiangqi version I removed that line.
User avatar
George Tsavdaris
Posts: 1627
Joined: Thu Mar 09, 2006 12:35 pm

Re: Ultima chess available

Post by George Tsavdaris »

hgm wrote: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
Since i have missed some episodes, where can i find Spartacus to download? If it's available of course.
Who wrote it?
After his son's birth they've asked him:
"Is it a boy or girl?"
YES! He replied.....
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 »

I created a font for Ultima pieces. It can be downloaded from

http://hgm.nubati.net/UltimaFont.zip .

It contains a .ttf file, whch you have to drop in your C:\WINDOWS\Fonts folder (or however it is called), plus a WinBoard ini file with settings, called ultima.ini, forputting in the WinBoard folder. You can then add an indirection on the engine install line for every engine you want to use the font for, like

NebiyuAlien /fd="..\Nebiyu" @ultima

(This automatically switches the variant to "alien" too, and switches off legality testing.) The settings map all the pieces used in Ultima (Lance, Elephant, etc.) to the intended Ultima glyph. In addition I set the fontPieceToCharTable to also map all orthodox Chess pieces to an Ultima piece. Even though that is not very applicable,it is better than seeing just squares with dots in them when you accidentally use this font in variant normal.

One more remark on NebiyuAlien:

It seems you got the initial position for Ultima wrong: the Kings are not supposed to be in the same file! The white King should go on d1.

General problems:

I see now that the chessvariants.org page on Ultima does specify letters for the pieces, (I had missed that before, but it is at the very beginning), and make a different choice than I did. It says 'C' should be used for Coordinator, not Chameleon, and the latter should be designated 'X'. I guess we should follow this standard, as this page seem to have ultmate authoroty. (Even the website of the inventor of the game refers to it for explanation of the rules.) So I guess we have to change FEN and pieceToCharTable sent by Nebiyu.

I am not happy with the c5c5 notation for suicides. Currently WB would reject such moves even with legality testing off, and it would require a lot of special code to make it work if I used it as internal representation. How about using

0@c5

in stead? This is a more natural generalization, as a suicide could be considered a drop of an empty square, and '0' (zero) is kind of a natural indicator for an empty square. (And, not being a letter, it cannot conflict with the drop of a real piece.) This would then both be the protocol format and SAN format.
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 »

George Tsavdaris wrote:Since i have missed some episodes, where can i find Spartacus to download? If it's available of course.
Who wrote it?
Spartacus is my new engine. It is not yet available. It is not finished in general (I want to add many more variants, as well as real evaluation), and does not even play gothic correctly (it can play O-O-O while b1 is occupied).
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Nebiyu 1.2 with 6 more variants

Post by Daniel Shawul »

Ayee...that hurts. But it keeps the motivation burning inside :) Allow me to blame this loss on untuned material values.
cheers
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Ultima chess available

Post by Daniel Shawul »

Hi Greg. Thanks for the info. I would prefer if the chameleon is valued higher. At least it can keep the immobilizer immobilized if it comes in contact with it. So I would give it same value as long-leapers which btw seems to me not so strong at least in the opening phase. Also the pawns do not seem like ordinary pawns which I would value higher , maybe at 1.5 pawns. But I am planning to do tuning which hopefully brings some valuable info.
n your program is the victory condition to capture the king or checkmate the king? Playing for checkmate makes for harder programming, but it's how the rules are written (thereby creating the possibility of stalemate, although I don't know if stalemate would ever happen in practice in Ultima.) The Zillions-of-Games implementation only plays for king capture.
Good question. I can do both but the one that does an attacks() is about 3.5x slower so I am planning to switch to letting the king be captured. Maybe do the attacks only when there is no legal move to check for stalemate. I have doubts though about the loss of check extension (or not reduction) if I don't do attacks. It probably results in serious elo loss.