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 »

Ah, hit another limitation: I only allow one piece to be placed into holdings per move. I need to check if doing two would still fit...
User avatar
hgm
Posts: 28513
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: SjaakII 1.0 RC6

Post by hgm »

myfish wrote:I've just had a problem in washogi where certain '+'s in the promotion string all seemed to point to the same piece, some of which were already in use.
I haven't figured out exactly what the problem was, but I guess you are running into the effect that although XBoard internally distinguishes 44 piece types, some of those use the same image, as I did not have 44 images in the default set. Chu needed only 36 types (39 if you count things like K and +DE as different).

So I used 20 of XBoard's 22 'unpromoted' pieces (unused remained N and the Grasshopper piece normally represented by narrow crown). For Chu I wanted some special glyphs for promotable pieces, though (in particular hor. and vert. swords, Leopard and Tiger, to replace unsuitable (too Knight-like) glyphs). So the Hawk, Unicorn, N-R Chimera and Nightrider are replaced in Chu only by these.

Chu only needed 15 promoted pieces, though (plus King, which resides in the promoted series, because it had to be last), 18 if separate +DE, +Kn and +Ph were needed. So 3 pieces here remained completely unused, namely those corresponding to the unpromoted Knight, Queen and Grasshopper. So I did assign the replacement glyphs for swords and Leopard to these unused pieces, so that these glyphs could also be used in variants other than Chu, where they would not replace Hawk, Unicorn, etc.

But that means in Chu two pieces with the same glyph (using the same SVG file) will be present amongst the 44. To be sure that you are not struck by this, you should only use pieces that were used in Chu Shogi. And even then you should avoid the promoted Cobra, as it uses the same Elephant glyph as the normal Elephant. Which was OK for Chu (although Kanji users did not like it, because it was not red), but might not be OK for Wa. But Wa has fewer piece types than Chu, so this should be feasible.

In hindsight it would have been better not to use the unused Chu pieces as 'storage slots' for Chu-specific replacement images, but use promoted slots that would be replaced by glyphs pushed out of the first 22 by the replacements. So basically just permute glyphs through used slots, so they would always remain different, and reserve the unused ones for completely (and as yet non-existing) images. Then all glyphs would have been available in all variants, without any duplicats, just in another order in Chu (to match the specialpromotion requirements there with default-theme images).
User avatar
hgm
Posts: 28513
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:Hmm... so if I have a lion on e1 (say) and enemy pieces on d2,e2,f2 and e3 (say), can I jump directly to e3 without eating any of the pieces that block the path for the king?
Indeed. All the moves can also be taken as a direct jump. (The inconsistency is that when you would also have pieces on d1 and f1, you could not null-move. But there seems to be global consensus about this, although I cannot see how anyone could possibly know if these were the historic rules. It seems to me the situation would just never occur. It might be trickier when you have only Falcon, as it could null-move only by moving to and back from a single neighboring square, which could accidentally be occupied even on a near-empty board.)

So I guess this is a problem when you treat side-effect captures and normal captures as the same type of move, just like you could not do normal captures + lame captures.
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: SjaakII 1.0 RC6

Post by gbtami »

Evert wrote:
gbtami wrote: Wikipedia say: "Feudal lords promote to general when they reach diagonal lines marked on the board." I don't know how it is authentic though.
It's very hard to get a clear and consistent picture of Sittuyin promotion rules, and you can find some different versions floating around.

The main question here is whether promotion is mandatory, or optional. I interpreted the rules as optional, but the Wikipedia entry is not entirely clear. The first sentence just says "feudal lords promote", but then it continues "the promotion is possible only if that player's general has been captured." This is a bit between the lines, but if the intention was to say that promotions are mandatory, I would expect the second sentence to say something like "promotion only happens if...". The way it reads now suggests that promotion is an option that is only available when your general has been captured.

http://www.chessvariants.org/oriental.dir/burmese.html lists a very different rule:
However, promotion is not immediate upon arrival on the square (as in usual chess.) Instead, when a pawn reaches a promotion square, he stays a pawn that move. In a later turn, the pawn can be changed into a general in the following ways (always provided the original general has been taken): no ordinary move is made that turn - instead the turn is used to change the pawn to general; the pawn makes a generals move and is simultaneously transformed into a general. However, in the latter one may not give check or take the general of the opponent with this move.
So this says that a pawn never promotes immediately, and when it does promote may do so either where it is, or by making a move as though it already had promoted. I don't remember where I read this, but I read a discussion somewhere that this rule is probably false (I may have kept notes). It would certainly be a pain to implement.

http://www.chessvariants.org/oriental.d ... chess.html says
On reaching any square on either diagonal line of the board, a Ne may be promoted to a Sit-ke, if the player has no Sit-ke on the board. If a Ne is already on a diagonal, and if the player has no Sit-ke on the board, he may promote the Ne instead of moving with such a promotion counting as a turn.

Because the Sit-ke is, by definition, not much more powerful than a Ne itself, the possibility of Ne promotion seems to be of minor importance. Thus players are reluctant to promote a Ne at the cost of wasting a move or losing tempo.
which seems to be pretty clear that promotion is entirely optional (a "Ne may promote", "players are reluctant to promote a Ne").

Finally, http://www.ancientchess.com/page/play-sittuyin.htm says
When a pawn (nè) moves onto one of these lines, on his opponent’s side of the chessboard, the pawn may be promoted to a queen (sit-ke), only if the queen has been captured and is out of play. If a player has a pawn standing on one of these promotion squares , not yet promoted, he may choose to promote the pawn at any time, as long as the pawn is on the promotion square and the queen is available, off of the board. Choosing to promote the pawn in this way constitutes a move, and the player does not move any piece on the board until his next turn.
Which is basically the same as the last one. I think I decided at the time that this was a majority vote for the interpretation of promotion being optional and in-place if it was deferred.

I don't remember of Pritchard says anything particularly illuminating on this, but I can check.

Of course I'm not claiming that my interpretation is necessarily right...
OK, thx for the explanation. Changed pychess-engine as you suggested (always optional promotion). Fixed the readline issue with python2 too. Now you can paste FEN after startboard, etc. The sittuyin perft values of sjaakii and pychess now match. \o/

Played several sjaakii-pychess sittuyin games in PyChess GUI without any problem now.
Unfortunately xboard (with legality testing off) say on very first sjaakii move:
result 0-1 {Xboard: Forfeit due to invalid move: S@e3 (_1_1 via ^0) res=24}
User avatar
hgm
Posts: 28513
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: SjaakII 1.0 RC6

Post by hgm »

Is this the XBoard development version?
myfish
Posts: 131
Joined: Sat Feb 07, 2015 3:17 pm

Re: SjaakII 1.0 RC6

Post by myfish »

hgm wrote:
myfish wrote:I've just had a problem in washogi where certain '+'s in the promotion string all seemed to point to the same piece, some of which were already in use.
I haven't figured out exactly what the problem was, but I guess you are running into the effect that although XBoard internally distinguishes 44 piece types, some of those use the same image, as I did not have 44 images in the default set. Chu needed only 36 types (39 if you count things like K and +DE as different).

So I used 20 of XBoard's 22 'unpromoted' pieces (unused remained N and the Grasshopper piece normally represented by narrow crown). For Chu I wanted some special glyphs for promotable pieces, though (in particular hor. and vert. swords, Leopard and Tiger, to replace unsuitable (too Knight-like) glyphs). So the Hawk, Unicorn, N-R Chimera and Nightrider are replaced in Chu only by these.

Chu only needed 15 promoted pieces, though (plus King, which resides in the promoted series, because it had to be last), 18 if separate +DE, +Kn and +Ph were needed. So 3 pieces here remained completely unused, namely those corresponding to the unpromoted Knight, Queen and Grasshopper. So I did assign the replacement glyphs for swords and Leopard to these unused pieces, so that these glyphs could also be used in variants other than Chu, where they would not replace Hawk, Unicorn, etc.

But that means in Chu two pieces with the same glyph (using the same SVG file) will be present amongst the 44. To be sure that you are not struck by this, you should only use pieces that were used in Chu Shogi. And even then you should avoid the promoted Cobra, as it uses the same Elephant glyph as the normal Elephant. Which was OK for Chu (although Kanji users did not like it, because it was not red), but might not be OK for Wa. But Wa has fewer piece types than Chu, so this should be feasible.

In hindsight it would have been better not to use the unused Chu pieces as 'storage slots' for Chu-specific replacement images, but use promoted slots that would be replaced by glyphs pushed out of the first 22 by the replacements. So basically just permute glyphs through used slots, so they would always remain different, and reserve the unused ones for completely (and as yet non-existing) images. Then all glyphs would have been available in all variants, without any duplicats, just in another order in Chu (to match the specialpromotion requirements there with default-theme images).
Hindsight is a wonderful thing.
I know there are plans afoot for some 'larger variants' so I'm sure this will be addressed in due course. Renaming the pieces to suit etc will be a bit of effort but, that's progress.

I was one of the people moaning about the promoted 'go-between' turning into a 'black elephant piece. Others, I could have lived with but, on the admittedly remote chance you could have had, a real 'Elephant' and a promoted go-between in play and in or near the promotion zone, it is obviously in your favour to get the real elephant into promotion, thus creating a Crown Prince.

I did use V and +V, S and +S and they pointed to the same pieces. I don't have many spaces in the string left but I will try another and see if I can find a separate promotion piece.
User avatar
hgm
Posts: 28513
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: SjaakII 1.0 RC6

Post by hgm »

Well, we will probably go through some reshuffling of the pieces beyond nr 22 to adapt XBoard for Dai / Nutty / Cashew / Makadamia Shogi in one Swoop.

It seems that adding dropless Wa to HaChu will not be entirely trivial: HaChu does not support a move yet that can both jump and step along the same ray, So it will involve more that just adding a table of piece descriptions, and a new variant name and startup FEN in the variants table, and printing some piece commands.

But I will have to add some new move types for these other variants as well, in particular area moves and hook moves. The hook moves are really a nightmare. I suppose non-capturing hook moves are mostly pointless, as the hook movers can go anywhere no matter where they are.
myfish
Posts: 131
Joined: Sat Feb 07, 2015 3:17 pm

Re: SjaakII 1.0 RC6

Post by myfish »

hgm wrote:Well, we will probably go through some reshuffling of the pieces beyond nr 22 to adapt XBoard for Dai / Nutty / Cashew / Makadamia Shogi in one Swoop.

It seems that adding dropless Wa to HaChu will not be entirely trivial: HaChu does not support a move yet that can both jump and step along the same ray, So it will involve more that just adding a table of piece descriptions, and a new variant name and startup FEN in the variants table, and printing some piece commands.

But I will have to add some new move types for these other variants as well, in particular area moves and hook moves. The hook moves are really a nightmare. I suppose non-capturing hook moves are mostly pointless, as the hook movers can go anywhere no matter where they are.
I have faith in your abilities. I have played with the remaining char's in the table. 'I' & '+I' have saved the day.

Now every piece has a relative promotional slot.

So that was A, V, S and J that do not.

'I' pointed to 'CrownedBishop', '+I' to 'Unicorn'.

As far as I can now see, washogi, under xboard/sjaakii should play. Just some cosmetic and values to adjust. Done... I think/hope. Paracetamol anyone ?
User avatar
hgm
Posts: 28513
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: SjaakII 1.0 RC6

Post by hgm »

myfish wrote:I did use V and +V, S and +S and they pointed to the same pieces. I don't have many spaces in the string left but I will try another and see if I can find a separate promotion piece.
Well, the +S suffers from the Elephant disease. I guess I should solve that anyway, and I probably will assign it an image with a different name, which for the default them will just be a mirrored image of the normal Elephant.

The V glyph is indeed equal to the +N. D will be equal to +G, U will be equal to +Q and G will be equal to +H. So the problem is that N/+N, G/+G and +Q are not used in Chu. So you should stay away from the N/+N and G/+G, and use Q only for a non-promotable piece, so that you also do not need +Q.

[Edit] OK, I see you already solved it.
Last edited by hgm on Thu Mar 12, 2015 6:42 pm, edited 1 time in total.
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: SjaakII 1.0 RC6

Post by gbtami »

hgm wrote:Is this the XBoard development version?
http://packages.ubuntu.com/vivid/xboard