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

Support two kings variant (wild9) #431

Merged
merged 1 commit into from Nov 1, 2017
Merged

Conversation

ianfab
Copy link
Collaborator

@ianfab ianfab commented Nov 1, 2017

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::legal which avoids having to add more complex logic in the generation of evasive and non-evasive king moves.

@ddugovic ddugovic merged commit e089160 into ddugovic:master Nov 1, 2017
@Nordlandia
Copy link

Nordlandia commented Nov 1, 2017

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:
http://www.chessvariants.com/invention/kings

@ianfab
Copy link
Collaborator Author

ianfab commented Nov 1, 2017

@Nordlandia I left a comment in the code on how to implement the symmetrical variant:
https://github.com/ddugovic/Stockfish/pull/431/files#diff-3f509c526a6276f64b461d7230fda071R445

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.

@Nordlandia
Copy link

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.

@ddugovic
Copy link
Owner

ddugovic commented Nov 2, 2017

I've merged this as I do want multi-variant Stockfish to support TwoKings, which differs from chess in a couple important respects:

  • Each player optionally has a non-royal king (which one that is depends upon the kings' positions)
  • The non-royal king has a material value and can be attacked and captured (which affects move generation and validation, at least for players having multiple kings)

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).

@ianfab
Copy link
Collaborator Author

ianfab commented Nov 2, 2017

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.

@alwey
Copy link

alwey commented Nov 2, 2017

The symmetrical variant uses sortland9 just to have a value for UCI_Variant. I would suggest to change this in cutechess when a new name has been agreed upon.

@ianfab
Copy link
Collaborator Author

ianfab commented Nov 2, 2017

@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.

@alwey
Copy link

alwey commented Nov 2, 2017

@ianfab

We could name the ICC variant wild9 and call the symmetrical variant twokings, but that might also cause confusion.

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 twokings.

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.

Right, perhaps 2kings, twokings2, twokingseach or twokingssymmetric would be ok.

@ianfab
Copy link
Collaborator Author

ianfab commented Nov 2, 2017

@alwey The further three still have too much potential for confusion, so I currently think twokingssymmetric might be the best option.

By the way, decreasing the king value from ~5 pawns to ~3 pawns helps quite a bit in terms of playing strength: #435

@alwey
Copy link

alwey commented Nov 3, 2017

@ianfab

The further three still have two much potential for confusion, so I currently think twokingssymmetric might be the best option.

OK, let's use twokingssymmetric.

By the way, decreasing the king value from ~5 pawns to ~3 pawns helps quite a bit in terms of playing strength: #435

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).

@ianfab
Copy link
Collaborator Author

ianfab commented Nov 3, 2017

@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.

@HGMuller
Copy link

HGMuller commented Nov 3, 2017 via email

ianfab added a commit to ianfab/Stockfish that referenced this pull request Nov 6, 2017
ianfab added a commit to ianfab/Stockfish that referenced this pull request Nov 9, 2017
ddugovic added a commit that referenced this pull request Nov 9, 2017
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

Successfully merging this pull request may close these issues.

None yet

5 participants