chessjoker

Discussion of chess software programming and technical issues.

Moderator: Ras

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

Re: chessjoker

Post by hgm »

Pippo wrote:A bug (two times) with JBKvRBK: "forfeit due to invalide mode" after a simple chech by R.:?:
Do you till have those games, and can you post them here?

I noticed there sometimes was a problem when setting up positions when using 'Paste Position' in WinBoard. I fixed that now, but I did not post the fixed binary yet.

My guess is that the Joker sort of adapts to the value of the opponent pieces. When playing against Rooks, it would move most of the time as a Rook, so it makes sense that its value approaches that of a Rook. But Fairy-Max is designed with fixed values for the pieces. I think that under those conditions it would be safest to value Joker slightly above a minor.

But of course this can be tested. Note that you can easily change the value of the Joker yourself, in the fmax.ini file with game definitions. Near the end, in the definition that starts with "Game: joker", the last piece definition starts with

j:333 ...

and the 333 is the value in centi-Pawn (it uses P=74 and R=444). Change that number and you have a version that uses another value for the Joker. You could copy jmax.exe and fmax.ini to another folder, change the Joker value ther, install this copy in XBoard with a nickname of your choice (like J500 when you set the Joker value to 500), and then plays the original jmax.exe as first engine against J500 as second engine in a Machine Match' of a few hundred games (like 1 min/40 moves) to see which Joker value does better. You would need several hundred games to get meaning ful statistics, though; the result of just a handful of games would not mean much.

If Fairy-Max is too strong for you to beat, you can dumb it down a bit by specifying a 'time odds' in the Time Control dialog: when you put 10 for the first engine, and set the TC to (say) 40 moves/30 min, it means you get 30 min, but Fairy-Max gets only 3 min. (Of course you could also set a very short TC, and switch off Auto Flag, so that you can think as long as you want.)
Pippo
Posts: 50
Joined: Tue Mar 04, 2014 6:40 pm
Location: Murcia España

Re: chessjoker

Post by Pippo »

Ok, Harm, Thank you for your# WinBoard game file -- Fri Mar 21

About the bug, don't worry: very probably is relating to the initial check:

# WinBoard game file -- Fri Mar 21 21:50:40 2014
Fairy-Max 4.8joker vs. Fairy-Max 4.8joker

[--------------
K B J . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . b
. . . . . . . . r
. . . . . . . . k
white to play
--------------]
1. Ka7+ Kh1
2. Jd7 Rb2
3. Be5 Rg2
4. Jd5 Ki2
0-1 (Xboard: Forfeit due to invalid move: a8b7 (a8b7 via `0) res=24)

I was hurry and really did not want to put a initial check! So the bug is irrelevant.
I have repeated the game: a draw. Here is:

Fairy-Max 4.8joker vs. Fairy-Max 4.8joker

[--------------
K . B . . . . . .
. . . . . . . . .
J . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . r
. . . . . . . . .
. . . . . . b k .
white to play
--------------]
1. Be6 Rg3
2. Jc6+ Rg7
3. Bd5+ Kh2
4. Jd6+ Kh3
5. Be6+ Kh4
6. Je5 Ra7+
7. Kb8 Kg5
8. Kc8 Be3
9. Kd8 Bf4
10. Jd4 Kf6
11. Bd5+ Kf5
12. Be4+ Ke6
13. Ke8+ Kf6
14. Kf8+ Re7
15. Bd5+ Be5
16. Jc5 Rh7
17. Ke8 Kf5
18. Jc4 Rh6
19. Ke7 Ra6
20. Bc6 Rb6
21. Bd5 Ri6
22. Je4+ Ri7+
23. Ke8+ Rc7
24. Je3+ Rc5
25. Jf3 Bf4
26. Be4+ Ke6
27. Bd5+ Kxd5
28. Jxf4+ Rc7
29. Jf5 Kd4
30. Jf4 Kd5
31. Jf5 Kd6
32. Je4+ Rg7
33. Kf8+ Rh7
34. Ke8+ Ke6
35. Kf8 Kf6
36. Jf4 Kg6
37. Jg4 Kh6
38. Jf5+ Kh5
39. Kg8 Kh6
40. Kf8+ Ri7
41. Ke8+ Kh5
42. Kf8 Kh4
43. Jf4 Kh3
44. Ke8+ Kg2
45. Jg4 Kf2
46. Jf4 Ke2
47. Je4 Kd2
48. Jd4 Kc2
49. Kf8+ Rh7
50. Ke8+ Kd2
51. Je4+ Ke2
52. Kf8 Kf2
53. Jf4 Kg2
54. Jg4 Kh2
55. Jf3+ Ra7
56. Ke8+ Kh3
57. Kf8 Kh4
58. Jf4 Kh5
59. Jf5 Kh6
60. Ke8+ Rb7
61. Kd8+ Kg7
62. Ke8+ Kh7
63. Jg5+ Rc7
64. Kf8+ Ra7
65. Jf5+ Ki6
66. Jg6 Ki7
67. Ke8+ Kh8
68. Jf5 Kh7
69. Kf8+ Rb7
70. Jd5 Rg7
71. Jf5+ Ra7
72. Jg5+ Ki7
73. Jf5 Rc7
74. Jd5 Kh7
75. Je5 Kh8
76. Je6 Rb7
77. Jc6 Rh7
78. Jf6+
1/2-1/2 (Draw by fifty move rule) hints!

Thank you again, P.
[/list]
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: chessjoker

Post by hgm »

Note that testing piece values by playing games without Pawns has a very low resolution, as these are almost always draw. In orthodox Chess, for instance, K+R vs K+B or K+R vs K+N are virtually always draws, but you cannot conclude from that that a Rook is equally strong as a Knight. K+Q vs K+B+N is draw when the B+N can reach the fortress position, (Ka1, Bb2, Nd4), K+N+N vs K+B is a dead draw, K+R+B vs K+R is draw, etc. So differences upto and including a full minor usually go completely undetected.

The value of Chess pieces in practice is determined by how efficiently they can support or fight Pawns, as almost all end-games do have two or more Pawns per side (e.g. leftovers from the King fortress). Lose your last pawn, and you suddenly need about double the advantage to win.
Pippo
Posts: 50
Joined: Tue Mar 04, 2014 6:40 pm
Location: Murcia España

Re: chessjoker

Post by Pippo »

Thanks for your appreciated lesson!

You see I am not so good in chess, unfortunately :oops: . However, I did not make too many illusions about my tests without pawns. It is just a begin and normally I am cautious in making conclusions.

A thing is undoubt: it needs to be done many, many tests. I will follow your hints.

A little thing: at next (possible) improvement, could you substitute easily the joker icon with a classic figure of a jester? You know: the eye wants its part :)
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: chessjoker

Post by hgm »

Pippo wrote:A little thing: at next (possible) improvement, could you substitute easily the joker icon with a classic figure of a jester? You know: the eye wants its part :)
Actually you should be able to do that yourself quite easily: WinBoard allows the user to provide his own piece graphics. Just create a folder in which you have image files a49o.bmp (for the white 'outline' piece), a49s.bmp (for the black 'solid' piece) and a49w (for a black silhouette to provide a background). Assuming you are using board size 'middling' (49x49). 'a' is the one-letter code for the piece I use as Joker now.

You then specify that folder as piece-image directory in the View->Themes dialog.
Pippo
Posts: 50
Joined: Tue Mar 04, 2014 6:40 pm
Location: Murcia España

Re: chessjoker

Post by Pippo »

Ehi, guys!
Yes, I am talking just about you that are reading these posts!
Why don'y help us to test and improve this new game? It is very funny!
Pippo
Posts: 50
Joined: Tue Mar 04, 2014 6:40 pm
Location: Murcia España

Re: chessjoker

Post by Pippo »

Hello Harm

I have discovered a bug:

# WinBoard game file -- Fri Mar 28 20:35:03 2014
pc vs. Fairy-Max 4.8joker

[--------------
r n b q k b j n r
p p p p p p p p p
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
P P P P P P P P P
R N B Q K B J N R
white to play
--------------]
1. Ng3 Ng6
2. Jh3 d5
3. e3 i6
4. Bb5+ c6
5. Ba4 Nh4
6. O-O g5
7. i3 g4
8. ixh4 gxh3
9. gxh3 Bxh3
10. Nc3 Nd7
11. d4 Jg6 [this is the illegal]
12. Qf3
* (Game aborted)

The joker could not do the 11º movement: when imitates a P, always should move one step forward. However, program cracks alone, but after other two movement!

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

Re: chessjoker

Post by hgm »

Arghh, you are right. The Joker patch just uses the move-descriptor list of the Pawn for the Joker when the latter imitates a Pawn. But this list also contains the double-push, as a conditional move for pieces that have not moved yet. And in this game the Joker has not moved yet.

I guess I should slightly change the code. Currently it has to do something special anyway when the Joker imitates Pawns, as after moving a white Pawn the Joker should imitate a black Pawn. And these are different piece types in Fairy-Max. So when the piece type <= 2, it has to swap 1 and 2 (by using 3 - pieceType). In stead I jould make it use pieceType + 7, so that it uses 8 and 9, where in the game definition piece type 8 would have the moves of a black Pawn, and 9 that of a white Pawn (but both without doeble step).

An alternative method would be to mark the Joker as non-virgin in the initial setup. I guess this could be done even without changing the code, by just editing the fmax.ini file. In the definition for "Game: joker" there are two lines that specify the initial setup of the white and black back-rank pieces. The look like

6 4 5 7 3 5 15 4 6

where 15 represents the Joker. Try changing the 15 (on both lines) by 47. This would then define a Joker that has already moved (as moving a piece sets the '32' bit).

I will let you know when I uploaded a fixed version.
Pippo
Posts: 50
Joined: Tue Mar 04, 2014 6:40 pm
Location: Murcia España

Re: chessjoker

Post by Pippo »

Thanks Harm!

<<An alternative method would be to mark the Joker as non-virgin in the initial setup....In the definition for "Game: joker" there are two lines that specify the initial setup of the white and black back-rank pieces. The look like

6 4 5 7 3 5 15 4 6

where 15 represents the Joker. Try changing the 15 (on both lines) by 47.>>

I have tried in this way but... doesn't work at all! When you set "joker" in "new variant" option, it results a board with only 6 black pieces!! :?

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

Re: chessjoker

Post by hgm »

OK, so it seems the code to send the initial position to the GUI cannot handle non-virgin pieces in the initial setup. Too bad. So a code change is required anyway. I will make it tomorrow.