Closed thaichessswinboard closed 5 years ago
Cambodian chess definitely is among the list of variants I want to implement, but it is unclear at the moment when it will happen, because I am not sure yet how to implement the special moves of the king and the queen.
Links for future reference: https://en.wikipedia.org/wiki/Makruk#Cambodian_chess http://www.khmerinstitute.com/culture/ok.html
@thaichessswinboard By the way, are you aware that you can now play Makruk against Fairy-Stockfish and human players online at https://pychess-variants.herokuapp.com/ and even let your games be analyzed by the engine?
By the way, does anyone know other variants with such kinds of one-time moves?
Do you mean Makruk variants or in general? Chess ;-), some variants of Chaturanga (King leaps like Knight once), Courier-Spiel (possibly the Medieval Queen does not start at the third rank but on the first rank and can leap to the third, https://www.youtube.com/watch?v=lIgvC4iFtHw), there are certainly more examples.
Many Thanks to interesting Cambodian chess (Ouk Chatrang). White King can move to b2 and g2 square and Black King Can move to b7 and g7 for castle only. And White Queen can move in the first opening from d1-d3 and move White Pawn to d4 and Black Queen can move from d8-d6 and Move Black Pawn the same time to d5 that how it the game of Oak play I hope you understand what I mean. And thanks you for suggest how to play makruk on website.
Regard
Makruk and khmer player fan club.
@alwey Yes, I was actually also even thinking of moves like castling, although I am only interested in really distinct forms of one-time moves, and not of 100 variants that have castling.
The reason why I am asking is that Fairy-Stockfish is feature/rule-centric and variants are just a mere collection of features/rules, so I do not really implement new variants but new features and the variants just emerge as a side effect. Therefore, I am interested in understanding how the feature should be designed to cover as many variants as possible without adding too much complexity.
@ianfab :
The reason why I am asking is that Fairy-Stockfish is feature/rule-centric and variants are just a mere collection of features/rules, so I do not really implement new variants but new features and the variants just emerge as a side effect. Therefore, I am interested in understanding how the feature should be designed to cover as many variants as possible without adding too much complexity.
I guessed so. I am planning to implement and to suggest a GeneralBoard
or likewise to the CuteChess team that can be used in connection with description files for game rules. This would be more flexible but slower than the direct implementation of variants.
@ianfab @thaichessswinboard: /Wrt Ouk: It is implemented in cutechess. Here the initial moves of Maiden (Neang, two ranks forward) and Pawn are separate. This is consistent with educational youtube videos made by former Cambodian Chess champion Chheav Bora, e.g. https://www.youtube.com/watch?v=kYQ69kDINHM&list=RDQMHskKKNrnye4&index=4 and https://www.youtube.com/watch?v=KjzKrzYbJag . The Kings may on their first move leap sideways once like a Knight when not in check. All the special moves can not capture.
From oukboard.h:
* \brief A board for Ouk Chatrang (Ouk Khmer, Cambodian Chess)
*
* Ouk Chatrang is a variant of chess popular and with a long tradition
* in Cambodia. It is closely related to Chaturanga and Makruk.
*
* Cambodian Chess (Ouk) and Thai Chess (Makruk) are essentially the same game,
* but the pieces are named differently.
*
* Ouk has additional moves, which have been abandoned in Makruk:
*
* The King has the option to make an initial leap sideways like a Horse
* (Knight), but only if not in check. The Advisor (Maiden, Neang) may leap
* straight forward two squares on its initial move. These moves cannot capture.
*
* \note Rules: http://history.chess.free.fr/cambodian/Cambodian%20Chess%20Games.htm
* http://www.khmerinstitute.com/culture/ok.html
@alwey That sounds awesome.
I am aware of the Ouk and Kar Ouk implementations in cutechess and will of course ensure compatibility (when I finally get to implementing it). The only thing I implemented so far is the possibility to skip the check counts in the FEN (compared to 3/5check) if already the first check wins in order to be compatible with Kar Ouk FENs in cutechess.
Fairy-max for winboarrd can move likes Oak but it not strong I think stockfish more strong to move and have skill more than other program that why I ask for stockfish to make engine. Stockfish can make endgames and make program to progess and move like human thinking but endgames of Oak maybe complicate more than chess because Values of pieces nearly the same values but it take time to do program if you can do some example of source code it will be great for players they will learn good move from program more. I hope you understand what I mean. If you have time or somebody interesting edit King and Queen move to variant cambodian it will be good. Or can you suggest what file about King moves and queen moves In source code of stockfish it hard to read where is king moves direction or Queen direction. Thanks for read my explain.
@thaichessswinboard @alwey I have some questions regarding the rules of the special king and queen moves that are not clear to me yet:
you can try play against computer this website but it not strong engine I try long time ago programmer is the real cambodian he know exact rules on this website http://ouk.sourceforge.net/kchess.php you will know the real rules many thanks to interesting
Regards. thaichesswinboard.
Since the special moves can not be used to capture a piece, can the opposing king safely move to these squares (e.g., b2, f2, and e3 for the black king) or is it considered to be in check, i.e., moving there by the king is illegal? In cutechess the latter seems to be the case.
This seems to be a bug. There are contrary rules in the implementation of OakBoard
between move generation and check detection.
Can the queen leap over the square right in front of it if it is occupied by a piece? In cutechess it seems to be allowed.
The Neang can leap over a piece in front of it when making its initial move. E.g. https://www.youtube.com/watch?v=yxFXGG1B4wY at 0:25 Min.
Can the queen's move be used to evade a check? Let's say the white king is on e4 and a black rook on e2, can the queen move from e1 to e3? In cutechess it can
I was not sure about this, so I implemented the simplest rule (or rather not implemented a prohibiiton). EDIT: Four sources were used for the rules, see comments in the discussion https://github.com/cutechess/cutechess/pull/348
EDIT: probably the King cannot capture but the Neang can capture on the special move
Cutechess implementation (when bug is removed, comment in header needs update)
SPECIAL MOVES King not in Check King in check
King (Sdaach) no captures not allowed
Queen (Neang) all all
We need some additional reliable sources.
Thanks a lot. I also checked in A world of chess, where it is explicitly mentioned that some players allow captures by the special move of the queen/neang and some do not.
Currently the cutechess implementation of rules goes towards that of http://ouk.sourceforge.net but unintentionally. I would really like to understand more of Cheeav Bora's introduction to Ouk Chatrang, because he does discuss some of the tricky cases. But I am not sure whether he says this and that is allowed or not. However sometimes he makes clear gestures so that one understands: this move is not allowed.
I also checked in A world of chess, where it is explicitly mentioned that some players allow captures by the special move of the queen/neang and some do not.
Ah, interesting. so no wonder that there is some confusion.
A World of Chess is written by Jean-Louis Cazaux who also is the editor of http://history.chess.free.fr. This site hosts one of our sources, Cambodian Chess Games by Vuthy Tan
Test positions
When White captures the black Horse with the Advisor (Mxe3), in all three cases Sjaak II 1.4.1
rejects the move but Fairymax 5.0Q
accepts them all.
I found out that there are a few tricks to massively simplify the implementation (e.g., sharing some code with S-Chess^^), so I actually already have a seemingly working version, see https://github.com/ianfab/Fairy-Stockfish/commit/1c486ed72da75decd73e9fc09db2f726e0b7ac7b. I only did limited testing so far (perft + bench + 2 games in cutechess), but independent testing from your side would anyway be very welcome. The rules that I implemented can be summarized by the aforementioned table:
SPECIAL MOVES King not in Check King in check
King (Sdaach) no captures not allowed
Queen (Neang) all all
@alwey I have seen difference in perft 6 results that might be due to the bug in the cutechess implementation, but I am not sure yet: https://github.com/cutechess/cutechess/blob/4142aeaab8ae80b0d6b9bf8b2f693af0362e0b0e/projects/lib/tests/chessboard/tst_board.cpp#L1417 states 204755574 Stockfish reports 204757579
I pushed a branch ouk6 with the corrections into my repository. Now perft 6 matches: 204757579.
That was fast. Thanks for confirming the number.
some of example game of fairymax variant cambodia move maybe you interesting
[Event "Computer Chess Game"] [Site "PCST"] [Date "2019.10.16"] [Round "-"] [White "Fairymax 5.0"] [Black "Fairymax 5.0"] [Result "1/2-1/2"] [TimeControl "180/180"] [Variant "cambodian"] [VariantMen "M:FifD;K:KiN"] [FEN "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR w EDed 0 1"] [SetUp "1"]
{-------------- r n s m k s n r . . . . . . . . p p p p p p p p . . . . . . . . . . . . . . . . P P P P P P P P . . . . . . . . R N S K M S N R white to play --------------}
at the endgame must move advance more than this but program capture Rook at the End make the game not advance but it ok for beginner If stockfish can do maybe end game advance more than other Engine.
regards.
thaichesswinboard.
and another game but must advance more than this at the endgames
[Event "Computer Chess Game"] [Site "PCST"] [Date "2019.10.16"] [Round "-"] [White "Fairymax 5.0"] [Black "Fairymax 5.0"] [Result "0-1"] [TimeControl "180/180"] [Variant "cambodian"] [VariantMen "M:FifD;K:KiN"] [FEN "rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR w EDed 0 1"] [SetUp "1"]
{-------------- r n s m k s n r . . . . . . . . p p p p p p p p . . . . . . . . . . . . . . . . P P P P P P P P . . . . . . . . R N S K M S N R white to play --------------}
@ianfab: FYI: a match of 100 games at 30s+0.3s:
Score of sjaakii (xboard) vs stockfish-cambodian: 0 - 100 - 0 [0.000]
Elo difference: -inf +/- nan, LOS: 0.0 %, DrawRatio: 0.0 %
100 of 100 games finished.
6 Stockfish wins because of a false claim of an illegal move (Neang captures with initial leap) by the opponent, 1 win because of a false repetition claim (Ouk Chatrang has no repetition limit)
@thaichessswinboard You can now play cambodian chess online against Fairy-Stockfish at https://pychess-variants.herokuapp.com/, see e.g. this test game I played against level 6 (level 6 is not at full strength, level 8 would have won it easily). For offline usage, you need to compile it from the current master branch. If you need help, let me know.
@thaichessswinboard Referring to your comment https://github.com/thaichessswinboard/Fairy-Stockfish/commit/94bbcffa442cda0cd1d5f1e1a90bb54b1f84f483#commitcomment-36273633, this is the thread where we discussed the rules (including the situation where the queen/neang captures a piece with its leap). If you have new input/sources to clarify the rules where there was some unclarity, please let us know. E.g., are there tournament rules of Ouk that could be used as a reference?
This is My code about Fers in Cambodian Chess. That I ask Cambodian people. See attached files please.
Edit: Deleted long code snippet
for Cambodian Chess I test with my Engine with your Cambodian Website. IT Draw but My Engine Advancetage more. I will test more and let you know.
I test Games 2 level 8 result. My Engine move Black side. It 0-1
@thaichessswinboard Pasting long texts like whole source files or games into comments makes threads hard to read, so please try to only refer to them, e.g., by adding a link to a game (like I edited your comments above) or uploading the PGN file in the comment instead of pasting the content itself. If you would like to share code, please upload it as git commits to github (or at least post a diff/patch), otherwise it is almost impossible for me to work with them, because extracting the code changes from a comment creates a lot of work.
That a locally running engine with sufficient time can defeat level 8 on pychess-variants is not too surprising, since level 8 is limited to 1 second per move and depth 22. Is the engine you used open-source?
Can you make variant cambodian (Oak khmer chess) and please see this video explain how cambodian variants https://www.youtube.com/watch?v=RD91zLPxTmI many thanks if you make this variants many khmer player will likes and have strong engine to play this games. I hope you interesting to do.
Regard.
Makruk and khmer player fan club.