Harm,
<<I must admit I did not quite understand your remark on resetting the imitation value. Which problem is this addressing? Formulation of the existing rules? Or does it alter the rules compared to how they were described previously (like not allowing to move Joker after Joker)?>>
It is just to code correctly the rules of the variant. And therefore the REALITY of the game.
For example: do you remember the problem J-B looking at enemy K, with P in meddle? Question was if it is correct to move the P forward. The answer is "yes": but, just now, your program knows that? If you reset imitation value of joker, that is done!
So I was hoping that it also could help to improve the algoritm...
chessjoker
Moderator: Ras
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: chessjoker
OK, I see. But the problem of the current algorithm is not that it uses wrong imitation value of the opponent Joker during the move. It does not use that imitation value during the move at all, and only starts considering it when it is again the opponent's turn. (And by then it has already changed a second time, due to its own move.)
So moving the 'virtually pinned' Pawn is already allowed: it moves the Pawn, and then in the following move tries if a J-P can capture the King (which it cannot). But when castling this means that it castles first, completely ignoring all pieces (including Jokers) that might have been attacking d1 or c1, and then during the opponent's turn that follows checks if it can capture to c1 or d1, imagining a virtual King there. And for that it would then use a J-K, because the previous move was castling. So Jokers only inhibit castling if they attack these squares through King moves.
So moving the 'virtually pinned' Pawn is already allowed: it moves the Pawn, and then in the following move tries if a J-P can capture the King (which it cannot). But when castling this means that it castles first, completely ignoring all pieces (including Jokers) that might have been attacking d1 or c1, and then during the opponent's turn that follows checks if it can capture to c1 or d1, imagining a virtual King there. And for that it would then use a J-K, because the previous move was castling. So Jokers only inhibit castling if they attack these squares through King moves.
-
- Posts: 50
- Joined: Tue Mar 04, 2014 6:40 pm
- Location: Murcia España
Re: chessjoker
Ok. So, no problem.hgm wrote:OK, I see. But the problem of the current algorithm is not that it uses wrong imitation value of the opponent Joker during the move. It does not use that imitation value during the move at all, and only starts considering it when it is again the opponent's turn. (And by then it has already changed a second time, due to its own move.)
So moving the 'virtually pinned' Pawn is already allowed: it moves the Pawn, and then in the following move tries if a J-P can capture the King (which it cannot).
But this problem it is very easy to solve (however it is not important because so rare...)hgm wrote: But when castling this means that it castles first, completely ignoring all pieces (including Jokers) that might have been attacking d1 or c1, and then during the opponent's turn that follows checks if it can capture to c1 or d1, imagining a virtual King there. And for that it would then use a J-K, because the previous move was castling. So Jokers only inhibit castling if they attack these squares through King moves.
So the main problem, it seems, is about use of a "null movement" strategy, so important for engines (and humans too!). About this topic, I find very good your previous general considerations about how to filter all possible joker's imitations. Anyway, I suspect that it will implies, in general, a very hard work for the machine. Probably that will implies a (strong) limitation in deep game prevision.
However, it seems you already have did a good, good job!
I had no time to test well your solution, but by now I will do and I will say..
Please advice me if you introduce updates.
Arrisentirci, Pippo
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: chessjoker
I uploaded a new version to http://hgm.nubati.net/jokermax.zip .
This differs from the previous one by assuming there is a threat if the Joker can do a King move that is dangerous, as discussed. I expect this should make it stronger. I did not test this however. (I have already overwritten the old one...)
There was a problem if the threat was a check (i.e. Joker next to King), because Fairy-Max extends one ply for each check, and you can get in a position where both Kings stand next to an enemy Joker, and this then would extend forever, crashing the engine. So I made it such that a 'virtual check' by a J-K will not lead to an extension, but will be counted as as a check when determining if it is stalemate. So this version now can force mate in KJK. I did test that, by setting up a KJK position and lat it play out in Two Machines mode, at 40 moves/min.
The most serious problem left is probably that it cannot under-promote. Like you mentioned, under-promotion is far more important here than in normal Chess, where you can safely ignore it.
This differs from the previous one by assuming there is a threat if the Joker can do a King move that is dangerous, as discussed. I expect this should make it stronger. I did not test this however. (I have already overwritten the old one...)
There was a problem if the threat was a check (i.e. Joker next to King), because Fairy-Max extends one ply for each check, and you can get in a position where both Kings stand next to an enemy Joker, and this then would extend forever, crashing the engine. So I made it such that a 'virtual check' by a J-K will not lead to an extension, but will be counted as as a check when determining if it is stalemate. So this version now can force mate in KJK. I did test that, by setting up a KJK position and lat it play out in Two Machines mode, at 40 moves/min.
The most serious problem left is probably that it cannot under-promote. Like you mentioned, under-promotion is far more important here than in normal Chess, where you can safely ignore it.
-
- Posts: 50
- Joined: Tue Mar 04, 2014 6:40 pm
- Location: Murcia España
Re: chessjoker
Do you mean that you have set the enemy J as a J-K after a null movement? Ok, it is better than nothing...hgm wrote:I uploaded a new version to http://hgm.nubati.net/jokermax.zip .
This differs from the previous one by assuming there is a threat if the Joker can do a King move that is dangerous, as discussed. I expect this should make it stronger. I did not test this however. (I have already overwritten the old one...)
so that this kind of stalemate will become now a checkmate, it isn't?hgm wrote: There was a problem if the threat was a check (i.e. Joker next to King), because Fairy-Max extends one ply for each check, and you can get in a position where both Kings stand next to an enemy Joker, and this then would extend forever, crashing the engine. So I made it such that a 'virtual check' by a J-K will not lead to an extension, but will be counted as as a check when determining if it is stalemate
I'm agree. Anyway, by now, it remains a secondary problem (at least for humans): probably you have to be a good player to get those situations.hgm wrote:So this version now can force mate in KJK. I did test that, by setting up a KJK position and lat it play out in Two Machines mode, at 40 moves/min.
The most serious problem left is probably that it cannot under-promote. Like you mentioned, under-promotion is far more important here than in normal Chess, where you can safely ignore it.

-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: chessjoker
Indeed, right on both counts. This is sort of a course approximation, but you should realize that almost all of Fairy-Max is a course approximation, as the AI consists of only ~150 short lines of computer code. The case where it now would err in the opposite direction is when the Joker steps next to a King while imitating a piece that would not attack the King (say as J-N). In that case Fairy-Max would now unjustly think there is a check, and thus that it is a checkmate, rather than a stalemate. But this implies there must be another piece than King, which cannot be legally moved, as after moving it the Joker would get that imitation value, and thus not check. This would be quite rare. Stalemates where the stalemated side has more than King + Pawns hardly ever occur in practice.Pippo wrote:Do you mean that you have set the enemy J as a J-K after a null movement? Ok, it is better than nothing...
so that this kind of stalemate will become now a checkmate, it isn't?
The problem is that in Fairy-Max' design the null move for figuring out if it is currently in check when there are no legal moves is also used for determining if there are threats that require continuing the search of the current line. For the mate determination the correct thing to do is to let the Joker keep its last imitation value. (This is how you constructed the rules.) But for the threat determination, which has a huge impact on the quality of play, I am afraid this would cause a quite detrimental amount of paranoia. Because after an opponent Queen move plus my null move the Joker would be imagined to move as a Queen, making lots of virtual threats, why in practice it is very likely I will move a less-powerful piece. Giving the Joker the King moves seems a reasonable compromise: if it can do something unacceptable with a King move, it would paralyze not only my King, but also the Queen, either Rooks or Bishops, and likely even my Pawns (as threats will in general aim forward). So the chances that I am indeed in trouble, with so little choice of pieces to move, are far from imaginary, and it should pay on average to do deeper search of that line to verify that I can get out of it.
-
- Posts: 50
- Joined: Tue Mar 04, 2014 6:40 pm
- Location: Murcia España
Re: chessjoker
Righthgm wrote:Indeed, right on both counts. This is sort of a course approximation, but you should realize that almost all of Fairy-Max is a course approximation, as the AI consists of only ~150 short lines of computer code. The case where it now would err in the opposite direction is when the Joker steps next to a King while imitating a piece that would not attack the King (say as J-N). In that case Fairy-Max would now unjustly think there is a check, and thus that it is a checkmate, rather than a stalemate. But this implies there must be another piece than King, which cannot be legally moved, as after moving it the Joker would get that imitation value, and thus not check. This would be quite rare. Stalemates where the stalemated side has more than King + Pawns hardly ever occur in practice.Pippo wrote:Do you mean that you have set the enemy J as a J-K after a null movement? Ok, it is better than nothing...
so that this kind of stalemate will become now a checkmate, it isn't?

Of coursehgm wrote: The problem is that in Fairy-Max' design the null move for figuring out if it is currently in check when there are no legal moves is also used for determining if there are threats that require continuing the search of the current line. For the mate determination the correct thing to do is to let the Joker keep its last imitation value. (This is how you constructed the rules.) But for the threat determination, which has a huge impact on the quality of play, I am afraid this would cause a quite detrimental amount of paranoia. Because after an opponent Queen move plus my null move the Joker would be imagined to move as a Queen, making lots of virtual threats, why in practice it is very likely I will move a less-powerful piece.
hgm wrote: Giving the Joker the King moves seems a reasonable compromise: if it can do something unacceptable with a King move, it would paralyze not only my King, but also the Queen, either Rooks or Bishops, and likely even my Pawns (as threats will in general aim forward). So the chances that I am indeed in trouble, with so little choice of pieces to move, are far from imaginary, and it should pay on average to do deeper search of that line to verify that I can get out of it.

Well, I'll try to test the game (time permitting) so after tell you my impressions..
Ciao e grazie! P.
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: chessjoker
Well, let me know if it does anything weird / wrong / inexpliquable. Preferably save all the games automatically (you can control that in the Options ->Save Game dialog) so that the games would even be saved if Fairy-Max should crash.
In normal Chess Fairy-Max is a tough opponent, but certainly not unbeatable for a good club player. So it certainly should not blunder away material.
In normal Chess Fairy-Max is a tough opponent, but certainly not unbeatable for a good club player. So it certainly should not blunder away material.
-
- Posts: 50
- Joined: Tue Mar 04, 2014 6:40 pm
- Location: Murcia España
Re: chessjoker
OKhgm wrote:Well, let me know if it does anything weird / wrong / inexpliquable. Preferably save all the games automatically (you can control that in the Options ->Save Game dialog) so that the games would even be saved if Fairy-Max should crash.
In normal Chess Fairy-Max is a tough opponent, but certainly not unbeatable for a good club player. So it certainly should not blunder away material.
-
- Posts: 50
- Joined: Tue Mar 04, 2014 6:40 pm
- Location: Murcia España
Re: chessjoker
Hi Harm!
I did some test about ending games, always without pawns.
I tried JJKvNNK (1-0), JJKvRRK (draw, two times), JNKvRNK (draw), JRNKvRRNK (draw).
So I suspect J near to R in value...
A bug (two times) with JBKvRBK: "forfeit due to invalide mode" after a simple chech by R.
In a normal game I, naturally, lost (no surprise, I am a normal player), however Fairy seems play good with his joker.
Ciao, P.
I did some test about ending games, always without pawns.
I tried JJKvNNK (1-0), JJKvRRK (draw, two times), JNKvRNK (draw), JRNKvRRNK (draw).
So I suspect J near to R in value...
A bug (two times) with JBKvRBK: "forfeit due to invalide mode" after a simple chech by R.

In a normal game I, naturally, lost (no surprise, I am a normal player), however Fairy seems play good with his joker.
Ciao, P.