I'm getting several serious errors, how can I fix them?

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

I'm getting several serious errors, how can I fix them?

Postby Snowmoondaphne » 20 Aug 2021, 01:14

[pandemonium]
variantTemplate = shogi
pieceToCharTable = PNBRQFACMWG.SHD......Kpnbrqfacmwg.shd......k
maxFile = 9
maxRank = 9
pocketSize = 7
startFen = rnbckqbnr/2g1m1g2/ppppppppp/9/9/9/PPPPPPPPP/2G1M1G2/RNBQKCBNR[] w - - 0 1
customPiece1 = s:NA
castling = false
pieceDrops = true
capturesToHand = true
immobilityIllegal = true
mandatoryPawnPromotion = false
promotionZonePawnDrops = true
shogiPawn = p
knight = n
bishop = b
rook = r
king = k
queen = q
commoner = g
dragonHorse = h
bers = d
alfil = a
archbishop = c
wazir = w
chancellor = m
fers = f
promotionRank = 7
promotionPieceTypes = -
promotedPieceType = p:g n:s b:h r:d a:c w:m f:q
shogiPawnDropMateIllegal = true
dropNoDoubled = p
doubleStep = false
firstRankPawnDrops = true
perpetualCheckIllegal = true

I set the variant like this, but it causes several problems.

1. Queen's icon is Lance.

2. If C(Cardinal), M(Marshal), S(Scepter. Promoted Knight) are captured, it becomes a Pawn.

3. F(Ferz), W(Wazir), and A(Alfil) are promoted to Queen, Marshal and Cardinal respectively. However, they has a completely different icon from the existing icon.

4. Pawns are promoted to G (Guard). However, it has a different icon than the existing Guard.


So I re-adjusted it like below.

[pandemonium]
variantTemplate = shogi
pieceToCharTable = PNBR.FAW++++.+++.Kpnbr.faw++++.+++.k
maxFile = 9
maxRank = 9
pocketSize = 7
startFen = rnb+ak+fbnr/2+p1+w1+p2/ppppppppp/9/9/9/PPPPPPPPP/2+P1+W1+P2/RNB+FK+ABNR[] w - - 0 1
customPiece1 = s:NA
castling = false
pieceDrops = true
capturesToHand = true
immobilityIllegal = true
mandatoryPawnPromotion = false
promotionZonePawnDrops = true
shogiPawn = p
knight = n
bishop = b
rook = r
king = k
queen = q
commoner = g
dragonHorse = h
bers = d
alfil = a
archbishop = c
wazir = w
chancellor = m
fers = f
promotionRank = 7
promotionPieceTypes = -
promotedPieceType = p:g n:s b:h r:d a:c w:m f:q
shogiPawnDropMateIllegal = true
dropNoDoubled = p
doubleStep = false
firstRankPawnDrops = true
perpetualCheckIllegal = true

But when I tried this, this time the piece placement and the piece icon came out the same shape as the Shogi. In other words, it is impossible to proceed normally.

How do I fix it?

I didn't know how to post the picture, so I posted a link to download the file myself.

( https://www.mediafire.com/file/x0rtv7h9 ... d.zip/file )

If we could chat on a place like Discord, I would have posted the picture neatly, sorry.
Last edited by Snowmoondaphne on 25 Aug 2021, 11:08, edited 1 time in total.
Snowmoondaphne
 
Posts: 4
Joined: 19 Aug 2021, 18:07

Re: I'm getting several serious errors, how can I fix them?

Postby H.G.Muller » 21 Aug 2021, 16:00

What is this? Are you trying to configure some engine for a custom variant? Which engine? I am not familiar with this format.

For historic reasons XBoard depicts the Queen as a Lance in Shogi. It might be better to use Chu Shogi as template ('chu'); there this problem doesn't exist. In Shogi a Gold from promotion (e.g. a promoted Pawn) has a different image than the Gold you start with, because on capture it reverts to a Pawn, and the other not. In games without drops this doesn't matter.

The key to making XBoard use the right representation for the pieces is the pieceToCharTable. Note that the latest XBoard can handle 66 different piece types, so that the pieceToCharTable can contain up to 2x66 piece IDs. This can also be used to assign promotions: if instead of a piece ID (say L) you write ^L in the table, the image corresponding to the location you write that will be used for a promoted L, and in move notation the ID +L will be used for that piece.
User avatar
H.G.Muller
 
Posts: 3376
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: I'm getting several serious errors, how can I fix them?

Postby Snowmoondaphne » 22 Aug 2021, 00:12

H.G.Muller wrote:What is this? Are you trying to configure some engine for a custom variant? Which engine? I am not familiar with this format.

For historic reasons XBoard depicts the Queen as a Lance in Shogi. It might be better to use Chu Shogi as template ('chu'); there this problem doesn't exist. In Shogi a Gold from promotion (e.g. a promoted Pawn) has a different image than the Gold you start with, because on capture it reverts to a Pawn, and the other not. In games without drops this doesn't matter.

The key to making XBoard use the right representation for the pieces is the pieceToCharTable. Note that the latest XBoard can handle 66 different piece types, so that the pieceToCharTable can contain up to 2x66 piece IDs. This can also be used to assign promotions: if instead of a piece ID (say L) you write ^L in the table, the image corresponding to the location you write that will be used for a promoted L, and in move notation the ID +L will be used for that piece.


I tried to design a Variant using the variants.ini file.

Thank you for answer. But some parts I still don't understand. It doesn't really matter that Queen's icon turns into Lance. Because it doesn't affect the game much. The rest of the problem is much more serious than that. How to solve these problems?
Snowmoondaphne
 
Posts: 4
Joined: 19 Aug 2021, 18:07

Re: I'm getting several serious errors, how can I fix them?

Postby H.G.Muller » 22 Aug 2021, 11:29

I don't see any other problems than the pieceToCharTable. The latter controls what promotes to what, and which pieces will fit into the holdings. (The first N unpromoted ones. Those that do not fit would demote to Pawn on capture.)
User avatar
H.G.Muller
 
Posts: 3376
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: I'm getting several serious errors, how can I fix them?

Postby Snowmoondaphne » 25 Aug 2021, 14:35

H.G.Muller wrote:I don't see any other problems than the pieceToCharTable. The latter controls what promotes to what, and which pieces will fit into the holdings. (The first N unpromoted ones. Those that do not fit would demote to Pawn on capture.)


Ah I fixed it ! (*´ ˘ `*)
Snowmoondaphne
 
Posts: 4
Joined: 19 Aug 2021, 18:07


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 4 guests

cron