Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid position for pseudo-royal extinction piece #764

Open
autocorr opened this issue Mar 16, 2024 · 1 comment
Open

Invalid position for pseudo-royal extinction piece #764

autocorr opened this issue Mar 16, 2024 · 1 comment

Comments

@autocorr
Copy link
Contributor

autocorr commented Mar 16, 2024

I would like to code a variant similar to Kinglet where if all instances of a piece are in their promoted form, it triggers a loss by the extinction rule. This appears to work with the extinction options, but has an issue when used with the extinctionPseudoRoyal = true option. When set to true, promotion of the extinction piece no longer triggers a loss and validates moves that would trigger a loss. Please find a minimal test case below:

maxRank = 8
maxFile = 8
king = -
commoner = k
knight = n
startFen = 3kk3/8/8/8/8/8/8/3KK3 w - - 0 1
promotionPieceTypes = -
promotedPieceType = k:n
promotionRegionWhite = *1 *2 *3 *4 *5 *6 *7 *8
promotionRegionBlack = *8 *7 *6 *5 *4 *3 *2 *1
mandatoryPiecePromotion = true
pieceDemotion = true
extinctionPieceTypes = k
extinctionPseudoRoyal = true
extinctionValue = loss

The expected behavior is that after moving one royal piece, the second should not be able to move, and if it does then a loss results (the later occurs without the extinctionPseudoRoyal option set). See diagrams below:

Starting position:
two_kings_start

After moving the two extinction pieces, triggering promotion:
two_kings_promoted

Note that Kinglet does not use pseudoroyal, so one can lose by moving to promote one's last pawn. I understand this is somewhat of an edge-case to the extinction rules so may not be a high priority, but it's a neat feature I'm exploring so I would appreciate a change if there's ever time available. :)

@ianfab
Copy link
Member

ianfab commented Mar 23, 2024

I think this currently would be considered expected behavior, since pseudo-royalty was designed as a workaround for multiple royal pieces that can not be supported, and capturing/removal of royal pieces is not considered game ending, since only checkmating them ends the game. This might be a bit surprising given the terminology, but that is how it currently is handled. The only exception are atomic variants, since there capturing a (pseudo-)royal piece without checking it first actually is possible.

It would probably make sense to in the future expose less of that workaround to the user and handle it more internally and treating it as royal to the outside, although that isn't trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants