WinBoard, exotic version

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Re: WinBoard, exotic version

Post by hgm »

Yes, the Amazon can throw to its from-square.

Wouldn't it be simpler to consider the moving and the throwing to be separate plies? E.g. have a side-to-move variable that increments as stm = (stm + 1) & 3, and on stm == 0 do Amazon moves for white, on stm == 2 do lance throwing for white (by the previosly moved piece only, like it was an e.p. capture), etc.
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: WinBoard, exotic version

Post by Daniel Shawul »

I googled a bit and found out the maximum possible moves is around 2000. I am using 2048 for now.
Wouldn't it be simpler to consider the moving and the throwing to be separate plies? E.g. have a side-to-move variable that increments as stm = (stm + 1) & 3, and on stm == 0 do Amazon moves for white, on stm == 2 do lance throwing for white (by the previosly moved piece only, like it was an e.p. capture), etc.
Interesting idea! But since the amazon is forced to throw the arrow once it lands on its destination square, it probably complicates my search with selectivity : one with the newly defined "depth" parameter that should make sure the arrow be thrown, and another with move selection itself. It looks like successful programs use some kind of probcut to weed out all the week moves ! It is amazing they still used alpha-beta search. This is probably where I would have started throwing the dice aka MCTS :)
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: WinBoard, exotic version

Post by Daniel Shawul »

I am done with it :) The search depth is half of what you would expect but it can reach depth = 6 so far. But winboard doesn't seem to accept the double moves f.i

Code: Select all

move d1d3,
move P@d9 
Is the comma changed there too ?
Btw do we need to use different colors for the arrows thrown by both sides ?

Log
Hello NebiyuAmazons_1.0!
<000000002703>time 12000
<000000002703>otim 12000
<000000002703>go
[st = 2813ms, mt = 59250ms , hply = 0 , moves_left 40]
2 0 0 2907 j4i4h4 g10h10j10
2 0 0 4288 j4i4h4 g10h10j10
3 0 1 7720 j4i4h4 g10h10j10 i4i5i10
3 0 1 9602 j4i4h4 g10h10j10 i4i5i10
4 0 3 14365 j4i4h4 g10h10j10 i4i5i10 j7i8g10
4 0 34 249139 j4i4h4 g10h10j10 i4i5i10 j7i8g10
5 0 35 256825 j4i4h4 g10h10j10 i4i5i10 j7i8g10 g1g2g9
5 0 95 551611 j4i4h4 g10h10j10 i4i5i10 j7i8g10 g1g2g9
6 0 98 562616 j4i4h4 g10h10j10 i4i5i10 j7i8g10 g1g2g9 d10e10f10
6 0 167 1047568 j4i4h4 g10h10j10 i4i5i10 j7i8g10 g1g2g9 d10e10f10
7 0 170 1066869 j4i4h4 g10h10j10 i4i5i10 j7i8g10 g1g2g9 d10e10f10 i5h6d10
nodes = 1725039 <56 qnodes> time = 2906ms nps = 593612
splits = 0 badsplits = 0
<000000005609>move j4i4,
move P@h4
<000000005609>result 0-1 {Xboard: Forfeit due to invalid move: j4i4, (j4i4) res=21}

[FEN "3q2q3/10/10/q8q/10/10/Q8Q/10/10/3Q2Q3 w - - 0 1"]

1.j4i4h4

<000000005609>force
<000000005609>undo
<000000007890>quit
Bye Bye
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: WinBoard, exotic version

Post by Daniel Shawul »

Ok the amazons engine is included in the nebiyu package now. It played a game in console mode with no problems to the very end.
Its high branching factor especially in the opening is a big problem. I drop all moves beyond the 256th,
and even with that it is still difficult to get larger depth in the opening phase. Hash table,history and killers move ordering. Mobility evaluation only, no territory so far.

All it needs is a fix from HG on the double move issue to use winboard properly.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: WinBoard, exotic version

Post by hgm »

Was legality testing off, and P defined in the piece-to-char table? Amazons can be played wth legality testing on, but than it defines only A for the Amazon and L for the Lance. In that case the second part of the move should be written as the Amazon move, and you would not even have to write the comma

move d1d3
move d3d9

WB will automatically interpret d3d9 as L@d9. (I did it that way because than the second leg is automatically subjected to legality testing, i.e. you can only throw on squares where the Amazon could move to.)

The move will also be sent to the engine with an Amazon move substituted for the second leg. Like

move d1d3,d3d9
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: WinBoard, exotic version

Post by Daniel Shawul »

Yes it looks the setup is ok. Only problem is winboard has a rank which starts from 0 on a 10x10 board ?! Mine always starts from 1 so I have a rank 10. Could that be a problem ? Also I have the black pawns only and the pieceCharTable is defined as

Code: Select all

print&#40;"setup &#40;p...Q.....q.) %s\n",start_fen&#41;;
It displays Queens right at the start position. And I belive black pawns will show up as arrows later.


Edit:
Yes the rank numbering seems to be the problem. This sounds like a hack to avoid double digit rank numbering. Should I change mine or should you ? :) It still didn't show up the piece move and then drop correctly so I still have to follow strictly the plain move format with no comma that you suggested with rank starting from 0.
I also think that the normal move then drop move is more elegant. Why not allow multi-moves concatenated with a comma in all games ?
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: WinBoard, exotic version

Post by hgm »

OK, I discovered I had left in some code for debugging Checkers that was breaking double moving in Amazons. Sorry about that. I uploaded a new version now that fixes that. This version also employs some new rules for SAN moves:
SAN extension wrote:In games without Pawns, or games where multiple moves can only be done with the same piece as the preceeding leg (such as Checkers), the later legs of the move shorten the move format to to-square only if the same piece is moved. (The normal SAN meaning of such moves as a Pawn non-capture of a new Pawn is either impossible or illegal in those games, so there is no ambiguity.)
Using a comma after the first leg to suppress turn change, followed by a drop move, will still work in Amazons, with legality checking off, just like in any variant. In fact you could play Amazons as variant normal with legality checking off (but you would have to set the board size by hand of you want 10x10, then) by moving around Queens (or whatever) and dropping Pawns (or whatever).

Amazons is a bit better supported than the other alien variants, though, and you can play it with legality testing on. (Which I would recommend.) One consequence is that WB _forces_ you to do double-move entry: even when the first leg of the move does not end in a comma, WB appends the comma, and even when the second leg does end in a comma, WB deletes it. So even with legality testing off Amazons is a forced double-move game, ignoring commas. (But you can use them,ifyou want.) This means you cannot use it for a variant with another move pattern. But that is no big loss, as variant amazons really implements nothing special except for that double-move pattern (no special capture mode), so there is never any reason to want to use variant amazons for games with another move pattern. Variants multi or alien can be used in stead.

With legality checking off, variant amazons would allow any move as first or second leg, including drop moves of any (defined) piece anywhere (on board). A move of an Amazon in the secondleg will be interpreted as that Amazon throwing a spear, though, and converted to a drop move. (So that you can use a single click on the drop square to enter the second leg if you ant the Amazon you just moved to do the throwing, making use of the standard interface formulti-move entry.)

With legality checking on, however, it only accepts a legal non-capture of an Amazon for the first leg, (legal in the Chess sense of the piece you use to represent the Amazon, that is), and a legal move of that same Amazon as the second leg (so that it can use the shortened version of the second leg in SAN).

The standard pieceToCharTable for Amazons is

"....A.............L.....a.............l."

WinBoard automatically sets this when variant amazons is selected, so there is no need to include it in the initial setup command. The FEN is currently still needed, though. (I guess there currently is problem there, as WB does not accept you to setup the board with legality-testing on. I will fix that.)

On boards with 10 ranks counting commonly starts at 0 (e.g. Xiangqi). Indeed to prevent double digits. I don't like to make exceptions on that. And currently it would be rather pointless to make exceptions, as WB does not understand double-digit numbers in any move format. As WB is pervaded with code that assumes move[2] is the file-indicator of the to-square in the computer move, there is no easy way to fix that.
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: WinBoard, exotic version

Post by Daniel Shawul »

Ok it works only with legality off both with old and new pieceToChar table. But with legality on , I get a blank board even though I setup the pieceToCharTable and FEN as well. Also the drop moves are rejected even with a legality off test.

Code: Select all

1. Qad6,Qdg6 &#123;+1.40/4&#125; Qg3,e1 &#123;-0.20/7&#125; 2. Qh3,Qh8 &#123;+1.40/5&#125; Qe7,e2 &#123;+0.10/6&#125; 3. Q0d3,Qf3 &#123;+0.10/7&#125; Qc4,g8 &#123;+0.30/6&#125; 4. Qdf5,Qf7 &#123;+0.20/7&#125; Qb9,b0 &#123;+0.20/8&#125; 5. Qd4,Qdf6 &#123;+0.30/8&#125; Qi5,i0 &#123;+0.20/7&#125; 6. Qgg5,Qc1 &#123;+0.70/8&#125; Qa9,f4 &#123;+0.00/6&#125; 7. Qe6,Qa6 &#123;+0.60/8&#125; Qj9,b9 &#123;-0.30/8&#125; 8. Qj2,Qj8 &#123;+0.60/8&#125; Qd3,e3 &#123;-0.50/7&#125; 9. Qc6,Qf9 &#123;+0.60/8&#125; Qh7,h4 &#123;-0.30/9&#125; 10. Qdd5,Qh5 &#123;+0.80/8&#125; Qj7,j3 &#123;-0.50/9&#125; 11. Qc3,Qc7 &#123;+0.60/8&#125; Qb4,c4 &#123;-0.20/10&#125; 12. Qi1,Qii4 &#123;+0.40/10&#125; Qij4,h2 &#123;-0.20/10&#125; 13. Qhe6,Qb6 &#123;+0.30/9&#125; Qf5,d3 &#123;-0.20/10&#125; 14. Qg1,Qg4 &#123;+0.50/10&#125; Qjf8,c8 &#123;-0.20/12&#125; 15. Qee5,Qe9 &#123;+0.20/10&#125; Qb3,b5 &#123;-0.10/11&#125; 16. Qdd6,Qc6 &#123;+0.20/11&#125; Qa3,c5 &#123;-0.10/12&#125; 17. Qb3,Qbb2 &#123;+0.20/13&#125; Qe6,f5 &#123;+0.00/14&#125; 18. Qec3,Qce5 &#123;+0.10/13&#125; Qee7,d7 &#123;-0.10/13&#125; 19. Qa2,Qab3 &#123;+0.00/15&#125; Qb4,a3 &#123;+0.00/14&#125; 20. Qc0,Qa2 &#123;+0.10/18&#125; Qfj4,i3 &#123;-0.10/16&#125; 21. Qch0,Qj2 &#123;+0.10/18&#125; Qh6,g5 &#123;-0.10/17&#125; 22. Qc2,Qc3 &#123;+0.10/20&#125; Qi8,j9 &#123;-0.10/18&#125; 23. Qgh1,Qi2 &#123;+0.20/19&#125; Qj7,h9 &#123;-0.10/17&#125; 24. Q1i1,Qj0 &#123;+0.30/20&#125; Qhf8,g9 &#123;-0.30/16&#125; 25. Qig1,Qg3 &#123;+0.30/19&#125; Qi5,i9 &#123;-0.30/18&#125; 26. Qf1,Qj1 &#123;+0.30/21&#125; Qa4,b4 &#123;-0.30/19&#125; 27. Qd1,Qc2 &#123;+0.30/20&#125; Qc9,e7 &#123;-0.30/20&#125; 28. Qdd0,Qd2 &#123;+0.20/19&#125; Qd8,e8 &#123;-0.20/20&#125; 29. Qd5,Qe4 &#123;+0.30/20&#125; Qc9,d9 &#123;-0.20/24&#125; 30. Qc0,Qd1 &#123;+0.20/23&#125; Qa7,b7 &#123;-0.20/23&#125; 31. Qd6,Qe6 &#123;+0.20/23&#125; Qb8,a8 &#123;-0.20/22&#125; 32. Qb1,Qa0 &#123;+0.20/24&#125; Qc9,d8 &#123;-0.10/25&#125; 33. Qbc0,Qb1 &#123;+0.10/23&#125; Qb8,a9 &#123;-0.10/23&#125; 34. Qd5,Qd4 &#123;+0.20/22&#125; Qc9,a7 &#123;-0.10/19&#125; 35. Qd6,Qd5 &#123;+0.10/20&#125; Qb8,c9 &#123;+0.00/21&#125; 36. Qg2,Qh3 &#123;+0.00/19&#125; Qa5,a4 &#123;+0.00/19&#125; 37. Qf1,Qg2 &#123;+0.00/18&#125; Qh6,f8 &#123;+0.00/17&#125; 38. Qcd0,Qc0 &#123;+0.00/16&#125; Qi5,j4 &#123;+0.00/15&#125; 39. Qde0,Qd0 &#123;-0.10/14&#125; Qii6,j5 &#123;+0.10/13&#125; 40. Qef0,Q0e0 &#123;-194.80/13&#125; Qjh7,j7 &#123;+195.20/27&#125; 41. Qf0g0,Qgf0 &#123;-195.60/21&#125; Qhi7,i8 &#123;+196.00/64&#125; 42. Qgh1,Q1i1 &#123;-196.40/64&#125; Qi5,j6 &#123;+196.80/64&#125; 43. Qh1g1,Qgh1 &#123;-197.20/64&#125; Q5g7,h7 &#123;+197.60/64&#125; 44. Qgf2,Q2g1 &#123;-198.00/64&#125; Qgh6,g7 &#123;+198.40/64&#125; 45. Qfg0,Qgf1 &#123;-198.80/64&#125; Qhi6,i5 &#123;+199.20/64&#125; 

Code: Select all

1. Ad5,b5 &#123;+1.00/4&#125; Agg3,d3 &#123;-0.20/6&#125; 2. Ac6,i6 &#123;+0.50/6&#125; Af7,f1 &#123;+1.00/7&#125; 3. Ag9,e7 &#123;-0.10/4&#125; Aa7,h0 &#123;+0.50/6&#125; 4. Ag5,f4 &#123;+0.10/7&#125; Ah8,c3 &#123;+0.70/7&#125; 5. Ae6,a6 &#123;+0.10/8&#125; Ag2,g4 &#123;+0.40/8&#125; 6. Ad0,f2 &#123;+0.10/8&#125; Ae3,c5 &#123;+0.30/7&#125; 7. Ah3,f3 &#123;+0.20/8&#125; Ae4,e0 &#123;+0.20/8&#125; 8. Ag8,g7 &#123;-0.10/8&#125; Ad9,d7 &#123;+0.40/7&#125; 9. Ad5,f5 &#123;+0.10/8&#125; Ai2,i5 &#123;+0.10/8&#125; 10. Aa2,e6 &#123;+0.10/9&#125; Ab4,b0 &#123;+0.30/8&#125; 11. Ah2,h7 &#123;-0.10/9&#125; Ab2,b1 &#123;+0.20/9&#125; 12. Ae8,e9 &#123;-0.20/9&#125; Aj3,i3 &#123;+0.30/10&#125; 13. Ai2,j2 &#123;-0.10/9&#125; Ad8,a5 &#123;+0.30/10&#125; 14. Ah1,h6 &#123;-0.30/10&#125; Ah5,h2 &#123;+0.60/11&#125; 15. Ad5,b3 &#123;-0.30/12&#125; Ad2,d1 &#123;+0.50/11&#125; 16. Aj3,j8 &#123;-0.40/11&#125; Ae3,c1 &#123;+0.50/11&#125; 17. Ae1,d0 &#123;-0.40/12&#125; Ab8,b7 &#123;+0.40/12&#125; 18. Ag8,f7 &#123;-0.30/13&#125; Af8,f9 &#123;+0.30/12&#125; 19. Ac6,c8 &#123;-0.10/14&#125; Ah3,i2 &#123;+0.10/13&#125; 20. Ai4,h4 &#123;-0.10/14&#125; Ah9,h8 &#123;+0.00/13&#125; 21. Ac7,d8 &#123;+0.00/16&#125; Ag2,g0 &#123;+0.00/16&#125; 22. Ad2,a2 &#123;+0.10/17&#125; Ad4,d6 &#123;-0.10/16&#125; 23. Ae3,e5 &#123;+0.10/21&#125; Ae8,d9 &#123;-0.10/17&#125; 24. Ac6,e4 &#123;+0.20/17&#125; Ab4,a3 &#123;-0.30/16&#125; 25. Ad4,c4 &#123;+0.40/20&#125; Af8,g9 &#123;-0.40/19&#125; 26. Aj5,h3 &#123;+0.50/20&#125; Aj7,h9 &#123;-0.40/22&#125; 27. Ae3,d4 &#123;+0.50/25&#125; Ag1,f0 &#123;-0.40/24&#125; 28. Aj3,j6 &#123;+0.50/23&#125; Ai8,i9 &#123;-0.60/21&#125; 29. Ae2,e3 &#123;+0.60/25&#125; Ag2,g3 &#123;-0.50/24&#125; 30. Ac7,c6 &#123;+0.60/23&#125; Ai0,g2 &#123;-0.60/22&#125; 31. Aa9,c9 &#123;+0.50/21&#125; Ai1,j0 &#123;-0.60/19&#125; 32. Ai4,j5 &#123;+0.60/19&#125; Aj1,i0 &#123;-192.40/19&#125; 33. Aj3,j4 &#123;+192.80/24&#125; Ai7,j7 &#123;-193.20/22&#125; 34. Ag6,f6 &#123;+193.60/64&#125; Ai8,i7 &#123;-194.00/63&#125; 35. Ab2,a1 &#123;+194.40/64&#125; Aj9,i8 &#123;-194.80/64&#125; 36. Ad2,e2 &#123;+195.20/64&#125; Ai1,j1 &#123;-195.60/64&#125; 37. Ah5,g5 &#123;+196.00/64&#125; Ah1,i1 &#123;-196.40/64&#125; 38. Ag6,j3 &#123;+196.80/64&#125; Ag1,h1 &#123;-197.20/64&#125; 39. Ah5,g6 &#123;+197.60/64&#125; Ae8,f8 &#123;-198.00/64&#125; 40. Ai4,h5 &#123;+198.40/64&#125; Aa4,b4 41. Ab8,a8 &#123;+199.20/64&#125; 
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: WinBoard, exotic version

Post by hgm »

Oh, I thought I had solved the board-setup problem. But I might have forgotten to upload it before I started working on pushing the sources. Anyway, I uploaded it now, together with a fix on the legality test of the throw. (I was using variables toX and toY to test emptiness, while in fact this particuar routine knows them as ft and rt, so that the global variables toX and toY were used, which are variables from the mouse handler. That meant I could not spot the error when entering moves with the mouse...)

This should make it work even with legality checking, and I uploaded the new version.

Indeed, I checked it and drop moves are flagged as 'impossible', because there are no holdings in this game, and only Reversi and Go are exempted from this. I guess it is more logical to keep it that way.
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: WinBoard, exotic version

Post by Daniel Shawul »

Yes it displays the board with legality on now. It can also make the moves correctly iff I send the move without a ','. With comma in it doesn't work. Winboard always sends the moves with comma inserted so this is a bit inconsistent. I need to fix this in my code first. Next up will be testing the 'alien' mode where I can do whatever I want. Maybe I will use amazon itself after declaring it as an alien game.