hgm wrote: ↑Sun Dec 18, 2022 12:09 pm
I uploaded a new version of WinBoard to http://hgm.nubati.net/Duck2.zip . This fixes a problem with reading castlings in PGN.
I am currently working on making my web applet act as a demo for Duck Chess. This 'Interactive Diagram' can be configured for a very wide range of chess variants. But of course Duck Chess is quite a bit different than the typical chess variant, because of the double moving (FIDE + Duck), and the different search (or extreme branchin ratio with a normal search). So I needed to overrule a few routines of the JavaScript that normally powers the Diagram, by embeddinging adapted versions in the HTML page https://www.chessvariants.com/invention/duckchess .
Since the design goal of the Interactive Diagram is to provide an entertaining opponent that is beatable by a beginner that just got acquainted with the rules, it is not so bad if it occasionally misses the best move. This made it possible to simplify the search quite a lot. I started adapting the alphabeta search routine for playing Refusal Chess. In this variant each player can veto one opponent move for the next turn, and in optimal play he would of course always veto the best move. So the score that AlphaBeta() returns for the node is that of the second-best move rather that that of the best, and a beta cutoff happens when that second-best score exceeds beta.
In Duck Chess the vetoing of moves must be done through Duck placement. With clever placement you could veto a number of moves, but an even more important difference with Refusal Chess is that some moves (namely contact captures) cannot be vetoed at all. So rather than indiscriminately ignoring the best move, you have to test whether that can be vetoed. And only when it can you have to base the score of the node on an inferior alternative (the 'backup move'). But that alternative doesn't have to be the second-best move, because the Duck could have blocked that too. This is pretty obvious in case of a distant slider moves: all such moves in the same direction can be blocked at once by placing the Duck on the first square of the slide.
The simplification I made is that the AI only considers blocking the best move on the first square. In theory blocking on a more-distant square could be better, if the second-best move leaps onto that square, or happens to cross the path of the best move there. This is not very likely, and would hardly ever happen. So what I do for finding the 'backup move' is discard any moves that have the same blocking square as the best move (these can only increase the best score). If a new best move is unblockable it increases both the best and the backup score, so that the node can always return the backup score.
Currently I have not implemented the rule that you must move the Duck. (Although for the user this rule is implicitly enforced at game level, as it is moving the Duck that sets the AI thinking on a reply.) Under the approximation of only considering blocking adjacent to the piece, this is reasonably simple to implement, though. Apart from a score (that of the backup move), each node also returns the square where the best move must be blocked in order to not get a higher score (if there is such a square). The move leading to the node must then place the Duck there afterwards. If that best move could only be blocked on a single square (i.e. a 1-step non-capture or a 2-step capture), it becomes a 'reservable move': you might not be able to put the Duck on that single blocking square, because the opponent already put the Duck there one turn earlier, thus 'reserving' the move. In that case Search() would also return the score of the best reservable move if that is better than the score of the backup move. After negamaxing the parent would then see a lower score, to be used when the Duck must be moved away from the square where it would have to be to get the best score.
The Duck can then be used in two ways in order to improve the score of a move: you either block the best reply outright, or you reserve a refutation to it that would otherwise get blocked, in order to lower its score. The latter would only be useful if it would push the score down at least as much as that of the backup move, otherwise it would be better to just block the best reply. If you can block it, that is. If you cannot, then lowering this score by using the Duck to reserve a refutation is your only option. Of course the reserved refutation could also help lowering the score of other moves in the reply node, in particular that of the backup move, as it is quite common that many moves have the same refutation. You are only interested in reserving refutations of the opponent's best reply.
The Duck Can Insure You Can Play A Move
Let's say white wants to play Pg3 and Bg2. Pg3 is played and the duck is placed on g2.
The Duck Can Insure The Opponent Has To Move His King
Say a queen lands safely two squares from the enemy king. The duck is placed on the intervening square.
There are a number of other specialized quacktics. I suggest watching on YouTube Eric Rosen's videos on Duck Chess.
hgm wrote: ↑Wed Jan 04, 2023 10:35 pm
I am currently working....
that's a nice applet fror starters.
from a programmer's point of view, the slider can be related to opponent pieces in 3 ways: it can be close, 2 square distant or 3 or more squares away.
if it's 2 squares, the empty square in between can be used for either defending or attacking (several times a Queen moves 2 diagonals from opponent Bishop and place the Duck in the middle, forcing the minor piece to escape).
another bonus should be given when attacking two far pieces at a time, or defending a piece by 2 different sliders freeing the overloaded duck.
also trapping Bishops is very easy at the beginning... I did hundred of times against newcomers, engine must keep track of 2 available escape routes.
there are huge number of combinations and transpositions, since pruning has to be extensive it is imperative to evaluate the position correctly more than speed imho.
Sure, moves can be classified as unblockable, reservable (1 blocking square) or blockable (more than one blocking square). The move generator of the diagram's AI already makes that classification. I am currently working on implementing move reservation in search. Within the limitation of the demo (blocking only on adjacent squares) this requires Search() to keep track of 3 scores: the score for when the Duck is not doing anythin useful, (which is the highest one), the score when the Duck is blocking the best move (set equal to the best score when the move is unblockable), and the score when the Duck is reserving the refutation of the best move (set to the best score when that refutation is not reservable). The latter two are for specific Duck locations, which must also be remembered, and the location needed for reservation must be returned from the daughter node.
Each time a new best move is found, the blocking and reserving squares are set to the values belonging to that move, and the corresponding scores must be derived from the old score for these Duck locations. (Which usually will be the best score, but sometimes the useful Duck locations stay as they were, and then must be derived from their previous value.) Eventually the lowest two scores of these three will be returned, one for the Duck location that reserved the best move, the other for all other Duck locations.
MTaktikos wrote: ↑Fri Dec 09, 2022 6:59 pm
I have to thank a lot for your contribution.
In the meantime, also the original FSF drop branch should have some improved winboard compatibility, but
for my PC system, only your changes have produced full Winboard compatibility.
Have uploaded the code with your changes here: https://github.com/mtaktikos/Fairy-Stoc ... compatible
A Windows avx2 compile can be downloaded here: https://filehorst.de/d/eolwDxdl
The embedded NNUE is for now the normal chess NNUE
I wonder if FSFduck will have a NNUE net that is trained for duck chess, in the future.
I think you can help to make this process much faster
Have trained two dedicated Duck NNUEs (can be downloaded in https://filehorst.de/d/ekzkkltp) with help of the datagenerator in https://github.com/fairy-stockfish/vari ... /tree/duck
but this datagenerator/NNUEs produce also incompatible moves, rejected by Winboard as illegal.
The above FSF datagenerator has in it's most parts the same structure as the FSF engine. May I ask you to try to apply to this datagenerator the same changes as you have successfully done to the engine?
I downloaded the Windows EXE for Fairy StockFish and set it up locally using the newest Winboard build. I played against it, but the results are not great - it seems very slow, and runs out of time in a five minute chess game. I hope you can give me some guidance:
1. How do I change the NNUEs for duck chess?
2. What type of options can I add to the INI file to make it play better / faster?
Retired actuary and software developer. I love chess, coffee, wine and food
I downloaded the Windows EXE for Fairy StockFish and set it up locally using the newest Winboard build. I played against it, but the results are not great - it seems very slow, and runs out of time in a five minute chess game. I hope you can give me some guidance:
1. How do I change the NNUEs for duck chess?
2. What type of options can I add to the INI file to make it play better / faster?
@ question 1:
Currently we (Belzedar and me) have trained only one net stronger than the best chess NNUE and don't plan to release it soon, instead we make RL to produce (hopefully) some stronger versions. The progress is slow.
So atm the best for users is to take the renaimed chess net that is so far most perfomant for duck, duck-8a08400ed089.nnue
In Winboard you can activate it by writing in winboard.ini in the sections of first- and second engine, the following:
where FSFDuck.exe is the name of your FSF duck engine and FSFDuck is the name of the folder that contains it.
@ question 2:
Don't know if you have already done it: I recommend, after start of Winboard to go to menu Engine/Common Settings and set the max number of CPUs and RAM in MB. And after you have set them, don't forget to go to menu Options/Save Settings now,
else in the next start of Winboard the settings you made will be forgotten.
Have made for you a ready-to-play suite, an avx2 compile of FSFDuck embedded in Winboard. It is made for a machine with 24 threads, but the settings are made quite save, Max nr of CPUs is set only to 20.
Here you can download it:
BTW from now on, further tests of duck engines have to be done by others than me. As mentioned, I am too deep involved in the FSF Duck progress, and cannot longer serve as a neutral tester
My mistake - very unlikely that Fairy-Max will ever run out of time.
But I have noticed an annoying pattern. In every game that Fairy-Max plays against DuckSlayer or TJchess Duck, the game stops due to an "illegal move".
But the move is NOT illegal. Sometimes the move is made by Fairy-Max, but that is not consistent.