Bug 291959

Summary: Save full history in saved game files
Product: [Applications] kpat Reporter: H.H. <cyberbeat>
Component: generalAssignee: Parker Coates <coates>
Status: RESOLVED FIXED    
Severity: wishlist CC: coates, kde-games-bugs
Priority: NOR    
Version: 3.6   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description H.H. 2012-01-19 14:15:39 UTC
Version:           3.6 (using Devel) 
OS:                Linux

With the option "restore previous game state" I would like to see

a) when I finished a game ("you have won"), then quit kpat, and then restart, I don't want to see still the "you have won" screen, but a new started game or the game-type-selection-page

b) I would like to be able to undo moves in the restored game

Reproducible: Always



Expected Results:  
see above

OS: Linux (x86_64) release 2.6.37.1-1.2-desktop
Compiler: gcc
Comment 1 Parker Coates 2012-01-19 15:32:42 UTC
a) is actually a regression between SC4.7 and SC4.8. Closing KPat after winning and reopening is supposed to bring up the game selection screen. Please open a separate bug report for it and I'll try to fix it.

b) is actually something I've been working on for a bit, but it's a rather major change. It requires changing how game states are saved internally, creating a new save file format, rewriting the loading code to detect which kind of file is being opened, introducing compression (since an XML file containing the whole history of a long game is going to be several megabytes), and a slew of other semi-related changes. I hope to have it done for SC4.9, but no promises.
Comment 2 Parker Coates 2012-01-22 04:01:01 UTC
SVN commit 1275129 by coates:

Don't bother saving state on close if the player has already won.

This was a behaviour regression caused by the clean up of the loading
and saving code. Somewhat surprisingly, saving after the game has been
won worked without issue and loading that save caused the player to
instantly win again, so it acted like the state was actually remembered.
Of course, the user doesn't expect to fire up KPat just to be instantly
told that they've won.


 M  +3 -3      dealer.h  
 M  +6 -6      mainwindow.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1275129
Comment 3 Parker Coates 2012-01-22 04:08:43 UTC
SVN commit 1275131 by coates:

Backport of commit 1275129.

Don't bother saving state on close if the player has already won.

This was a behaviour regression caused by the clean up of the loading
and saving code. Somewhat surprisingly, saving after the game has been
won worked without issue and loading that save caused the player to
instantly win again, so it acted like the state was actually remembered.
Of course, the user doesn't expect to fire up KPat just to be instantly
told that they've won.



 M  +3 -3      dealer.h  
 M  +6 -6      mainwindow.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1275131
Comment 4 Parker Coates 2012-02-15 04:45:37 UTC
SVN commit 1280175 by coates:

Use new save format for "Remember State on Exit" functionality.

FIXED-IN:SC4.9

 M  +1 -1      mainwindow.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1280175