Chess variant : Makruk/Cambodian chess

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

Chess variant : Makruk/Cambodian chess

Postby Olivier Deville » 20 Jan 2011, 17:59

When I visited Cambodia in August 2010, I was taught cambodian chess, and played a couple of games.

I saw today that FairyMax is able to play Makruk, which is the same game. There is only one more rule in Cambodian chess : the king is allowed to move like a knight once in the game.

I started by e3-e4. FairyMax played its Koul from f8 to e7. Then I wanted to move my Neang from e1 to e3, which is allowed according to what I was told, and confirmed here : http://history.chess.free.fr/cambodian.htm

I was not allowed to play this move, though.

Olivier

EDIT : Lousy me :) :? It reads :

The Queen moves 1 step diagonally only, conserving the old Indo-Persian move. In Cambodia only, she can jump at the 2nd case straight ahead (e1-e3) at her first move.


So this rule belongs to Cambodian chess only, and not to Makruk. I suppose it would be quite easy to implement Cambodian chess :wink:
User avatar
Olivier Deville
 
Posts: 1176
Joined: 26 Sep 2004, 19:54
Location: Aurec, France

Re: Chess variant : Makruk/Cambodian chess

Postby Roger Brown » 21 Jan 2011, 09:38

Hello Olivier,

Let H.G. know.

He is in the midst of a bout of incredible creativity with respect to Winboard and supporting all sorts of games including checkers!

:shock:

The man does not know when to stop....

Later.
Roger Brown
 
Posts: 346
Joined: 24 Sep 2004, 12:31

Re: Chess variant : Makruk/Cambodian chess

Postby H.G.Muller » 21 Jan 2011, 10:32

It is all the fault of Daniel Shawul... He insisted to make his WB variant engine play Checkers as well as Chess variants! :D

As to Oliviers remarks, on the website he links to it actually says both these rules are unique to Cambodian Chess:

The Queen is always placed at right of the King in the setup. Contrarily to European Chess, the King are not facing each other.
The King moves as in European Chess. In Cambodia, he is allowed to make a Knight jump at his first move. This special move is no more used in Thailand.
The Queen moves 1 step diagonally only, conserving the old Indo-Persian move. In Cambodia only, she can jump at the 2nd case straight ahead (e1-e3) at her first move.
The Bishop can step 1 case in the 4 diagonal directions as well as straight forward. This is commented below.


Implementing Cambodian Chess in Fairy-Max would not be completely trivial, because of the one-time-only moves. I guess for the Queen move it could be defined in the fmax.ini file by defining the same double-step move as there is for the Paws. (And because of Spartan Chess Fairy-Max even has a way to do that without allowing e.p. capture of the Queen on the next move! :D )

The King move is more tricky, as Fairy-max automatically assumes that one-time King moves are castlings, and would move the Rook (or any other corner piece) with it. So it would really require some extra programming in Fairy-Max. I remember that the old Indian Chaturanga also allowed such a Knight jump of a virgin King, so perhaps it is orth it.

Of course WinBoard would have to be taught too that these moves are legal, or you would have to play it with legality testing off.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Chess variant : Makruk/Cambodian chess

Postby Olivier Deville » 21 Jan 2011, 11:16

Thanks to both of you for the comments :)

It seems new Daniel's thing even plays Go :shock: I am going to try it when I have some spare time.

Olivier
User avatar
Olivier Deville
 
Posts: 1176
Joined: 26 Sep 2004, 19:54
Location: Aurec, France

Re: Chess variant : Makruk/Cambodian chess

Postby Homi » 14 May 2013, 15:34

Thank you MR.Muller.


Can you add ASEAN chess in Winboard?

The Laws of ASEAN-Chess
http://www.fide.com/images/stories/NEWS ... -Chess.pdf

The game applies some Chess's rules to those tradition chess variants in ASEAN (such as Ouk Chatrang, Makruk, Sittuyin) for easier to settle the tournaments and record the results.

Some different rules between Chess and ASEAN-chess such as
- Bishop is called as Elephant
- Pawns start at the 3rd row and can be promoted to be Queen (and only Queen) at the 8th row
- Queen can move only 1 diagonal space
- Bishop (Elephant) can move 1 space diagonally or 1 space forward
- No Castling
- Use counting rules when neither side has any pawns and both players agree to use counting rules

Note: ASEAN stand for "Association of South East Asia Nations"



(Source: http://boardgamegeek.com/boardgame/113551/asean-chess)
Homi
 
Posts: 9
Joined: 13 May 2013, 13:03

Re: Chess variant : Makruk/Cambodian chess

Postby Homi » 14 May 2013, 15:50

MR. Muller

There is an interesting variant of Makruk calling 'Ai-Wok'.

It is played like usual Makruk, but 'Med' has name 'Ai-Wok' and can move more powerful.

Ai-Wok moves like Med + Knight + Rook. Every pawn can promote to Ai-Wok at 6th row.

Changing of Fmax.ini may be not enough. The value 181 hanging with pawn promotion. Ai-Wog should have value slightly greater than queen. Change in engine code may be need. I'm not sure how to do it.

Do you have an idea?
Homi
 
Posts: 9
Joined: 13 May 2013, 13:03

Re: Chess variant : Makruk/Cambodian chess

Postby H.G.Muller » 14 May 2013, 16:47

Well, the document says 'proposal for the rules', so I am not sure if this will actually the final version. It seems to be identical to Makruk, apart from the fact that promotion is only on the 8th rank. (Which seems like a mistake, as none of the 3 games this variant is supposed to resemble has that.) And that the 50-move rule is added, and the counting rules are simplified. (But WinBoard doesn't do counting anyway, and the 50-move rule is user-configurable in any variant.)

Even if it is correct that promotion is only on 8th rank, I wonder if that justifies adding an entirely new variant for it. I could make the rules of Makruk as implemented now a bit more liberal, allowing the player to defer promotion on 6th and 7th rank, (as in Grand Chess), and leave it to the engine to judge whether deferral is legal or not. Note that Fairy-Max would play this variant when you change the M (= Queen) value from 181 to 181 (as 181 is used as a kludge to indicate the 3-deep promotion zone).

As to the Ai-wok: it would indeed be better to do away with the 181 kludge, and allow a more direct way for the user to indicate the depth of the promotion zone is 3 ranks. For now the line

Code: Select all
makruk = w[7]==181 ? 64 : 0; // w[7] is used as kludge to enable makruk promotions

could be changed to
Code: Select all
makruk = w[7]==181 || w[7] ==XXX ? 64 : 0; // w[7] is used as kludge to enable makruk promotions

where XXX is the value you assigned to the Ai-Wok (which, btw, should be worth significantly more than a FIDE Queen, as the RN combination is already only half a Pawn weaker than a Queen. I would guess more like 1100, i.e. > 2 Rooks. Note that in the Makruk defenition Rooks are set to 630, so 1350 might be a good value.
Last edited by H.G.Muller on 14 May 2013, 17:26, edited 1 time in total.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Chess variant : Makruk/Cambodian chess

Postby H.G.Muller » 14 May 2013, 17:24

Perhaps a more universal way to do this would be to add after the line
Code: Select all
{ printf("telluser unsupported board size %dx%d\n",BW,BH); exit(0); }

The code
Code: Select all
makruk = 0;
if(fscanf(f, "=%d", &i)) makruk=64;

so that expressions like 8x8=3 for the board size in the game definition would be understood to mean the promotion zone has depth 3. (With the given code it would always think it is 3, no matter what number you actually give, as i is ignored, but it would be ready for later code modifications that would accept other values.) The makruk definition would then need this addition =3.

The current line mentioned in the previous post should be deleted in that case.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Chess variant : Makruk/Cambodian chess

Postby Homi » 15 May 2013, 03:40

Thank you for your quick response.

O.K. The Laws Of ASEAN Chess is proposal, but the international competition in SEAGAMES 2011 in Indonesia (next 2013 in Burma) presents for acceptable.

Thailand's Kongsee Uaychai won the gold medal in the maiden ASEAN chess competition undefeated in the 5-man round robin.
http://susanpolgar.blogspot.com/2011/11 ... games.html


You said:

Fairy-Max would play this variant when you change the M (= Queen) value from 181 to 181


Do you mean 180 ?

O.k. it done but WinBoard don't recognize the setup position. I must set up it manually.



Your code for Ai-Wog is excellent. Thank you!
Homi
 
Posts: 9
Joined: 13 May 2013, 13:03

Re: Chess variant : Makruk/Cambodian chess

Postby H.G.Muller » 15 May 2013, 08:41

Homi wrote:Do you mean 180 ?

O.k. it done but WinBoard don't recognize the setup position. I must set up it manually.


Yes, sorry, that is what I meant to write. I am not sure what you did. When I replace the 181 for m by 180 in fmax.ini in the makruk definition, and then set it to play Makruk under WinBoard, the initial position is OK. But promotion becomes a problem, as Fairy-Max then assumes promotion at last rank only, and thus does not specify a promotion suffix when it moves a Pawn to 6th rank. WinBoard apparently cannot stand this, and makes the Pawn simply disappear. This is what would have to be changed in WinBoard to make this possible. (And Fairy-Max could then be equipped with an extra option similar to the 'Cambodian Makruk rules', which is now a checkbox, but could be made a combobox to select Makruk / ASEAN / Cambodian.)

But apparently you are doing something else. If you would define a new variant, named fairy/ASEAN, which is otherwise identical to Makruk, you could select it in the Engine #N Settings combobox (you could even make it the default choice depending on where you would locate its definition in fmax.ini). Then it would be played whenever you set WB to variant fairy. This should be perfectly possible, as the only reason for making Makruk a separate variant was that the promotion zone is different. Which we don't want for ASEAN.

But in that case neither Fairy-Max nor WinBoard would realize that the Pawns start on 3rd rank. WinBoard knows this for Makruk, and considers it always played from a setup position, sending the position to the engine. At the moment this can be worked around by specifying a loadPositionFile with the engine. E.g. you could make a special install of Fairy-Max dedicated to ASEAN, by switching to variant fairy, and in the Load Engine dialog tick 'Force current variant with this engine', and specify as 'Special WinBoard options':

-lpf ASEAN.fen -testLegality false

where you prepared the ASEAN.fen file in the WinBoard folder to contain the FEN of the initial position of ASEAN Chess. As I understand it is common to play ASEAN Chess with the FIDE piece pictograms (e.g. an Elephant should look as Bishop, rather than Elephant), and also use the FIDE names (like Q for the Ferz), there would be no need to redefine the pieceToCharTable. (But you would have to adapt the naming of the pieces in the fmax.ini file accordingly.) If ASEAN is not Fairy-Max standard setting for variant fairy, you could add the option

-firstOptions "Variant fairy selects=ASEAN"

So that whenever you select this engine, it will automatically be set up for SEAN Chess.

In the longer run these complications could be solved by slightly modifying Fairy-Max: WinBoard already accepts the initial position from the engine in variant fairy, but the problem is that Fairy-Max now assumes the Pawns are always on 2nd rank, and thus sends the wrong position. So what must be done is to let Fairy-Max read the Pawn rank from the definition in the fmax.ini file somehow (optionally, to retain backward compatibility with the existing definitions).

This latter solution would still have the slight drawback that ASEAN would have to be played with legality testing off. (This could lead to unnecessary disambiguators and check/checkmate signs in the PGN.) You would not have that when ASEAN is played as Makruk, as WB know how the Makruk pieces move. (But only if you used the same non-FIDE symbols for the pieces; if you would use a Bishop for the Elephant, it would assume it moved as an ordinary Bishop. You could use external piece bitmaps or font to redefine how the pieces look, however.)
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Chess variant : Makruk/Cambodian chess

Postby Homi » 15 May 2013, 11:55

Oh, it is more complicate than I guess.

I did the first way:
- modified Fmax to allow assignment new value for Med as you intorduced.
- made difference ini file, one for ASEAN chess another for Ai-Wok, both game calles 'Makruk'.

I tested it in 2 machines mode, after 2-3 moves I thought it's ok and run to my work.
When I came back, WB shown illigal move after 23 moves. I checked move history. I found that pawn disappeared at 6th rank!

I know now WB/Makruk can play neither ASEAN nor Ai-Wok because of promation problem at 6th/8th row.

I will try fairly/ASEAN later.
Homi
 
Posts: 9
Joined: 13 May 2013, 13:03

Re: Chess variant : Makruk/Cambodian chess

Postby H.G.Muller » 15 May 2013, 12:09

But for Ai-Wok promotion must be on the 6th rank, right?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Chess variant : Makruk/Cambodian chess

Postby H.G.Muller » 16 May 2013, 10:42

Well, it was simpler after all to add ASEAN as a separate variant. That way I just could replace VariantMakruk everywhere by VarianMakruk || VariantASEAN (except that set the depth of the promotion zone to 3) without thinking. While trying to be clever required new code and altered behavior (like promotion popups where they originally were not).

I uploaded a WinBoard version supporting ASEAN Chess to http://hgm.nubati.net/WinBoard-ASEAN.zip .

The name of the variant in WB protocol (which you would have to use in the fmax.ini game definition) is asean (lower case!). I let it use B for Elephant and Q for Ferz (like in Shatranj), so be sure to adapt the Makruk definition accordingly when you clone it to define ASEAN (swapping all b-s and m-q, and changing the value of piece 7 to 180).
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Chess variant : Makruk/Cambodian chess

Postby Homi » 17 May 2013, 06:38

But for Ai-Wok promotion must be on the 6th rank, right?



Yes.


Thank you for your work. :)


WB with ASEAN variant is pretty good. But queen's start position is not correct. White queen should start at d1, like FIDE chess (not at e1 like Makruk).


When I change the rule in fmax.ini for Makruk to play Ai-Wok, WB reject the move of new defined Med and claim for illegal-move. :(
Homi
 
Posts: 9
Joined: 13 May 2013, 13:03

Re: Chess variant : Makruk/Cambodian chess

Postby Homi » 17 May 2013, 06:53

Another variant of Makruk is "Sittuyin", Burmese chess, Pawn's start position is unusual because left pawns start at 3rd rank while right pawns start at 4th rank. Pawn's promotion vary in diagonal line a8-d5 and e5-h8 for white, a1-d4 and e4-h1 for black.

If you need to implement all variants in program, you need to separate start positions and promotion lines for pawns. Start position can vary from 2nd to 4th row, promotion line can vary from 5th to 8th row.

White pawn's start position:
- FIDE chess --> 2nd row
- ASEAN chess --> 3rd row
- Makruk (Thailand/Cambodia) --> 3rd row
- Sittuyin (Burmese chess) --> left at 3r row, right at 4th row

White pawn's promotion:
- FIDE chess --> 8th row
- ASEAN chess --> 8th row
- Makruk (Thailand/Cambodia) --> 6rd row
- Sittuyin (Burmese chess) --> diagonal line a8-d5 and e5-h8

:D
Homi
 
Posts: 9
Joined: 13 May 2013, 13:03

Re: Chess variant : Makruk/Cambodian chess

Postby H.G.Muller » 17 May 2013, 08:23

To play such variants with modified pieces you must make sure that WinBoard's legality testing is off (in General Options dialog). Then WinBoard leaves it to the engine to decide if a move is legal (and you would get the message "Illegal move XXX (rejected by first chess program)" rather than just "Illegal move").

An alternative would be to use a 'wildcard piece' such as Falcon or Cobra, for which WinBoard would accept any move of it, even with Test Legality on. You would have to indicate that the piece participates by redefining the /pieceToCharTable, though. Like

/pieceToCharTable="PN.R.M....S........AKpn.r.m....s........ak"

This would define the Cobra as participating with piece ID 'A'. (and you would have to define it in the Fairy-Max definition under that name, as well as with name 'M'). The initial position used by WinBoard would still use Ferz for Met, with the ordinary move (and piece ID 'M'), so you would have to provide a /loadPositionFile with a FEN using the Ai-Wok next to the King.

So it gets pretty complex, and is perhaps not worth it (compared to simply switching Test Legality off).

I had not noticed the different setup of ASEAN compared to Makruk. I will define a separate array for ASEAN, then. Sittuyin would be hard to fully implement in WinBoard. But when playing with legality testing off WinBoard will strictly obey any promotion suffixes on moves, even on moves outside what it thinks is the promotion zone. So if you would play Sittuyin as ASEAN with a different initial setup (and perhaps with holdings, for the initial piece drops), so that Pawns would only 'auto-promote' on the last rank, the engine could force promotion earlier by simply putting the m suffix on moves into what it knows to be the zone. The only problem would be in human-engine games, when the human enters the zone. WinBoard would not put up a promotion dialog (or enable sweep promotions) for moves it does not think are in the zone. Now for ASEAN it would not put up a promotion dialog anyway, as there is no choice, but it would assume non-promotion when you play the move. The current work-around is to enter such moves by typing them, like e4e5m or e5=M.

The WinBoard Alien Edition would be better suited for games like Sittuyin, as the engine has more control over the GUI there. I think that Evert Glebbeek's engine Sjaak actually plays it under WinBoard Alien. For Fairy-Max it would be too difficult anyway.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Chess variant : Makruk/Cambodian chess

Postby Homi » 17 May 2013, 09:47

Aha! I got it.

WinBoard's legality testing is off


I forgot to check out this option. Now I let it off and can play Ai-Wok well.

ASEAN chess and Ai-Wok are now playable. Thank you again!

Your work is great!
:D
Homi
 
Posts: 9
Joined: 13 May 2013, 13:03

Re: Chess variant : Makruk/Cambodian chess

Postby Homi » 17 May 2013, 10:43

Conclusion what I did:

- modified fmax.c
--add code after line
Code: Select all
 { printf("telluser unsupported board size %dx%d\n",BW,BH); exit(0); }

with this line
Code: Select all
 makruk = 0;  if(fscanf(f, "=%d", &i)) makruk=64;

-- remark do not use this line
Code: Select all
// makruk = w[7]==181 ? 64 : 0; // w[7] is used as kludge to enable makruk promotions


- make it to exe file

- added games in fmax.ini


Code: Select all
// Ai-Wok
// Thai Chess with modified Med. Note: pawn promotion at 6th!
// normal Med m:181 1,3 16,3 -1,3 -16,3
// Ai-Wok (modified Med) m:1260 1,3 16,3 -1,3 -16,3 15,7 17,7 -15,7 -17,7 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7
Game: makruk
8x8=3
12 11 8 3 7 8 11 12
12 11 9 7 3 9 11 12
p:100 -16,6 -15,5 -17,5
p:100 16,6 15,5 17,5
k:-1  1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7
f:1260 1,3 16,3 -1,3 -16,3 15,7 17,7 -15,7 -17,7 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7
q:1260 1,3 16,3 -1,3 -16,3 15,7 17,7 -15,7 -17,7 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7
b:300 15,7 17,7 -15,7 -17,7 -16,7
m:1260 1,3 16,3 -1,3 -16,3 15,7 17,7 -15,7 -17,7 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7
s:300 15,7 17,7 -15,7 -17,7 -16,7
s:300 15,7 17,7 -15,7 -17,7 16,7
b:300 15,7 17,7 -15,7 -17,7 16,7
n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7
R:630 1,3 16,3 -1,3 -16,3

// ASEAN chess
// Derived from Makruk (Thaichess). Note: value q = 180, promotion at 8th!
Game: asean
8x8
12 11 8 7 3 8 11 12
12 11 9 7 3 9 11 12
p:100 -16,6 -15,5 -17,5
p:100 16,6 15,5 17,5
k:-1  1,7 16,7 15,7 17,7 -1,7 -16,7 -15,7 -17,7
f:180 15,7 17,7 -15,7 -17,7
m:180 15,7 17,7 -15,7 -17,7
b:300 15,7 17,7 -15,7 -17,7 -16,7
q:180 15,7 17,7 -15,7 -17,7
b:300 15,7 17,7 -15,7 -17,7 -16,7
b:300 15,7 17,7 -15,7 -17,7 16,7
s:300 15,7 17,7 -15,7 -17,7 16,7
n:450 14,7 31,7 33,7 18,7 -14,7 -31,7 -33,7 -18,7
R:630 1,3 16,3 -1,3 -16,3



- use Winboard with ASEAN chess (Set option Test lagality off)
-- Edit Engine List...
Code: Select all
      "Makruk" -fcp fmax -fd "..\Fairy-Max" /variant=makruk
      "Ai-Wok" -fcp "fmax mygame.ini"  -fd "..\Fairy-Max" /variant=makruk
      "ASEAN" -fcp "fmax mygame.ini"  -fd "..\Fairy-Max" /variant=asean




Now, ASEAN chess and Ai-Wok are playable.

Note: ASEAN chessneeds to setup position before play, white queen d1, king e1



All is not meine. It was a great job from H. G. Muller. Thank you.
Homi
 
Posts: 9
Joined: 13 May 2013, 13:03

Re: Chess variant : Makruk/Cambodian chess

Postby H.G.Muller » 17 May 2013, 13:47

I now uploaded a version that uses the correct start position for ASEAN (same link).

[Edit]
The latest version of Fairy-Max in my on-line repositiry now supports ASEAN Chess. It also has a new combo option to choose between several 'Makruk rules': you can select makruk (the default), cambodian or ai-wok. The latter two would have to be played with legality testing of WinBoard off. (And in engine-engine games, don't forget to set it for both engines!)
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Chess variant : Makruk/Cambodian chess

Postby Homi » 21 May 2013, 07:39

Thank you for all of your works.
Homi
 
Posts: 9
Joined: 13 May 2013, 13:03

Next

Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 23 guests