Question about Shredder FEN and X-FEN

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Question about Shredder FEN and X-FEN

Post by hgm »

Shredder FEN uses the file ID of the Rook to indicate it can castle, in the castling field. Is there any rule to make a FEN for a given position unique w.r.t. the ordering of the letters in the castling field? I know that for normal Chess and in X-FEN we usually write KQkq, and not (for instance) KqQk or QKqk.

Would one write HAha (i.e. King-side first) or AHah (alphabetical) in Shredder FEN?

In a Chess960 game that started with Rooks on the b- and g-file... When a third Rook, obtained by promotion, would move to h1 while both castling rights still exist, would one write GQ or QG? And when the extra Rook would move to a1, would it be KB or BK?

I need to generalize the castling field for S-Chess FENs to indicate virginity not only of K and R, but of all back-rank pieces. (Because virginity gives the piece 'gating rights', i.e. a piece still in hand can be placed on the from-square when it moves.) The best way seems to mention all files where the back-rank piece is still virgin ('Shredder SFEN'). One could prescribe virginity of the King and outermost Rook on the king side should be contracted to K, and King plus outermost Rook on queen side should be contracted to Q ('X-SFEN'), for complete compatibility with normal FEN (which seems desirable, as the game tree of normal Chess is included in the game tree of S-Chess). In that case, should the generalized rights field of the opening position be

KBCDFGQkbcdfgq

or

KGFDCBQkgfdcbq

?

When a shuffle variant of S-Chess would be developed, using Fischer castling... With Rooks on b- and g-file, and King on d, would it it be better to write

KHFECAQkhfecaq

or

HKFECQAhkfecqa

?
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Question about Shredder FEN and X-FEN

Post by Sven »

hgm wrote:Shredder FEN uses the file ID of the Rook to indicate it can castle, in the castling field. Is there any rule to make a FEN for a given position unique w.r.t. the ordering of the letters in the castling field? I know that for normal Chess and in X-FEN we usually write KQkq, and not (for instance) KqQk or QKqk.

Would one write HAha (i.e. King-side first) or AHah (alphabetical) in Shredder FEN?

In a Chess960 game that started with Rooks on the b- and g-file... When a third Rook, obtained by promotion, would move to h1 while both castling rights still exist, would one write GQ or QG? And when the extra Rook would move to a1, would it be KB or BK?

I need to generalize the castling field for S-Chess FENs to indicate virginity not only of K and R, but of all back-rank pieces. (Because virginity gives the piece 'gating rights', i.e. a piece still in hand can be placed on the from-square when it moves.) The best way seems to mention all files where the back-rank piece is still virgin ('Shredder SFEN'). One could prescribe virginity of the King and outermost Rook on the king side should be contracted to K, and King plus outermost Rook on queen side should be contracted to Q ('X-SFEN'), for complete compatibility with normal FEN (which seems desirable, as the game tree of normal Chess is included in the game tree of S-Chess). In that case, should the generalized rights field of the opening position be

KBCDFGQkbcdfgq

or

KGFDCBQkgfdcbq

?

When a shuffle variant of S-Chess would be developed, using Fischer castling... With Rooks on b- and g-file, and King on d, would it it be better to write

KHFECAQkhfecaq

or

HKFECQAhkfecqa

?
FEN standard requires to put kingside castling first, then queenside castling:
FEN standard wrote:Those letters which appear will be ordered first uppercase before lowercase and second kingside before queenside.
In X-FEN the same rule is valid, even if the exceptional case of an "inner rook" owning a castling right occurs where you simply replace the "K" or "Q" (for white) by the appropriate rook file letter without changing the order within the castling rights substring. Shredder FEN always contains those rook file letters, regardless whether the rook is an "inner rook" or not, but does not change the order of the letters as well.

So my answer would be: "HAha" is the correct order in Shredder FEN. Using the alphabetical order instead looks illegal to me since the A-rooks would get the kingside castling rights assigned at the same time where the H-rooks get queenside castling rights.

I can't help you for S-Chess FENs, though.

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

Re: Question about Shredder FEN and X-FEN

Post by hgm »

Well, thanks for pointing out this rule. It seems that this would generalize to working from h-file towards a-file.

I would be inclined to generalize the rule for the (so far hypothetical) S-Chess960 X-FENs to that K goes before any other, Q after any other. I think this would imply the existing rules for Chess960 X-FEN (which again implies the rules for normal FEN). In standard S-Chess K would go first naturally, because it is associated with the h-file.
diep
Posts: 1822
Joined: Thu Mar 09, 2006 11:54 pm
Location: The Netherlands

X-MEN standard

Post by diep »

hey Harm Geert - can't you extend the X-FEN standard a tad. I also want to get the game moves made from GUI for diep in UCI when the opponent is thinking about its first moves. most UCI gui's don't give this. you only get the moves after Gui is out of book for your engine - waste of time...

I propose the new standard name to be called the X-MEN standard