lukasmonk / lucaschessR2

Lucas Chess R Version 2
GNU General Public License v3.0
268 stars 40 forks source link

Bugs with the tutor. #54

Closed dranor11 closed 1 year ago

dranor11 commented 1 year ago

Whenever the takeback function is used the whole game gets corrupted. This happens in three ways:

  1. If takeback was used before the tutor suggested any better move at all, the ongoing game remains playable but sometimes the players pieces stuck weirdly.
  2. If the function was used after the tutor already suggested any better move it might happen that analyzing result may become inaccurat but the tutors move can be made instead of the original move.
  3. Same as 2 but even if one of the tutors moves is choosen the original move will be executed. This is an ongoing problem in all version up to 2.05 though it was way worse in 2.04 and before. If the tutor is disabled nothing of this happens and the game can be played normaly.
lukasmonk commented 1 year ago

Fixed I believe. When the tutor is thinking, only the tutor's thinking is allowed. To the next update.

korsteve commented 1 year ago

I'm also finding lots of issues with the tutor during compete and training games. Not sure if it is an issue with tutor or with takeback (or both). I'm using version 2.05d.

Following these steps I can reproduce a bad tutor state every time:

1) Go to Engines configuration. Set tutor engine to 'stockfish'. Set tutor appearance condition to 'always'. 2) Go to Train > Tactics >Training Positions > Endgames by Rui Grafino > The Four Basic Mates > The King and Rook Mate. 3) Select position 1. Make sure tutor is enabled. Accept. 4) Make a non-ideal move like Ke6+. 5) The tutor will suggest Rc3. Accept the tutor's suggestion. 6) Hit takeback move. 7) Make the same move as in step 4: Ke6+.

The tutor dialog will come up and the suggestion and prediction will be incorrect, the prev/next buttons don't work properly and the tutor will be messed up for the rest of the playthrough.

image

Once the tutor is in a bad state, I have seen it suggest moves, stating they are M+1 but they result in the loss of pieces and no mate in sight. I've had the tutor hang on me as well resulting in having to force an exit in this bad state.

korsteve commented 1 year ago

Played around with this a bit more, and taking back a move is key to reproducing. If I pick the tutor's or my own suggestions (I can do this repeatedly), and never takeback a move, then I don't encounter any issues.

lukasmonk commented 1 year ago

I have had to add two lines when a takeback is done:

ManagerEntPos.py:315

    def takeback(self):
        if self.is_rival_thinking:
            return
        if len(self.game):
            self.analiza_stop()            # added ########################
            self.rm_rival = None           # added ########################
            self.game.anulaUltimoMovimiento(self.is_human_side_white)
            self.goto_end()
            self.is_analyzed_by_tutor = False
            self.state = ST_PLAYING
            self.refresh()
            self.play_next_move()

Thank you very much.

korsteve commented 1 year ago

Thank you sir!