shlomif / PySolFC

A comprehensive, feature-rich, open source, and portable, collection of Solitaire games.
http://pysolfc.sourceforge.net/
GNU General Public License v3.0
463 stars 105 forks source link

Demo from Savegames feature #392

Open hajo4 opened 1 month ago

hajo4 commented 1 month ago

Add a feature 'Demo-from-savegames'

This would load files like *-ok.pso from a folder of savegames, rewind and play them in demo-mode.

joeraz commented 1 month ago

Please be more careful with the issue names - having the duplicate issue names is confusing for me.

Before doing something like this, I think a feature would be needed to have the demo "Replay" the current game.

hajo4 commented 1 month ago

feature .. to .. "Replay" the current game

Could be done as follows:

It looks like restart-current-game forgets the history needed to go forward again. Going back with undo is a bit cumbersome - maybe automatically set a bookmark#0 at the begin ?

hajo4 commented 1 month ago

Here a small demo of such a bookmarked savegame: Hanoi Puzzle 5-85644395461021679616_ok-demo.zip

joeraz commented 1 month ago

I'm more thinking about a single "Replay" button that runs the demo with the exact moves you've played to that point. And using bookmarks might not work well if bookmarks are already being used. More likely the game itself with its move history has to be passed in the demo method itself, and logic needs to be written for that.

Yes, restart current game starts a new game of the same deal, so the move history is lost. I considered adding an Undo All option, but decided against it when I realized doing so would make it very easy for a player to cheat their statistics.

hajo4 commented 1 month ago

Another savegame ready for playback: Pegged Cross 1-93457135428827561984_ok-demo.zip