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 »

myfish wrote:
Evert wrote:
myfish wrote:
Evert wrote:For pieces that demote on capture (in Shogi/Bughouse) a further correction is applied. If the piece has the same move as an unpromoted piece (think Tokin versus Gold), then it gets a bonus to its piece value that is larger if the piece it demotes to is less valuable. This makes a Tokin worth more than a Gold. I'm not entirely happy with how this term comes out, quantitatively.
Would you know by how much ?
If we take lance, knight and silver too, they should be worth proportionally 'more' than 'gold'.
SjaakII's heuristic gives the following piece values for Shogi:

Code: Select all

P:   16
G:  111
+P: 138
+L: 131
+N: 128
+S: 113
Take with a healthy helping of salt though! It gets the ordering right, but it was designed to do so. Note too that these are not the values that Sjaak uses when it actually plays Shogi (because the piece values are given as input).
Yes it does indeed order them correctly.
It does, but again, this is by design: it was made to get the unpromoted order correct, and then the promoted pieces get (value of gold) + (bonus that increases with decreasing value of unpromoted piece). Sjaak's standard piece values have (+P - G)=24 and I tweaked this to give something similar. It has (+S - G)=12 though.
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 »

True, without decisive promotions it becomes a completely different game, as the pieces have to perform the mate all by themselves. That reminds me that in Shatranj even 4 like-colored Ferzes seem to be able to beat a Knight, while I read that 6 of those could beat a Rook. This because of the baring rule.
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:
Evert wrote:Expect XBoard to complain too if you try to drop G while all you had in hand was N: it doesn't know where the G came from, and it doesn't know to remove the N from holdings.
Hmm, yes. But I guess it is like you say: this is just a drop move that promotes. So it would make sense to also write it as such, e.g. P@c3=G, (P@c3g in LAN), telling XBoard that a Pawn was dropped from the holdings, but appeared on the board as Gold.

Demotion on capture would be a problem, though. Currently XBoard would only properly demote pieces that are defined as + in the pieceToCharTable, and would demote to Pawn what does not fit after that. Crazyhouse depends on the latter behavior. But of course in Crazyhouse the promoted types are configured as ~, so I could make the behavior dependent on that, rather than default. Then the default behavior for non-fitting pieces could be to shogi-demote, even if there was no + for the promoted piece.

There still is the problem that the usual X/+X pairing does not work in Kyoto; P does not promote to +P, there, but to Rook, while Lance promotes to +P there rather than +L, and +P promotes to Lance... That means you will have to assign different XBoard internal piece types to the various pieces, and would need to use external piece images, as the default theme now would look completely non-sensical (e.g. using crossed swords for Pawn, and a the turban for Rook). But they could just be a set of renamed images from other themes.
I currently have Kyoto Shogi working in SjaakII with the following definition (this takes one new rule: "promote drop")

Code: Select all

Variant: Kyoto Shogi
Board: 5x5
XBoard parent: fairy
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

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

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

# Define the pieces
Piece: Knight
Symbol: "N", "N,n"
Move: aleap (1,2)|(-1,2)
Promotion: all, all, "G"
Optional promotion: empty, empty

Rule: keep capture, allow drops, promote drop
Rule: repeat4 = draw 
Rule: perpetual = loss 
It outputs "drop" promotions and it nicely alternates piece types between drop promotions (and it promotes Pawn P to Rook R rather than +P). It does not use Shogi-style promotions ("+") though, and it does not "demote" pieces when they are captured (it doesn't know what to demote them to). This probably means that it cannot work as-is in XBoard (since the required holding size is larger than the number of ranks on the board)...
myfish
Posts: 131
Joined: Sat Feb 07, 2015 3:17 pm

Re: SjaakII 1.0 RC6

Post by myfish »

OK, seem to have kyoto game in sjaakii console. Haven't tested it really.

In xboard, I get this.

Image

I will try to re-assign some piece names etc. Odd though that only a few pieces are being sent to xboard. The position, saved from that image in xboard shows this ...

pgks1/5/5/5/5[-] w KQkq - 0 1
myfish
Posts: 131
Joined: Sat Feb 07, 2015 3:17 pm

Re: SjaakII 1.0 RC6

Post by myfish »

Making a few mods...

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

Re: SjaakII 1.0 RC6

Post by Evert »

myfish wrote:OK, seem to have kyoto game in sjaakii console. Haven't tested it really.
It needs one or two fixes that aren't in 1.0 RC7.
In xboard, I get this.

Image
It doesn't set pieceToChar, so this is not so surprising.
myfish
Posts: 131
Joined: Sat Feb 07, 2015 3:17 pm

Re: SjaakII 1.0 RC6

Post by myfish »

In xboard...

ALL moves rejected by first engine.

Expected but at least we've left the starting grid.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: SjaakII 1.0 RC6

Post by Evert »

This pieceToChar does ok:
XBoard pieces: "PNBR.....GS.......L...TKpnbr.....gs.......l...tk"

However, you still run into issues with the holdings in XBoard (and you need the current development version of Sjaak to make it work properly in the terminal).

I can add an override for Sjaak's default promotion/demotion scheme so you can actually specify by-hand what a piece should demote into when captured. The only real point of that would be to allow everything to demote to a piece type that fits in XBoard's holdings - which is pointless if XBoard itself doesn't understand how to demote stuff.

So the question is really, is there a way to make XBoard understand what's happening in this game?
myfish
Posts: 131
Joined: Sat Feb 07, 2015 3:17 pm

Re: SjaakII 1.0 RC6

Post by myfish »

Evert wrote:
myfish wrote:OK, seem to have kyoto game in sjaakii console. Haven't tested it really.
It needs one or two fixes that aren't in 1.0 RC7.
In xboard, I get this.

Image
It doesn't set pieceToChar, so this is not so surprising.
LOL, could I please get a look at the patches or fixes ?
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: SjaakII 1.0 RC6

Post by Evert »

myfish wrote: LOL, could I please get a look at the patches or fixes ?
Hmm... you know, I really should tell you to wait for the release announcement. I really should.

Then again, I can't really stop you from clicking a link, can I?