After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 388253 - Add undo/replay support
Add undo/replay support
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: glchess
2.17.x
Other All
: High enhancement
: gnome-2-26
Assigned To: GNOME Games maintainers
GNOME Games maintainers
: 389372 485256 488842 502289 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-12-21 12:59 UTC by Benjamin Woods
Modified: 2011-01-17 08:15 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Some work I've done on implementing undo (8.27 KB, patch)
2008-12-31 01:44 UTC, Robert Ancell
needs-work Details | Review
Undo mostly working (22.19 KB, patch)
2009-01-02 06:23 UTC, Robert Ancell
committed Details | Review

Description Benjamin Woods 2006-12-21 12:59:17 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?
Comment 1 Andreas Røsdal 2006-12-22 15:14:21 UTC
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.
Comment 2 Robert Ancell 2007-07-06 13:12:01 UTC
*** Bug 389372 has been marked as a duplicate of this bug. ***
Comment 3 Robert Ancell 2007-11-11 11:39:05 UTC
*** Bug 485256 has been marked as a duplicate of this bug. ***
Comment 4 Robert Ancell 2007-11-11 11:39:54 UTC
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 !
Comment 5 Robert Ancell 2007-11-11 11:42:01 UTC
*** Bug 488842 has been marked as a duplicate of this bug. ***
Comment 6 Robert Ancell 2007-11-11 11:42:40 UTC
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...
Comment 7 Alex Hardie 2007-12-07 10:45:58 UTC
*** Bug 502289 has been marked as a duplicate of this bug. ***
Comment 8 Matt 2007-12-09 16:31:46 UTC
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.
Comment 9 mstriz 2008-07-09 01:55:56 UTC
"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?
Comment 10 Benjamin Woods 2008-07-09 08:36:38 UTC
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.
Comment 11 greg 2008-12-27 04:21:55 UTC
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.
Comment 12 Erik Blomqvist 2008-12-31 01:33:51 UTC
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?
Comment 13 Robert Ancell 2008-12-31 01:44:44 UTC
Created attachment 125555 [details] [review]
Some work I've done on implementing undo
Comment 14 Robert Ancell 2008-12-31 01:57:32 UTC
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.
Comment 15 Robert Ancell 2008-12-31 02:00:18 UTC
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).
Comment 16 greg 2008-12-31 09:52:02 UTC
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!
Comment 17 Erik Blomqvist 2008-12-31 15:52:33 UTC
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.
Comment 18 Robert Ancell 2009-01-01 22:21:12 UTC
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.


Comment 19 Robert Ancell 2009-01-02 06:23:26 UTC
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.
Comment 20 Robert Ancell 2009-01-05 22:31:37 UTC
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


Comment 21 Robert Ancell 2009-01-18 22:31:43 UTC
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.
Comment 22 Robert Ancell 2011-01-17 08:15:02 UTC
This was fixed ages ago...