'Pieces' PGN Tag?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

'Pieces' PGN Tag?

Post by hgm »

I need to introduce a new PGN tag, and I wondered if tag name 'Pieces' has already been used for some purpose. I vaguely recall that there was a tag to redefine the names of the pieces used in SAN, to allow locale-dependent notation. But I forgt how it was called, and I cannot find it in the standard, so it was probably not official.

What I need is similar but more general: I need a tag to describe the moves of all pieces used in the notation (in so far these are non-standard). So it is not enough to just define a mapping of characters on orthodox Chess pieces (which could be done by a 6-character long string), but it really needs to convey explicitly written info on each piece ID that occurs in the notation.

I was thinking of a semi-colon-separated list of ID:MOVEDESCRIPTOR pairs. E.g. for Capablanca Chess it could look like

[Pieces "A:BN;C:RN"]

to specify that the Bishop-Knight compound is indicated by A, and the Rook-Knight compound by C. When the orthodox pieces appear under their standard abbreviations, the are left out. In asymmetric variants the usual upper-case/lower-case convention could be use to distinguish black and white pieces. E.g. for Spartan Chess we could have

[Pieces "h:fmFfcWifmA;l:FAsmW;c:WD;g:RF;w:BN"]

I just want to know if 'Pieces' is an acceptable name for this, or that I'd better look for something else.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: 'Pieces' PGN Tag?

Post by sje »

I'd suggest using the identifier Chessmen vs Pieces. I avoid the term piece because sometimes it includes pawns and kings; sometimes it doesn't.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: 'Pieces' PGN Tag?

Post by JoshPettus »

Well sometimes it's not always chess. ;)
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: 'Pieces' PGN Tag?

Post by hgm »

Could also call them 'Fairies', as it is mainly intended for non-standard pieces (which I guess means it would not be used for Pawns and Kings anyway). :lol:
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: 'Pieces' PGN Tag?

Post by sje »

It might be a good idea to have a Variant tag which gave the name of the heterodox variant and would also be a signal to PGN readers that something unusual is recorded.

Likewise, tags used to describe variant specific information should have Variant as a prefix for the tag name. Examples: VariantFEN, VariantMen, and VariantResult.

--------

Someday I might publish the rules for my time travel chess variant. It uses two player simultaneous movement, unlimited bifurcations, and the goal of driving the probability of the opponent's Reality to zero.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: 'Pieces' PGN Tag?

Post by hgm »

WinBoard already uses a 'Variant' tag for a long time.

I like 'VariantMen', I will use that instead of 'Pieces'. I don't really see the need for separate 'FEN' and 'VariantFEN' tags, however. Currently XBoard simply uses the 'FEN' tag to write FENs for variants, and it never causes any trouble. It would never make sense to include a FEN that would not belong to the current variant. If there were other formats (I remember we once discussed how to best represent board positions of multi-player games, or games with more than 26 piece types, and came up with a DEMN format...) that would of course deserve a separate tag, but then I would just give it the name of that other format.

Perhaps you have an opinion on this, though: Apart from a list of standard variants, (e.g. xiangqi, shogi), XBoard also supports 'derivative variants', where the user has been tinkering with the board size, or introduced an extra unorthodox piece. E.g. Big Chess is Chess on a 16x16 board, and mini-Shogi is Shogi on a 5x5 board. Neither is a standard variant, but in the XB protocol 'variant' command XBoard indicates them as '16x16+0_normal' and '5x5+5_shogi'.

What would fit best in the spirit of PGN? Also use these names with prefixed 'board-size overrules' in the 'Variant' tag, or only mention the name of the parent variant there, and specify possibly deviating board parameters in separate tags (e.g. [Board "7x7"] and [HoldingsSize "6"])?
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: 'Pieces' PGN Tag?

Post by sje »

I'd rather not see an explosion of PGN tag names, as this will only makes things more difficult and more confusing for those writing PGN scanners.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: 'Pieces' PGN Tag?

Post by stegemma »

hgm wrote:I need to introduce a new PGN tag, and I wondered if tag name 'Pieces' has already been used for some purpose. I vaguely recall that there was a tag to redefine the names of the pieces used in SAN, to allow locale-dependent notation. But I forgt how it was called, and I cannot find it in the standard, so it was probably not official.

What I need is similar but more general: I need a tag to describe the moves of all pieces used in the notation (in so far these are non-standard). So it is not enough to just define a mapping of characters on orthodox Chess pieces (which could be done by a 6-character long string), but it really needs to convey explicitly written info on each piece ID that occurs in the notation.

I was thinking of a semi-colon-separated list of ID:MOVEDESCRIPTOR pairs. E.g. for Capablanca Chess it could look like

[Pieces "A:BN;C:RN"]

to specify that the Bishop-Knight compound is indicated by A, and the Rook-Knight compound by C. When the orthodox pieces appear under their standard abbreviations, the are left out. In asymmetric variants the usual upper-case/lower-case convention could be use to distinguish black and white pieces. E.g. for Spartan Chess we could have

[Pieces "h:fmFfcWifmA;l:FAsmW;c:WD;g:RF;w:BN"]

I just want to know if 'Pieces' is an acceptable name for this, or that I'd better look for something else.
I think that PGN should be kept human readable. A string in the form of:

Code: Select all

[Pieces "h:fmFfcWifmA;l:FAsmW;c:WD;g:RF;w:BN"]
it's all but readable ;)

IMHO is better to use a Variant name only and maybe some parameter or sub-variant tag.

For the pieces characters, in Italy we use TCADRP instead of RNBQKP but who read the PGN file knows that rule and is not a needing, to have the italian version. A chess player maybe read the file through an interface and is an interface problem to translate the standard format.

For piece movement, you will always find in the future some new piece that you can't describe basing only on actual piece movement. The only way to do it would be to define a full scripting system to define the moving rules... but this is outside the scope of a PGN file. This is why i think that only Varinat name should be kept in the standard PGN.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: 'Pieces' PGN Tag?

Post by hgm »

stegemma wrote:I think that PGN should be kept human readable. A string in the form of:

Code: Select all

[Pieces "h:fmFfcWifmA;l:FAsmW;c:WD;g:RF;w:BN"]
it's all but readable ;)
It would reat as poetry to a chess variantis; this is really standard notation designed for human consumption. Such people would understand immediately that FAsmW means "moves as Ferz or Alfil, and has an additional sideway non-capture." I admit that the description of the Hoplit 'h' is a bit cumbersome, but the Hoplit is what this variant happens to use for Pawn. Pawns are by far the most complex pieces in Chess, due to their moves being divergent as well as asymmetric, and the iniatal double-push. So fmFfcWifmA means "moves without capturing forward as Ferz, captures forward as Wazir, and can in its initial position also jump forward as Alfil (without capturing)". It really wouldn't be easy to make it any simpler than that. When the piece is simple, the notation also gets simple. w:BN makes it pretty obvious that the black W piece moves as Bishop or Knight. I really don't think this is anymore difficult to read than a FEN, which is also in a PGN tag.
IMHO is better to use a Variant name only and maybe some parameter or sub-variant tag.
Well, this is what XBoard did. But the problem this poses is what it should do if it does not know the variant, and sees a name in the Variant tag it has never heard of. Currently it must rely entirely on the engine in that case. But that would mean you could no longer use XBoard in game-viewer mode for such games. The VariantMen tag could cure that.
For piece movement, you will always find in the future some new piece that you can't describe basing only on actual piece movement. The only way to do it would be to define a full scripting system to define the moving rules... but this is outside the scope of a PGN file. This is why i think that only Varinat name should be kept in the standard PGN.
Well, Betza 2.0 notation already goes a long way in the direction of such a full scripting language. (The examples shown were all in simple Betza notation, though, which is less powerful.) Even the description of most Ultima pieces would not be a problem there. Only the Coordinator was giving me trouble. But I think that should not deter us. There will always be limitations. E.g. FEN obviously does not work in a game with more than 26 piece types. That should not be a reason to abandon the FEN tag, and replace it by a 'StartPosition' tag where you would have to describe the start position by a standard name, like 'KiwiPete' or 'Saavedra', and leave all people that played games starting from a position not in the list in the cold. And what holds for positions, holds just as much for variants. The inherent problem with standard names is that they would have to be listed somewhere what they mean, that it would be almost impossible to make (and keep) the list complete, and that you are completely dead when your case is not in the list.

So I think it is good to have a powerful general mechanism, which necessary will have to be be complex to reach the required generality, as a backup for a simple method that works for the common cases. Obviously when the variant is chess, xiangqi or shogi, there is no need to put in a FEN of the start position or a piece description. But when you are playing "Chess with Different Armies, Nutty Knights vs Colorbound Clobberers", this is not so clear.
mvk
Posts: 589
Joined: Tue Jun 04, 2013 10:15 pm

Re: 'Pieces' PGN Tag?

Post by mvk »

stegemma wrote:

Code: Select all

[Pieces "h:fmFfcWifmA;l:FAsmW;c:WD;g:RF;w:BN"]
it's all but readable ;)
It is not readable. But when you base64-decode it you get a zip file with a suitable version of xboard in it, which you can then compile and run and feed the movetext. Very powerful.
[Account deleted]