The Knightmate Challenge!

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
hgm
Posts: 28468
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: The Knightmate Challenge!

Post by hgm »

PK wrote:I brought down the value of a commoner, as the games were too painful to watch. please download the recent version 1.01.06a - available at www.marittima.pl/cccp under the same link as the old one.
Well, I am afraid you will have to watch a few more, as I will not retract the current one from the tourney, but just add the new one. This will be a nice test to see how the Commoner value affects engine strength.

And the new CCCP will have to play its first game against JokerNM! :lol:

Come to think of it: Knightmate seems a much more natural game for CCCP to play than normal Chess, with the Kings robbed of their royal status. :lol: :lol: :lol:
PK
Posts: 913
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: The Knightmate Challenge!

Post by PK »

Hi,

I see that Joker KM is definately a fine example of anti-Soviet software and a class for its own! I hope to score better against fairy-Max though - I have some crude approximation of king safety function and the royal knight is such a poor piece in the middlegame. :lol:

I have just downloaded winboard_f, but I cannot get a proper display for knightmate - the non-chess pieces disappear, and the pasted line with charToTable disappears from the ini file. what should I do about it?

regards,

pawel koziol
User avatar
hgm
Posts: 28468
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: The Knightmate Challenge!

Post by hgm »

Yes, Joker is quite a bit stronger than micro-Max, and there is no reason why that should not carry over to Knightmate either. I had somewhat more trouble than I expected in converting it, though: initially I just swapped the pieces of code for generating the Knight and King moves, and the capture codes for the 0x88 attack test. I fixed this in 5 minutes, and this made it play fine aggainst itself. But it was rejecting perfectly legal moves from other opponents. At first I couldn't understand why.

But it turned out to be a problem in the way my move generator treats pinned pieces. It first detects them through the enemy slider list and own King position, and then hides them to the normal move generator, with some special code to generate moves along the pin ray. But a Knight in normal Chess never has any moves along the pin ray, while the Commoner in Knightmate always has moves along it. And it failed to generate those moves! :oops: But I fixed that, and now it seems to play OK.

I have the feeling that Knightmate needs a quite different King safety, though. A normal Pawn shield just in front of the King is fine for Chess, as the King defends all Pawns. But the Royal Knight doesn't defend any of them, so this constellation is very vulnerable. It would be perhaps better to build a Pawn shield on the 2nd rank. On the other hand, King safety might not be as important as in Chess, as it is quite easy to evacuate the Royal Knight. In two moves it can jump from the king-side to the queen-side castling position.

About your WinBoard_F problems.
Indeed I have not implemented bitmaps for Commoner and Unicorn in all boardsizes yet (as, until now, Knightmate was a pretty exotic variant). So currently they work only in board sizes "middling" and "bulky". For other board sizes you would have to use font-based rendering (/renderPiecesWithFont="..."), where you could use George Tsavdiris' WinboardF font.

The default letters WinBoard_F uses for Commoner and Unicorn are M and U, respectively (in FEN and PGN). The existing engines seem to use N and K, however. (At least Dabbaba and Fairy-Max did, as in Fairy-Max the lpiece indicators are not yet programmable through the fmax.ini file, and are limited to the set PNKBRQEFWMACHG, i.e. no U. So I programmed Joker this way too.) So to use 'edit position' with the engines, you would need the additional argument to WinBoard_F:

/pieceToCharTable="P.BRQ...N.KYp.brq...n.ky"

to make sure WinBoard will use N for Commoner and K for Unicorn when communicating with the engine. Perhaps I should make this the default. Perhaps I should make it possible to set different default overrules for the two engines, as currently there would be no way to play two engine against each other that do not agree to the piece indicators. (If you want to use 'setboard' or 'edit', that is, or in rarer cases, to for under-promotion.)

Indeed the /variant and /pieceToCharTable are options that are not saved in the winboard.ini file. You have to give them on the command line each time you invoke WinBoard. (When playing with a tournament manager like PSWBTM, writing of the winboard.ini on exit is suppressed, and in that case all options do stick as long as you do not run winboard in the same folder by hand.) You could do that in the Windows shortcut, if you make one.
User avatar
hgm
Posts: 28468
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: The Knightmate Challenge!

Post by hgm »

OK, JokerKM indeed trashed CCCP and Fairy-Max pretty badly. Doesn't make much sense to play it against Dabbaba unhandicapped, then.

So I now set up CCCP with the improved piece values against Fairy-Max. Based on their results against Joker, they should not be too far apart. So no handicaps.

After this 20-game match I will play CCCP against Dabbaba, where CCCP will have to face 9-fold time-odds. (Unless it unexpectedly loses very badly from Fairy-Max; then I will give it only 3-fold time odds.)
User avatar
Jim Ablett
Posts: 2424
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: The Knightmate Challenge!

Post by Jim Ablett »

PK wrote:Hi,

I see that Joker KM is definately a fine example of anti-Soviet software and a class for its own! I hope to score better against fairy-Max though - I have some crude approximation of king safety function and the royal knight is such a poor piece in the middlegame. :lol:

I have just downloaded winboard_f, but I cannot get a proper display for knightmate - the non-chess pieces disappear, and the pasted line with charToTable disappears from the ini file. what should I do about it?

regards,

pawel koziol
Here's a link to the Winboard-F package containing George's excellent font . Board graphics inc .
Replace the 'winboard.exe' with the latest alpha.

http://rapidshare.com/files/73230451/WINBOARD_F.zip
Winboard-F Knightmare castling bugfix - (rename .tst to .exe)
http://home.hccnet.nl/h.g.muller/alpha.tst

Jim.
User avatar
hgm
Posts: 28468
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: The Knightmate Challenge!

Post by hgm »

Below a very nice Knightmate game, that gives an excellent example of a very strong Commoner (the Knight substitute, which moves as a FIDE King, but can be captured like any other piece):

Code: Select all

[Event "Computer Chess Game"]
[Site "SCHAAK_PC"]
[Date "2008.05.14"]
[Round "1.1"]
[White "Fairy-Max 4.8 v"]
[Black "CCCP new"]
[Result "1-0"]
[TimeControl "40/540"]
[Variant "knightmate"]
[Annotator "1. +0.11   2... +0.11"]
[Number "5"]

1. c4 {+0.11/10 3} e5 2. d3 {+0.13/10 8} d5 {+0.11/10 2} 3. h3 {+0.11/10 9}
Bb4+ {+0.52/9 6} 4. Bd2 {+0.00/10 3} Bxd2+ {+0.42/10 5} 5.
Qxd2 {-0.12/10 4} c6 {+0.23/10 8} 6. Nc2 {+0.11/11 9} Nc7 {+0.30/10 6} 7.
Kc1 {+0.14/10 5} Be6 {+0.10/10 9} 8. e4 {-0.09/10 2} d4 {+0.13/10 6} 9.
f4 {-0.11/10 8} Qd6 {+0.07/10 9} 10. f5 {-0.16/11 3} Bd7 {+0.13/10 7} 11.
Nf2 {-0.19/11 5} Kc8 {+0.12/10 0} 12. Be2 {-0.04/10 4} Nf8 {+0.13/9 9} 13.
b4 {-0.05/10 2} c5 {+0.29/10 6} 14. bxc5 {-0.08/11 6} Qxc5 {+0.39/10 8} 15.
Nb3 {-0.11/11 4} Ne7 {+0.34/9 6} 16. Nb4 {-0.01/10 6} Qc6 {+0.37/10 0} 17.
Nb5 {-0.05/10 0} Qf6 {+0.36/9 9} 18. a4 {-0.02/10 2} Nc6 {+0.52/9 5} 19.
g4 {-0.02/9 0} Qh4 {+0.46/9 8} 20. Nf3 {-0.01/9 4} Ned6 {+0.58/8 7} 21.
g5 {+0.11/9 8} h5 {+0.33/10 3} 22. Rdg1 {+0.73/12 2} f6 {+0.23/10 5} 23.
Qa5 {+0.76/11 3} Ndc7 {+0.21/9 5} 24. Nxc6 {+0.64/12 4} Nxc6 {+0.40/10 2}
25. g6 {+0.63/11 9} Nb6 {+0.41/9 0} 26. Qb4 {+0.64/14 7} Nc7 {+0.30/9 6}
27. c5 {+0.75/12 6} Nc6 {+0.29/8 5} 28. a5 {+0.60/12 1} Nb5 {+0.47/10 1}
29. Qb3 {+0.60/12 2} Bc6 {+0.56/9 5} 30. Qa3 {+0.62/12 7} Rd7 {+0.77/10 7}
31. Bd1 {+0.55/12 1} Rc7 {+0.52/10 7} 32. Rh2 {+0.54/12 5} Bd7 {+0.60/9 4}
33. Rc2 {+0.51/12 5} Re8 {+0.59/9 9} 34. Rg3 {+0.24/10 5} Bc6 {+0.60/8 2}
35. Qa2 {+0.10/11 6} Nb4 {+0.24/9 2} 36. a6 {+0.63/12 7} Nc3 {+0.25/8 1}
37. Rf2 {+0.12/11 9} b6 {+0.38/8 8} 38. Ba4 {+0.92/11 3} Bxa4 {+0.51/9 2}
39. Qxa4 {+0.81/13 7} Rd8 {+0.69/9 6} 40. c6 {+0.74/13 4} Ke7 {+1.85/8 7}
41. Qa3+ {+0.58/12 5} Kxc6 {+1.93/9 7} 42. Ke2 {-0.22/12 5}
Kb8 {+1.85/10 9} 43. Kg1 {-0.82/13 5} Rdc8 {+1.90/10 3} 44.
Qd6 {-0.10/12 4} b5 {+1.85/10 0} 45. Qd5 {+0.54/13 0} Nb4 {+1.55/10 6} 46.
Rc2 {-0.22/12 3} Na5 {+0.20/10 1} 47. Qa8+ {+0.44/13 0} Kxa6 {+1.67/11 9}
48. Qxc8+ {-0.27/15 4} Rxc8 {+1.76/11 1} 49. Rxc8 {-0.44/14 7}
b4 {+0.69/11 7} 50. Rc1 {-0.42/13 9} Nb6 {+0.57/11 5} 51. Ke2 {-0.37/13 4}
b3 {+1.04/10 1} 52. Rgg1 {+0.05/13 7} Nb5 {+0.54/10 0} 53. Rc8 {-0.06/12 6}
b2 {+0.18/10 2} 54. Rc2 {+0.14/13 6} Nb6 {+0.16/11 6} 55. Rxb2 {+0.14/13 8}
Kb8 {-0.97/11 2} 56. Rc2 {+0.79/12 4} Kd7 {-1.72/11 2} 57. Rc8 {+3.08/12 3}
a5 {-1.20/10 8} 58. Rg3 {+4.11/12 4} a4 {-1.26/11 0} 59. Rh8 {+4.21/13 2}
a3 {-0.74/11 4} 60. Kc1 {+4.36/14 3} Na5 {-1.32/11 7} 61. Ng4 {+4.83/14 3}
Qxg3 {-5.87/11 6} 62. Nxg3 {+5.65/15 9} Nb4 {-6.24/10 7} 63.
Rh7 {+7.65/15 4} Kb8 {-9.78/11 9} 64. Rxg7 {+8.55/15 8} Nc3 {-10.78/10 6}
65. Rc7 {+8.60/14 0} Ka6 {-12.20/10 0} 66. Rxc3 {+79.93/15 0}
dxc3 {-99.86/12 1} 67. g7 {+79.94/20 9} a2 {-99.88/10 9} 68.
Kxa2 {+79.95/28 0} c2 {-99.92/9 0} 69. g8=Q {+79.96/28 1} c1=Q {-99.92/6 0}
70. Kxc1 {+79.97/28 0} Kc5 {-99.96/5 0} 71. Qb8 {+79.98/28 0}
Kd7 {-99.98/3 0} 72. Qd6# {+79.99/28 0}
{White mates} 1-0
[d]2nr3r/pp1b1ppp/2kk4/1K2pP2/P1PpP1Pq/3P1K1P/3QB3/2NR3R w - - 3 21
(Kings represent Commoners, the Knight is thr Royal piece!)

From the position in the diagram, Fairy-Max tries to trap CCCP's Queen with 21. g5. Black does not see the danger, and tightens its own noose by playing 21. ..., h5. Fairy-Max'score jumps to +0.73 as it sees an opportunity to get a Pawn on the 6th rank. This is a poor-man's evaluation trick that makes up for Fairy-Max'/micro-Max' inability to recognize passers: Pawns on 6th rank count for 1.8, and on 7th rank even for 2.6. Like in this case, a 6th-rank Pawn is not always a passer, but it turns out that even when it isn't, it is usually a thorn in the flesh of the opponent, and often decisive anyway.

After an interjected threat against the black King fortress, to which black has to react, white finally gets its way by playing 25. g6. This traps the black Queen indefinitely, as is most obviously seen after move 33:

[d]2n1r3/pprb2p1/5pP1/PkP1pP1p/3pP2q/Q2P1K1P/2R5/2NB2R1 w - - 11 34
The Commoner on f3 (depicted as King, but not royal) neutralizes the black Queen

The Commoner on f3 covers almost all squares the Queen has access to. Note that a Commoner is not royal, and worth less than a Knight in normal Chess, so after Qf4, white simply wins the Queen for its Commoner by Mf3xf4. The Rook covers the remaining squares (g5 and e1). White doesn't even have to defend its h-Pawn, as it is heavily poisoned: after Qxh3 white play Mg3!, 'reverse checkmating' the Queen with its Commoner! The R+M, together worth only 7.5 Pawn, thus totally neutralize the Queen, leaving black with a losing disadvantage on the board elsewhere.

This is indeed what happens: white gives its own Queen for two Rooks, to create a local advantage of a Rook against a Commoner. Eventually that Rook makes a detour to h8, to pin black's h-Pawn, so that 64. Mg4! can make the decisive attack on the Queen, which then can at most destroy a Rook in compensation:

[d]7R/3n2p1/5pP1/k3pP1p/3pP2q/p2P1KRP/8/2N5 w - - 2 61
61. Mf3-g4! wins the back Queen

After that, the white remaining Rook simply eliminates g7, so that g6 can prove itse value by quickly promoting, and performing a solo-checkmate on the black Royal Knight.

[d]8/3n4/3Q1p2/4pP1p/4P3/3P2KP/8/2N5 b - - 4 72
Checkmate for the Royal Knight!
User avatar
hgm
Posts: 28468
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: The Knightmate Challenge!

Post by hgm »

Two games later, this interesting end-game situation occured:
[d]8/p1KP4/4n3/1P6/1P1r4/7N/8/8 w - - 1 75
75. d4=Q+! wins

The white Commoner covers the promotion square, which is defended by the Royal Knight and the Rook (x-ray fashion). Nevertheless white promotes, as after 75. d4=Q+, Rxd4 76. Mxd4 black cannot take the Commoner with its Royal Knight (76. ..., Uxd4) because of 77. Ug5!

[d]3n4/p7/8/1P4N1/1P6/8/8/8 b - - 1 77
Black is in zugzwang

Black must move, and the only legal move for its Royal Knight goes to b7. But after 77. ..., Ub7 78. Uf7! (a Knight's opposition!) the black Royal Knight has no moves, and black has to move its Pawn, which leaves him checkmated on the next move (78. ..., a6 79. bxa6#, or even with an e.p. capture). After 77. ..., a5/6 78. bxa6 the connected passers win easily as well.
User avatar
George Tsavdaris
Posts: 1627
Joined: Thu Mar 09, 2006 12:35 pm

Re: The Knightmate Challenge!

Post by George Tsavdaris »

A nice game indeed!
If there weren't any Pawns, is NKN winnable or it depends on the position?
Or it's always draw? (K=King, Commoner as you call it)

I guess by saying "75. d4=Q+, Rxd4 76. Mxd4 " that was a typo and you meant 75. d8=Q+, Rxd8 76. Mxd8 etc, right?


Where i can find these Joker and Fairy-Max editions that can play this game and also how(what do i have to put in Winboard.ini parameters for each engine) i can make them play it?

Also when do you think you will have ready the final Winboard_F (along with its source code that i guess you will also provide)?
After his son's birth they've asked him:
"Is it a boy or girl?"
YES! He replied.....
User avatar
hgm
Posts: 28468
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: The Knightmate Challenge!

Post by hgm »

Oops, yes, I meant d8. :oops: How the heck did I make that d4? No promotions in the middle of the board, not even in Knightmate. :lol:

JokerNM is currently downloadable through the direct link

http://home.hccnet.nl/h.g.muller/jokerKM.exe

I have not decided yet if I am going to keep it on my website in a more structured way, and if so, how. This all started as a joke, but it is more fun than I expected.

I just uploaded the Fairy-Max I am running now to my website. The engine itself is not changed, but Denis Mendoza provided me with a faster compile, which I am using, but had not put on my website, so far. The important change is in the fmax.ini, where knightmate was predefined, but in a now obsolete format. I changed that such that the current Fairy-Max version can understand it. (Basically by putting Game: knightmate above it, and giving all the piece values in centi-Pawn.) So downloading these two from my regular downloadpage should do it.

Start WinBoard_F with the command-line options

/variant=knightmate
/pieceToCharTable="P.BRQ...N.KYp.brq...n.ky""

The latter is only importantfor getting N in stead of M for the Commoner, and K in stead of U for th Unicorn, in PGN and FEN.
User avatar
hgm
Posts: 28468
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: The Knightmate Challenge!

Post by hgm »

George Tsavdaris wrote:If there weren't any Pawns, is NKN winnable or it depends on the position?
Or it's always draw? (K=King, Commoner as you call it)
Oh, sorry. Forgot to answer this one. :oops:

I did build some tablebases last weekend (not that my engines use them, but just out of curiosity).

NkN is draw
NbN is draw
NrN is draw
NqN is won (even QN would be won, the Queen does the job single-handedly)

NkkN is won
NbkN is won
NbbN is won (if the Bishops are of unlike color)
NrbN is won
NrrN is won

NqNkk is won
NqNbk is won
NqNbb is won (like as well as unlike Bishops)
NqNrk is mostly won (93% wtm, 35% btm)
NqNrb is mostly won (93% wtm, 35% btm)
NqNrr can go either way (10% won for RR, 15% for Q if opponent has the move)

Interpreting the stats is subtle: for a totally won end-game, the btm win rate is usually only 50%. The rest are positions where black can capture a white hanging piece, and after that it is usually not won for white anymore. Even if it is 99.7% won with wtm, if you survive the first black move.