A proposal for Jeiqi notation

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

A proposal for Jeiqi notation

Post by phhnguyen »

I’m interested in Jeiqi and started working with it. However I realised there there has not been any work yet on its standardisation. It should be done ASAP to avoid having too many standards later. Bellow is a basic proposal.


1. Short introduction

Jeiqi (in Chinese: 揭棋, in Vietnamese: Cờ Úp, probably other names in English: uncovering / dark / unveiling chess / xiangqi) is a Xiangqi (Chinese chess) variant rising star when the number of players grows rapidly, especially in China and Vietnam.

Basically the game plays with typical Xiangqi board and pieces. The main differences are:
  • At start point except the King, all 15 pieces of each side will be covered (usually by small plastic covers or simply put them face down to hide their symbols) and randomly put on original positions. Those covered pieces are called dark or covered or mystery ones
  • A dark piece should do the first move as the original piece in which it is located. After the first move it will be revealed / uncovered to show its real material. From now on that (unveiled) piece will move as its real chess type. The revealing is similar to chess promotion but in this case players cannot control which new types the pieces can become. We call it “revelation” to distinguish from promotion
  • Revealed Advisors and Elephants can move freely without any limited by area as they were in Xiangqi. It means they can appear out of palaces and can cross the river to attack opposite Kings
  • Kings are still limited in palaces, Pawns could be revealed anywhere but can go ahead only when they are still in their home land and could go sidedly after crossing the river
  • Captures: dark pieces could be captured as usual. However after being captured they may still remain in covered status. It means no one knows which real pieces are captured

Image

2. Names / terms
We should follow notation in Wiki / Chess programming wiki for names of pieces as well as some terms:

Typical names from Xiangqi:
King / k
Advisor / a
Elephant / e
Rook / r
Cannon / c
Horse / h
Pawn / p

White / w
Black / b

Additional names for Jeiqi
Dark / d (dark/unseen/covered piece)

2. FEN
Standard FEN has 6 fields as below, only field 3 should changed meaning:

1) Piece placement: similar to ches. Use d/D for dark pieces

2) Active color: similar to chess. w for white, b for black

3) Captured pieces (the original one is Castling availability): Both Xiangqi and Jeiqi don’t have castling moves. Instead we use this field for recording captures because it is very important to guess to which piece a dark piece could be revealed. We write down all revealed captured pieces and their numbers but ignore ones with no capture. We don’t need (not compulsory) to write down dark captures as well since we can calculate them from the board and revealed captures. That can make the FEN string a bit shorter, avoid redundancy and inconsistent data, avoid ugly using 2 digit numbers (dark pieces could be 15 - two digit number). However we may not be so strict in this issue (have or have not dark captures).

Example of a capturing record:
H2P3C1r1p3: white loses 2 horses, 3 Pawns 1 Cannon, black loses 1 Rook, 3 Pawns

4) En passant: ignore. Use ‘-’ instead.

5) Halfmove clock: similar to chess. This is the number of halfmoves since the last capture or pawn advance.

6) Fullmove number: similar to chess. The number of the full moves. It starts at 1, and is incremented after Black's move.



Examples:
Starting position:
ddddkdddd/9/1d5d1/d1d1d1d1d/9/9/D1D1D1D1D/1D5D1/9/DDDDKDDDD w - - 0 1
d1d1kdddd/4c4/1dp6/2d1d1d2/p7r/2R1P1R2/D7D/4H2D1/4C4/DDD1KDDH1 b D1e1 - 0 6

From above figure:
2e6/4k4/9/2Ha1P2p/2a2P3/9/3p5/4E4/e8/2D1K4 w R1C1P1D7r1h1p1d6 - 3 55


3. Move notations

a) Algebraic
Basically it is similar to chess/Xiangqi move notations. Columns are named from a to i, rows from 0 to 9. For a move of a dark piece we notate it as its original piece and use promotion notation for the revelation. Bellow is a revelation move when a dark piece in original Pawn position i3 pushed to i4 and revealed into an Horse, Rook on i5 moves to d5, dark Horse in b0 moves to c2 and revealed to a Pawn:

Example:
1 i3i4=h i5d5 2) b0c2=p
Or:
1) i4=h rc7 2) Hc2=p

b) Traditional
The traditional move notation uses column number by side as image. We can use them as Xiangqi with some notes:
  • revealing move uses promotional symbol: P1+1=h
  • Don’t count dark pieces with revealed pieces of same types for solving ambitious cases. The dark and revealed pieces can be easily distinguished by revealing symbol
    For example, in above board even there are two black Rooks in column 9, their moves can not be ambiguous since r9.1 is definitely by revealed Rook and r9.1=c is definitely by dark one.


4. Pgn
Use Jeiqi as the variant name:
[Variant “Jeiqi”]

5. UCI

From engine:
Inform the engine can play Jeiqi variant:

UCI_Variant var jeiqi

bestmove: as typical and it could not have revelational piece even the moving piece is a dark one. Reason: the engine cannot decides that piece:
bestmove a3a4

From GUI
GUI should adds revelational pieces to dark moves:

Example:
position startpos moves e3e4e b9c7c h2h7r i9h9p e4g2

/Nguyen Pham
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: A proposal for Jeiqi notation

Post by hgm »

For uniformity with FENs for other variants, I would prefer the captured pieces to be enclosed by [brackets], and appear immediately after the board (so before the side-to-move indicator). This is what WinBoard does in Crazyhouse or Shogi (where the captured pieces can be dropped), or in SuperChess, Grand Chess and Great Shatranj (where the captured pieces can serve as promotion choice). The field doesn't represent something that is anything like castling (unlike the 'virginity field' in Seirawan Chess), so there is no reason why it should appear in its place. Note that Crazyhouse has both castling and recycling of captured pieces, and would in any case need both fields.

A GUI implementation would likely show the captured pieces in JeiQi in the same way as it would show those in Grand Chess, or perhaps Crazyhouse: in 'holdings' beside the board. (Although flipping color does not seen useful here.) Using a uniform notation for such holdings in FEN makes sense and simplifies GUI design.

I would simply leave out the castling and e.p. field. Other variants that have no castling (Such as Shatranj, Courier Chess, Makruk) do this too. The number of fields in a FEN cannot be the same for all variants anyway, as some variants need extra game-state information. (E.g. in 3checks you have to record the number of checks that have already been given, for each side.)

I would prefer the use of X,x for unrevealed pieces, rather than D,d.
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: A proposal for Jeiqi notation

Post by phhnguyen »

Thanks Muller a lot for your feedbacks.
hgm wrote: Fri Dec 28, 2018 4:01 pm For uniformity with FENs for other variants, I would prefer the captured pieces to be enclosed by [brackets], and appear immediately after the board (so before the side-to-move indicator). This is what WinBoard does in Crazyhouse or Shogi (where the captured pieces can be dropped), or in SuperChess, Grand Chess and Great Shatranj (where the captured pieces can serve as promotion choice). The field doesn't represent something that is anything like castling (unlike the 'virginity field' in Seirawan Chess), so there is no reason why it should appear in its place. Note that Crazyhouse has both castling and recycling of captured pieces, and would in any case need both fields.
It looks fine for me. However it makes me confuse when looking into some FEN standards I see they don't use brackets but the 3rd (castling) field for captures. For example here is the link on Wiki about Shogi notation (they say "3. Pieces in hand" and explain "The third field contains all of the pieces in hand held by each player"):

https://en.wikipedia.org/wiki/Shogi_notation

Your thoughts?
hgm wrote:
A GUI implementation would likely show the captured pieces in JeiQi in the same way as it would show those in Grand Chess, or perhaps Crazyhouse: in 'holdings' beside the board. (Although flipping color does not seen useful here.) Using a uniform notation for such holdings in FEN makes sense and simplifies GUI design.
That is fine!

Just note that many Jeiqi websites use a total number next to a capture piece to reduce the list and delete the need to count them (unrevealed pieces may be 15 for each side).

Image
hgm wrote: I would prefer the use of X,x for unrevealed pieces, rather than D,d.
That is fine too. We will use X, x. Actually I don't like D, d either since it doesn't look "special".
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: A proposal for Jeiqi notation

Post by hgm »

Well, Shogi players seem obsessed with making things as incompatible with anything else in the world as possible. They use letters for ranks and numbers for files in SAN, they call the side that has the first move black, they made their own engine protocol by changing some keywords of UCI... So it should be no surprise there is a separate 'SFEN' standard that is incompatible with FEN. WinBoard does not use that even for Shogi.
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: A proposal for Jeiqi notation

Post by phhnguyen »

Do you (and WB) have any problem with the format of capture-number, say [e1a2R1X4]?

We prefer number to none since X (dark piece) can be as many as 15. The best is let users can use both (with or without number).
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager