SjaakII 1.0 RC1

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

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

Re: SjaakII 1.0 RC6

Post by Evert »

hgm wrote:Great! The variant Werewolf Chess I am working on now will likely feature a Werewolf with a linear 2-step capture camcK in addition to a normal Q3 slide. Could it do such a move combination too?
Yes. Leaper and slider/stepper moves are separate move options, and these can be combined arbitrarily.
(It will also be 'contageous'.)
That will also work.
Btw, I did some more testing concerning the value of jumps. The piece Q3AD almost exactly balances a normal Queen (scored 51% in 400 games). Apparently the jumping power is worth as much as all distance>3 moves. When I take away the jumps (so a plain Q3), the Queen wins by 64%.
Interesting. Was that the same as for bishops (FA vs B)?
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: SjaakII 1.0 RC6

Post by Evert »

The move-to-string functions currently produce this for Lion moves (Q=L):

[d]rnbqkbnr/ppp1pppp/4p3/2PpQ3/8/8/PPP1PPPP/RNB1KBNR w KQkq d6 0 1

Code: Select all

67 moves
  1/ 67 Nb1-d2     Nd2        b1d2      
  2/ 67 Nb1-a3     Na3        b1a3      
  3/ 67 Nb1-c3     Nc3        b1c3      
  4/ 67 Ng1-f3     Nf3        g1f3      
  5/ 67 Ng1-h3     Nh3        g1h3      
  6/ 67 Bc1-d2     Bd2        c1d2      
  7/ 67 Bc1-e3     Be3        c1e3      
  8/ 67 Bc1-f4     Bf4        c1f4      
  9/ 67 Bc1-g5     Bg5        c1g5      
 10/ 67 Bc1-h6     Bh6        c1h6      
 11/ 67 Ke1-d1     Kd1        e1d1      
 12/ 67 Ke1-d2     Kd2        e1d2      
 13/ 67 Le5-c3     Lc3        e5c3      
 14/ 67 Le5-d3     Ld3        e5d3      
 15/ 67 Le5-e3     Le3        e5e3      
 16/ 67 Le5-f3     Lf3        e5f3      
 17/ 67 Le5-g3     Lg3        e5g3      
 18/ 67 Le5-c4     Lc4        e5c4      
 19/ 67 Le5-d4     Ld4        e5d4      
 20/ 67 Le5-e4     Le4        e5e4      
 21/ 67 Le5-f4     Lf4        e5f4      
 22/ 67 Le5-g4     Lg4        e5g4      
 23/ 67 Le5-e5     Le5        @@@@      
 24/ 67 Le5-f5     Lf5        e5f5      
 25/ 67 Le5-g5     Lg5        e5g5      
 26/ 67 Le5-c6     Lc6        e5c6      
 27/ 67 Le5-d6     Ld6        e5d6      
 28/ 67 Le5-f6     Lf6        e5f6      
 29/ 67 Le5-g6     Lg6        e5g6      
 30/ 67 Le5-d7     Ld7        e5d7      
 31/ 67 Le5xd5     Lxd5       e5d5      
 32/ 67 Le5xd5xe6  Le5xd5xe6  e5d5,d5e6 
 33/ 67 Le5xd5-c4  Lxd5-c4    e5d5,d5c4 
 34/ 67 Le5xd5-d4  Lxd5-d4    e5d5,d5d4 
 35/ 67 Le5xd5-e4  Lxd5-e4    e5d5,d5e4 
 36/ 67 Le5xd5-e5  Lxd5-e5    e5d5,d5e5 
 37/ 67 Le5xd5-c6  Lxd5-c6    e5d5,d5c6 
 38/ 67 Le5xd5-d6  Lxd5-d6    e5d5,d5d6 
 39/ 67 Le5xe6     Lxe6       e5e6      
 40/ 67 Le5xe6xd5  Le5xe6xd5  e5e6,e6d5 
 41/ 67 Le5xe6xe7  Le5xe6xe7  e5e6,e6e7 
 42/ 67 Le5xe6xf7  Le5xe6xf7  e5e6,e6f7 
 43/ 67 Le5xe6-e5  Lxe6-e5    e5e6,e6e5 
 44/ 67 Le5xe6-f5  Lxe6-f5    e5e6,e6f5 
 45/ 67 Le5xe6-d6  Lxe6-d6    e5e6,e6d6 
 46/ 67 Le5xe6-f6  Lxe6-f6    e5e6,e6f6 
 47/ 67 Le5xe6-d7  Lxe6-d7    e5e6,e6d7 
 48/ 67 Le5xc7     Lxc7       e5c7      
 49/ 67 Le5xe7     Lxe7       e5e7      
 50/ 67 Le5xf7     Lxf7       e5f7      
 51/ 67 Le5xg7     Lxg7       e5g7      
 52/ 67  c5-c6      c6        c5c6      
 53/ 67  a2-a3      a3        a2a3      
 54/ 67  b2-b3      b3        b2b3      
 55/ 67  c2-c3      c3        c2c3      
 56/ 67  e2-e3      e3        e2e3      
 57/ 67  f2-f3      f3        f2f3      
 58/ 67  g2-g3      g3        g2g3      
 59/ 67  h2-h3      h3        h2h3      
 60/ 67  a2-a4      a4        a2a4      
 61/ 67  b2-b4      b4        b2b4      
 62/ 67  c2-c4      c4        c2c4      
 63/ 67  e2-e4      e4        e2e4      
 64/ 67  f2-f4      f4        f2f4      
 65/ 67  g2-g4      g4        g2g4      
 66/ 67  h2-h4      h4        h2h4      
 67/ 67  c5xd6      cxd6      c5d6      
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: SjaakII 1.0 RC6

Post by Evert »

Is there a correct way to send lion moves to XBoard's Betza generator? SjaakII currently outputs "?", which means it has no clue how to do it.
User avatar
hgm
Posts: 28496
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: SjaakII 1.0 RC6

Post by hgm »

Evert wrote:Interesting. Was that the same as for bishops (FA vs B)?
Well, for Bishops the jump was worth the same as all moves with d > 2. For Q you still need the d=3 move to break even. But this was to be expected, as for the Rook WD is only Knight-class, so the orthogonal moves of the Queen suffer much more.
Evert wrote:Is there a correct way to send lion moves to XBoard's Betza generator? SjaakII currently outputs "?", which means it has no clue how to do it.
This can be done using the 'a' ('again') modifier: caK for "capture as King and (move or capture) again as King". This would omit the 'igui', as by default a successor step has all directions except exactly back. So igui will have to be specified separately as cabK, and conditional null move could be mabK (or abK, as 'm' is the default modality for non-final legs).
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: SjaakII 1.0 RC6

Post by Evert »

hgm wrote: This can be done using the 'a' ('again') modifier: caK for "capture as King and (move or capture) again as King". This would omit the 'igui', as by default a successor step has all directions except exactly back. So igui will have to be specified separately as cabK, and conditional null move could be mabK (or abK, as 'm' is the default modality for non-final legs).
Let me try to work out what the full move could look like.
Should it be something like mKNADcacKcamKmacKcabKmabK?

EDIT: Is this up-to-date: http://hgm.nubati.net/Betza.html ?
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: SjaakII 1.0 RC6

Post by Evert »

Actually, my converter currently spits out "aK" for lion moves, which does actually suggest "as K and again as K", so looks like a good short-hand for "mamKcamKcacKmacK"; it's missing "abK" though.

Would that work? Or do I need to distribute c and m over a?
User avatar
hgm
Posts: 28496
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: SjaakII 1.0 RC6

Post by hgm »

Evert wrote:Let me try to work out what the full move could look like.
Should it be something like mKNADcacKcamKmacKcabKmabK?

EDIT: Is this up-to-date: http://hgm.nubati.net/Betza.html ?
This can be considered up to date, and even describes more that what is actually implemented in XBoard 4.8.0 (namely the drops).

aK is not good enough for two reasons:

1) the default modality of the leg before an 'a' is 'm', and not 'mc'. So aK means mamcK = mamKmacK, which misses the camKcacK part. The compact notation would be mcaK to indicate the 'Lion power' (= capturing on a non-final leg).

2) the default direction set for a leg after 'a' is not 'all', but 'all except exactly backwards'. This was chosen because intuitively moving exactly back is a bit different from moving on, and in verbal descriptions 'igui' is usually mentioned separately from hit-and-run captures. I could imagine some pieces would not allow the 'exactly-back' direction, and it would be very cumbersome to sum up all other directions.

So you would have to write mcaKmcabK to include the 'return to starting square' path. The advantage is that you don't have to include the 'm' part in the first atom, as it was already covered by the KNAD. You could of course also leave out the KNAD, and write mcpaKmcabK. The mpaK part of the first term would then cover any KNAD move, as you could always get to those squares in two K steps if you are allowed to pass over both empty and (non-destructively) over occupied squares. The mcabK term then has to be singled out, because it must exclude the pabK: you are not allowed to null-move when all adjacent squares are occupied.

KNADcaKmcabK

is probably the cleanest and most intuitive description: it explicitly mentions all direct steps (move or capture), then the hit-and-run and double captures, and finally igui and conditional turn passing. There is no overlap between any of these, as there would be in mpaK, where most squares can be reached in a number of ways.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: SjaakII 1.0 RC6

Post by Evert »

hgm wrote: aK is not good enough for two reasons:

1) the default modality of the leg before an 'a' is 'm', and not 'mc'. So aK means mamcK = mamKmacK, which misses the camKcacK part. The compact notation would be mcaK to indicate the 'Lion power' (= capturing on a non-final leg).

2) the default direction set for a leg after 'a' is not 'all', but 'all except exactly backwards'. This was chosen because intuitively moving exactly back is a bit different from moving on, and in verbal descriptions 'igui' is usually mentioned separately from hit-and-run captures. I could imagine some pieces would not allow the 'exactly-back' direction, and it would be very cumbersome to sum up all other directions.

So you would have to write mcaKmcabK to include the 'return to starting square' path. The advantage is that you don't have to include the 'm' part in the first atom, as it was already covered by the KNAD. You could of course also leave out the KNAD, and write mcpaKmcabK. The mpaK part of the first term would then cover any KNAD move, as you could always get to those squares in two K steps if you are allowed to pass over both empty and (non-destructively) over occupied squares. The mcabK term then has to be singled out, because it must exclude the pabK: you are not allowed to null-move when all adjacent squares are occupied.

KNADcaKmcabK

is probably the cleanest and most intuitive description: it explicitly mentions all direct steps (move or capture), then the hit-and-run and double captures, and finally igui and conditional turn passing. There is no overlap between any of these, as there would be in mpaK, where most squares can be reached in a number of ways.
Ok, I've added some extra post-processing to the Betza generator.
The way it works is by making Betza strings for the normal and capture moves separately (these are independent things in SjaakII's piece description), the Betza generator doesn't know whether it's processing a move, a capture, or both (was slightly easier to do at the time, perhaps I'll rewrite it at some point).
It then does a common element extraction on the strings to extract "shared", "move only" and "capture only". So when it extracts "aK" for move and capture, what it really means is "mamK" and "macKcacKcamK". Due to the way its double-step move generator works (only works for leapers, by the way, not for sliders), "p" and "mcabK" are also implied (the origin square would need to be explicitly disallowed, the Lion move is defined as a double-step non-lame leaper). So I've added a post-processor that translates the "aK" produced by the string generator to "mcpaKmcabK".

I agree "KNADcaKmcabK" is probably the neatest way to describe a lion move, but it requires a bit more context for the generator to do it. As long as XBoard can work out what move targets are for the pieces that it gets told about, that's good enough for now.

In other news, Elven Chess seems to work as well as it should, but SjaakII gets forfeited in about 50% of the games because it does Lxprotected L, which it doesn't know about yet.
I also need to fix the highlight command for double-leg moves.
User avatar
hgm
Posts: 28496
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: SjaakII 1.0 RC6

Post by hgm »

Evert wrote:I also need to fix the highlight command for double-leg moves.
Be sure to mark squares that can both be final and intermediate (i.e. the K-squares for the Lion) always in cyan. And then expect a put + lift for that square when it is clicked, to which the engine then should reply with a highlight command for the next leg, which can include the square itself if the second leg was optional. So that the one-leg move can then be entered by clicking that square a second time. XBoard will be smart enough to strip any null-move legs from the move before processing it further.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: SjaakII 1.0 RC6

Post by Evert »

hgm wrote: Be sure to mark squares that can both be final and intermediate (i.e. the K-squares for the Lion) always in cyan.
Even if there is no particular reason to mark them (ie, there is no capture there)?
The move generator will only store the intermediate square if there is a capture there, otherwise it encodes a straight capture or move to the final destination. This encoding is the only part that the interface code gets to see, and there is no direct way for it to get the intermediate squares (in other words, this would require a fairly massive change to the way the code is organised).

The technical reason for this is that the game state sits inside a template class (with the bitboard type as template parameter, ie, 32, 64 or 128 bit integer type) while the interface code sits outside it and only deals with the base (non-template) class.

So I would prefer not touching that. What is the downside of not marking an empty square as cyan? As far as I can see there is no downside, but I may be missing something.