Chess changes: en passant and not suggesting illiegal moves
Johnny Jazeix
jazeix at gmail.com
Fri Jun 5 20:48:27 BST 2020
Hi Tyson,
thank you for your explanation. We are using the engine of p4wn
(https://github.com/douglasbagnall/p4wn) to power the chess activity.
There were already a few bug they fixed for "en passant":
https://github.com/douglasbagnall/p4wn/issues?q=is%3Aissue+is%3Aclosed
but maybe that did not handle all the cases.
If you have knowledge, for sure these improvements are welcome!
If you can reproduce the bugs in http://p4wn.sourceforge.net/, then it
would be better if this can be fixed upstream (proposing a pull
request) and we'll have to report on our code
(https://github.com/gcompris/GCompris-qt/blob/master/src/activities/chess/engine.js).
I can help you understand the code on GCompris, but will have more
difficulty to help on the engine.
I'll take a closer look tomorrow to try to understand more the
different use cases you are talking about.
Johnny
Le ven. 5 juin 2020 à 14:18, Tyson Williams <tyson.d.w at gmail.com> a écrit :
>
> !Hello everyone,
>
> My children (twin 6yos and 4yo) love playing the activities in GCompris. In particular, one of my 6yos especially enjoys that he can been me at the flying kings variant of checkers.
>
> Anyway, there are two improvements that I would like to make to the chess activities.
>
> The first is that en passant is not a supported move. I would like to add support for them.
>
> The second is about the inconsistency in which moves are displayed as possible. After clicking on a piece, the general behavior is that the squares to which that piece can move are highlighted. The suggested moves vary according to the situation in many cases.
>
> Here are five cases in which only legal moves are suggested:
> - Opponent pieces in the way (e.g. if R on a1 can capture at a2, then capturing at a3 is not suggested)
> - Own piece in the way (e.g. there are no suggested moves for the king as the first move of the game)
> - Pawn's first vs non-first move (i.e. only when it is a pawn's first move and the two squares in front of it are empty is the suggestion given to move the pawn forward two squares)
> - Pawn capture (i.e. only if an enemy piece is diagonally in front of a pawn is the suggestion given to move in that diagonal direction)
> - Castling (i.e. castling the king by moving it horizontally is only suggested if it is valid...which means the king has never moved, the rook as never moved, square the king moves through is not being attached, and the square the king stops on is not being attached)
>
> In contrast, there is one case in which invalid moves are suggested, which is when the king of that player would become under attack (except for castling as mentioned above). I know of four ways in which this can happen:
> - Suggestions are given to move the king to a square that is under attack.
> - Suggestions are given to move a piece that is absolutely pinned.
> - For a piece that can put itself into an absolute pin, suggestions are given to move that piece that would not place it into an absolute pin.
> - For a piece that can capture a piece attacking the king, suggests are given to move that piece that does not capture that piece or place it into an absolute pin.
>
> If the user clicks such an illegal suggestion, the follow message is displayed.
> > "Invalid, your king may be in check"
>
> This message makes me think that I have missed some case....that the game can suggest a move that is illegal for some reason other than the king being under attack after the move. However, I have been unable to find such a case.
>
> When my children play chess and their king becomes checked, they click the suggested moves to get out of check, but many of them are illegal and display that message to them. I would prefer if those illegal moves were not suggested.
>
> Would making en passant possible and removing illegal move suggestions be welcome changes to the chess activities?
>
> --
> Tyson Williams
More information about the GCompris-devel
mailing list