GNOME Bugzilla – Bug 388253
Add undo/replay support
Last modified: 2011-01-17 08:15:02 UTC
This is a copy of the bug 1618427 submitted on sourceforge: http://sourceforge.net/tracker/index.php?func=detail&aid=1618427&group_id=6348&atid=106348 It would be great to have a button to under your last move... if I make a bad one :) Alternatively, I think this could be built into the move list at the bottom of the application (where you can see all the moves that have occurred and rewind). Currently if you rewind you can't continue play from where you rewinded. I think if it was made so that you can rewind using that drop down list and then play on from there, it would be a handy feature... even if it is cheating. Perhaps a record could be made in the log that the user cheated here?
Hello Benjamin, I'm a bit sceptical to having an undo feature in a chess game. If you can provide more convincing arguments for why glchess needs an undo feature, then _maybe_ it will be implemented in the 2.20.x development cycle. Currently gnome-games is in an User Interface announcement period, and I don't think this is important enough to change the user interface at this time. Please submit a patch after GNOME 2.18 has been released, and someone can review it.
*** Bug 389372 has been marked as a duplicate of this bug. ***
*** Bug 485256 has been marked as a duplicate of this bug. ***
As reported on sf.net: A very annoying bug, and i think very easy to fix is that it's impossible to cancel a move and replay differently. We can go back to any position, but we can't replay it differently !
*** Bug 488842 has been marked as a duplicate of this bug. ***
From bug 488842: Hi, I love the "truncate game" option of winboard, because it lets you resume the game just before a bad move, without the pain of doing it manually by saving game to disk and loading it again... especially when you make bad moves often... this option would permit someone to train chess better...
*** Bug 502289 has been marked as a duplicate of this bug. ***
I'd like to see this too. Sometimes I mis-click or something, and make a move that is just insanely stupid and lose a game that I should have won.
"If you can provide more convincing arguments for why glchess needs an undo feature, then _maybe_ it will be implemented in the 2.20.x development cycle" How about the fact that so many people want this feature?
The main reason for this feature is to allow a user to undo an accidental move they made by clicking in the wrong spot etc. The request is not so I can realize and correct my mistake when the opponent then takes my queen on the next move.
I would also like this undo feature, especially in human vs computer mode. I love to wind-down from a busy day playing chess against the machine. However when I play in this sort of mood, I just don't pay full attention and lose major pieces and throw the game. It really bums me out when I invest 20 or 30 moves into a game, then totally ruin it by letting the machine take my queen. I know I could fight on, but at these times, that's exactly what I don't want to do! I want to relax, have some game that takes enough of my attention to pass the time, to NOT let my mind think about work or family issues. Maybe I'll have the break out the boggle board or jenga for some lower-brow entertainment.
For someone who are familiar with the code it shouldn't take a lot more than five minutes to fix this bug. I mean you can already move backwards through the game. How hard can it be to let the player continue from there instead of from where he was? Seams to me like you're just too stubborn to implement it. Of course in a real game of chess it would be outrageous to let the opponent undo a move, but in a real game of chess there is no such thing as mis-clicking. I mis-click all the time. Well, at least a few times in each game and it is a bitch having to save the game, open the save-file in gedit, edit it to correct the mistake and then open it in glchess to continue. I just lost a game of chess because of this bug, so I am a bit pissed right now. If you feel like I'm a bit to harsh on you, that's why. If so, I hope I am excused. Question: If I would find the time to create a patch to fix this bug, how likely would it be to be applied? And what's the deadline to get it into the next release?
Created attachment 125555 [details] [review] Some work I've done on implementing undo
Hi Erik, Unfortunately this is not a 5 minute fix. Some of the issues are: - Supporting undo for both UCI and CECP engines - Handling a race condition in both protocols where sending the stop/undo occur at the same time the engines may send a move (this is a limitation of these protocols) - Undoing the animation of the pieces - Updating the move dialog box - Detecting if this is a human-AI game and undoing two moves if the AI just moved - Testing this fix works Unfortunately the current code does not have a concept of undoing moves so there are some structural changes required (see attached partial patch which took more than 5 minutes). To make the 2.26 release the changes would have to be committed by 6 Jan, otherwise it would become part of the 2.28 release. If we had confidence that this feature could be fully completed by the beta release (3 Feb) we could make the UI changes now and work on the full functionality until then. I agree this is the highest requested new feature (updating bug to reflect that), unfortunately we don't have the luxury of spare time to be stubborn in not implementing! Short answer: If this feature can be implemented and tested to be reliable there is a 100% chance of it being included in the 2.26 release. If it cannot be done by that time then it would be in the 2.28 release. Any effort you can devote will be greately appreciated.
Another thing that has to be considered: - What effect undoing has on the clock (I'm thinking the undoer has no change - the oponenet has their time returned or maybe taken from the undoer). And in future do we store the failed moves? (as PGN can contain alternate moves).
These comments make me realize the task of undoing moves is more difficult than I imagined. I don't have an opinion on how time should be handled. I would defer to more experienced players, perhaps the above could be the default behavior, but then allow other options in a configuration dialog. I also don't know anything about the format of the chess file, just from looking at it seems like it has been around a long time, so how it can be made to handle undos needs comments from more experienced players and programmers. But I'm glad to know this is being looked into!
Thank you Robert. It pleases me that someone is working on it. I saw this comment: "I'm a bit sceptical to having an undo feature in a chess game. If you can provide more convincing arguments for why glchess needs an undo feature, then _maybe_ it will be implemented in the 2.20.x development cycle." And after that one I saw a lot of comments requesting this feature and no patches or even someone saying that they were working on one. Maybe you can understand why I thought you seemed stubborn. I think that undoing shouldn't be harder than loading a game. I mean it's possible to load a game from anywhere and it's basically the same as undoing. Just make it easier to access by making ctrl+z load the game from the previous move. It doesn't seem too hard.
I can see how that does give the wrong impression but remember that one comment doesn't reflect a consensus. I think the following comments do give convincing arguments and there are no patches because afaik no-one has been working on it. Remember we are a small, non-funded volunteer group and there are other bugs to be fixed. Personally, I was hoping for an outside patch :) Again is sounds simple in theory but if you deleted the last move from the game, saved, and reloaded there would be a number of issues on how this could be cleanly animated, and how this would affect the save game history. Both would not work cleanly in the current architecture.
Created attachment 125616 [details] [review] Undo mostly working Please test. There is at least one bug where you can undo while a move is occurring and this causes the game to be confused.
I read the release schedule (http://live.gnome.org/TwoPointTwentyfive) wrong; this feature has until Feb 2 to be completed as long as the UI changes are announced to the documentation team. What need to be completed: - There needs to be more testing of this patch - Undo needs to be disabled when in network games
I've committed this patch: http://svn.gnome.org/viewvc/gnome-games?view=revision&revision=8588 I don't think it's well enough tested but this gets all the UI and string changes done before the freezes. Please test in 2.25.5 if you are able to.
This was fixed ages ago...