Kyoto Shogi (Sjaak?)

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Re: Kyoto Shogi (Sjaak?)

Post by Evert »

hgm wrote: Of course we could introduce a different syntax to write this kind of divergence in the piece commands:

piece <ID> <NONPROMOTINGMOVE> + <PROMOTINGMOVE>

where absence of the + implies that the moves are the same. Then the Sittuyin Pawn could be

piece P& fmWfcF + OF
I like that.

I suppose I don't consider "promotion" a way of movement in the same way as "captures" and "non-captures" are, but a modifier: a move can be a capture or a non-capture, and in addition a piece may/must promote as a result of the move. This idea captures that nicely. Whether it's the best way for all variants is a different matter (probably not, but you wan something that is general but simple for the common case).
GregNeto
Posts: 35
Joined: Thu Sep 08, 2016 8:07 am

Re: Kyoto Shogi (Sjaak?)

Post by GregNeto »

Kyoto Shogi engines under winboard would be very appreciated! I "discovered" this variant a couple of weeks ago and we have been hooked ever since. The only program I have found is an app which is very strong when thinking a couple of seconds but the app is like a blackbox information wise ...
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Kyoto Shogi (Sjaak?)

Post by hgm »

Well, it seems Sjaak can already play it as a stand-alone engine, using its own (text-based) interface. WinBoard will need some work to make it support Kyoto Shogi in a convenient way.
GregNeto
Posts: 35
Joined: Thu Sep 08, 2016 8:07 am

Re: Kyoto Shogi (Sjaak?)

Post by GregNeto »

Thanks, as a spoiled enduser I will wait for the next official version of sjaak (but of course i will test any pre-version in command line mode if wanted). By the way, the rules say nothing about repeating positions. I guess the normal 4-fold repetition rules are the way to go.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Kyoto Shogi (Sjaak?)

Post by Evert »

GregNeto wrote:Thanks, as a spoiled enduser I will wait for the next official version of sjaak (but of course i will test any pre-version in command line mode if wanted). By the way, the rules say nothing about repeating positions. I guess the normal 4-fold repetition rules are the way to go.
You can take the definition from this post, put it in a file (say, kyoto.txt) and have Sjaak play it. You can either load the file directly by specifying it on the command line (sjaakii kyoto.txt) or type "load kyoto.txt" on Sjaak's command prompt. The following commands should set it up correctly:

Code: Select all

load kyoto.txt
variant kyoto_shogi
level 40 min&#58;sec 0
The "level" command sets the time control to "min:sec" (pick numbers for these) in 40 moves; you can now play as White. Type "go" to play as Black.
If you need to see the move format expected by SjaakII, you can type "longmoves" which will list all available moves in the 4 different notations it understands as input.

For use in the terminal, the main difference with the next release will be that it has the definition for Kyoto Shogi pre-defined. There are other differences to make it work better with XBoard, but those are largely irrelevant until you can actually play Kyoto Shogi under XBoard.
GregNeto
Posts: 35
Joined: Thu Sep 08, 2016 8:07 am

Re: Kyoto Shogi (Sjaak?)

Post by GregNeto »

Wonderful, I got it to work. I used your westerised promotion version, removed the demotion parts and added "Drop zone: all, all" to all pieces except the king and "Flags: drop_dead" to the lance, pawn and Knight. Sjaak plays a decent game, even without any piece values added, because the kyoto piece-combos are not much different in combined strenght (the silver/bishop combo seems to be the most valuable piece).

Is there a command to make sjaak play against itself? Thanks!
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Kyoto Shogi (Sjaak?)

Post by Evert »

GregNeto wrote:Wonderful, I got it to work. I used your westerised promotion version, removed the demotion parts and added "Drop zone: all, all" to all pieces except the king and "Flags: drop_dead" to the lance, pawn and Knight.
Is that correct for this variant? Or do you need it to be able to drop these pieces with promotion?
Sjaak plays a decent game, even without any piece values added, because the kyoto piece-combos are not much different in combined strenght (the silver/bishop combo seems to be the most valuable piece).
Thanks!
Is there a command to make sjaak play against itself? Thanks!
Not as such, no. You can of course type "go" after every move, but that becomes cumbersome. I suppose I could add a "playboth" command that does an auto-play match... I'm not sure how generally useful that is though.
If you're on Linux, you can use the "Sjef" utility that comes with the source build to run matches between two instances of Sjaak. This is match-playing program in the spirit of cutechess-cli, but for variants.
GregNeto
Posts: 35
Joined: Thu Sep 08, 2016 8:07 am

Re: Kyoto Shogi (Sjaak?)

Post by GregNeto »

Rules are like in micro-shogi. To quote Wiki: "A piece is allowed to move, capture or be dropped in a manner that will prevent it from moving on a subsequent turn, which is illegal in standard shogi. For example, a rook can move onto the farthest rank, becoming a pawn and unable to move further. Such pieces may be captured as any other." "There are no restrictions when dropping pawns. That is, a player may have two unpromoted pawns on the same file, a piece can be dropped with no legal moves later, and a pawn can be dropped to give immediate checkmate."

I needed the "Flags:drop_dead", otherwise no moves for the T/L, G/N and R/P Combos would be generated.

I will try Sjef![/quote]
GregNeto
Posts: 35
Joined: Thu Sep 08, 2016 8:07 am

Re: Kyoto Shogi (Sjaak?)

Post by GregNeto »

I had to remove the "Drop: all, all" because then strange king drops happened ....

this seems to work:

Variant: kyoto
Board: 5x5
FEN: "pgkst/5/5/5/TSKGP w 0 1"

Piece: King
Move: leap (0,1)|(1,1)
Symbol: "K", "K,k"
Flags: royal

Piece: Pawn
Symbol: "P", "P,p"
Move: step N
Promotion: all, all, "R"
Optional promotion: empty, empty
Flags: drop_dead

Piece: Rook
Symbol: "R", "R,r"
Move: slide (H,V)
Promotion: all, all, "P"
Optional promotion: empty, empty

Piece: Tokin
Symbol: "T", "T,t"
Move: aleap (1,0)|(-1,0)|(0,1)|(0,-1)|(1,1)|(-1,1)
Promotion: all, all, "L"
Optional promotion: empty, empty

Piece: Lance
Symbol: "L", "L,l"
Move: step 5N
Promotion: all, all, "T"
Optional promotion: empty, empty
Flags: drop_dead

Piece: Silver general
Symbol: "S", "S,s"
Move: aleap (0,1)|(1,1)|(1,-1)|(-1,-1)|(-1,1)
Promotion: all, all, "B"
Optional promotion: empty, empty

Piece: Bishop
Symbol: "B", "B,b"
Move: slide (D,A)
Promotion: all, all, "S"
Optional promotion: empty, empty

Piece: Gold general
Symbol: "G", "G,g"
Move: aleap (1,0)|(-1,0)|(0,1)|(0,-1)|(1,1)|(-1,1)
Promotion: all, all, "N"
Optional promotion: empty, empty

Piece: Knight
Symbol: "N", "N,n"
Move: aleap (1,2)|(-1,2)
Promotion: all, all, "G"
Optional promotion: empty, empty
Flags: drop_dead

Rule: keep capture, allow drops, promote drop
Rule: checkmate = win
Rule: stalemate = win
Rule: repeat1 = loss
Rule: perpetual = loss
GregNeto
Posts: 35
Joined: Thu Sep 08, 2016 8:07 am

Re: Kyoto Shogi (Sjaak?)

Post by GregNeto »

Still fascinated by this variant! One observation: sometimes it seems that sjaaks has crashed, but typing "go" reveals that is still searching at a low depht. This is happening when there are pieces in hand. It seems that it is lost in quiescence search. In kyoto every move is a promotion, even drops ....[/img]