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
Support two kings variant (wild9) #431
Conversation
Implements the rules of wild9 from ICC: https://www.chessclub.com/user/help/wild9
|
Wild9 as known from ICC has one serious flaw: it's asymmetrical. White has an comfortable edge in addition to move first. Chessvariant mention this here: |
|
@Nordlandia I left a comment in the code on how to implement the symmetrical variant: As soon as the implementation of the asymmetrical version has proved to work well, I think I will add the symmetrical one as a subvariant. As far as I know only cutechess supports it so far, so we should perhaps use the same name in Stockfish. |
|
in my opinion "sortland9" isn't a particularly good name for a sub-variant. Perhaps something more chess-related. Anyway now that TwoKings is being implemented, i want to donate my 8-Core i7-5960X to help out testing. |
|
I've merged this as I do want multi-variant Stockfish to support TwoKings, which differs from chess in a couple important respects:
and once non-royal kings are captured, TwoKings reduces to standard chess. I guess that when upstream tweaks parameters, we can also re-tune/tweak TwoKings parameters (as we do for other variants, but I think for this variant there will be a strong correlation between upstream Elo gain/loss and TwoKings Elo gain/loss). |
|
What I forgot to mention is that this implementation in principle is nKings, since I have not made any explicit assumptions about the number of kings (apart from that it should not exceed the array size, but I guess people will not suddenly start to play SixteenKings). I have not tried to use more than two kings in testing though, and I also do not know whether any GUI supports that. |
|
The symmetrical variant uses |
|
@alwey Thanks for the info. We could name the ICC variant wild9 and call the symmetrical variant twokings, but that might also cause confusion. I currently do not have a good idea since twokingssymmetrical or the like would be bit a long, but maybe it would be the most clear. |
This is exactly what I had in mind when I implemented the symmetrical version for cutechess. I did not dare to break the interface for existing engines, notably Pulsar and TkMax (Fairy-Max for Two Kings Chess by @HGMuller). These engines are CECP engines playing the original Wild/9 and the interface variant is
Right, perhaps |
OK, let's use
I already noticed your test ;-) This is consistent with HGM's observations when he adjusted the king value for TkMax. In the end it was about the value of a minor piece, perhaps a bit less. Please refer to cutechess/cutechess#242 (comments close to 2017-08-01). |
|
@alwey Thanks for the hint. The king value might still be far from optimized in Stockfish, but at least it seems to be a reasonable value for now. |
|
It is well-established that the opening value of a non-royal King
('Commoner') is equal or slightly below that of a Knight. And it makes
sense that the fact that an adventurous Commoner that must avoid a part
of the board where it would be royal and not safe, should be worth less.
I would imagine, though, that a fixed value here is not ideal, and that
it would work much better to make it dependent on the relative King
location. The closer the Kings are to the point where they would
transfer royalty, the more the fact that the currently non-royal one
might become royal becomes a concern. So one approach could be to
calculate a King Danger penalty for both, and then make a weighted
average of those with a factor that depends on the distance to the
switching point.
|
Add subvariant twokingsymmetric #431
Implements the rules of wild9 from ICC:
https://www.chessclub.com/user/help/wild9
For now, the move generation is implemented rather inefficiently in order to keep the code simple. Illegal king moves are detected by
Position::legalwhich avoids having to add more complex logic in the generation of evasive and non-evasive king moves.