Auto-save

19 views
Skip to first unread message

epw

unread,
Sep 21, 2011, 3:09:45 PM9/21/11
to garglk-dev
Hi, everyone!

I have recently gotten back into playing Interactive Fiction, and was
very glad to see a new de facto standard for playing IF on Linux.
Having Gargoyle in the Ubuntu repositories makes things nicely easy.

However, I have discovered I have a problem. I keep quitting Gargoyle
without saving my game, first. I have been spoiled by auto-save in
modern games.

This made me wonder whether it would be possible to implement any kind
of auto-save mechanism in Gargoyle.

Looking at the source code, the main problem I can see with that is
the fact that there are a bunch of different interpreters. You could
in theory add some kind of "auto save" trigger to each of them, and
then make Gargoyle trigger it when the program quits, but that might
be more work than it's worth. You could also have Gargoyle tell the
interpreter that the user typed "save" and then choose a default
filename when Gargoyle quits, but I don't know if that will work for
any interpreters besides the Z-Machine and Glulx (the ones I am
familiar with). Finally, it seems like it might be possibly to tell
Gargoyle to completely save the state of the interpreter, like some
kind of "Suspend to Disk" functionality, and then could restore
directly from the file it makes.

Does this seem like a feasible idea? Can anyone see a better way to
accomplish it?

Thank you all for your work on this project and for any ideas you have!

Ben Cressey

unread,
Sep 23, 2011, 3:59:32 PM9/23/11
to ericwi...@gmail.com, garglk-dev
Hi Eric,

Autosave would be a great feature, along with other modern conveniences like saving the transcript.

However, as you've discovered, the multi-interpreter nature of the project makes a proper implementation of this feature somewhat daunting.

It would not be as straightforward as silently passing save / restore commands to the game, as that is not guaranteed to be free from side effects. Games can restrict the number of saves or modify the standard behavior in unexpected ways.

The VM based formats (Z-Machine, Glulx, TADS) offer low-level hooks that could be used to bypass game logic, but the interpreted formats do not.

I am reluctant to offer this feature for some formats but not others, as the potential for unexpected loss of progress would be quite high, and would feel like a bug in Gargoyle rather than a defect in the authoring tool.

Regards,
Ben




--
You received this message because you are subscribed to the Google Groups "garglk-dev" group.
To post to this group, send email to gargl...@googlegroups.com.
To unsubscribe from this group, send email to garglk-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/garglk-dev?hl=en.


Stuart Allen

unread,
Sep 23, 2011, 4:31:19 PM9/23/11
to bcre...@gmail.com, ericwi...@gmail.com, garglk-dev
For what it is worth, I'd be happy to add the low-level hooks to JACL,
I wonder if other interpreters would be happy to do the same?

Stuart

--
http://dangarstu.tumblr.com

Eric Forgeot

unread,
Sep 24, 2011, 3:19:03 AM9/24/11
to gargl...@googlegroups.com
On 23/09/2011 21:59, Ben Cressey wrote:


Autosave would be a great feature, along with other modern conveniences like saving the transcript.

However, as you've discovered, the multi-interpreter nature of the project makes a proper implementation of this feature somewhat daunting.



I'd suggest adding a "prevent from exiting" box when people click the closing cross, like "If you exit now, all your progression might be lost in the case you haven't saved before. Are you sure you want to do this?" (YES/CANCEL button). If people have remembered to save before, they can just hit YES. Otherwise they can cancel the process and save their game using the normal way in the interpreter. This should be an option we can turn off and on in the garglk.ini because I personnaly wouldn't use it. But it'd be conveniant to turn on in distributed game (with the garglk.ini) so players wouldn't be surprised to exit without saving.



Philip Chimento

unread,
Sep 24, 2011, 3:29:52 PM9/24/11
to gargl...@googlegroups.com, ericwi...@gmail.com
On Friday, September 23, 2011 9:59:32 PM UTC+2, Ben Cressey wrote:
The VM based formats (Z-Machine, Glulx, TADS) offer low-level hooks that could be used to bypass game logic, but the interpreted formats do not.

I am reluctant to offer this feature for some formats but not others, as the potential for unexpected loss of progress would be quite high, and would feel like a bug in Gargoyle rather than a defect in the authoring tool.

Perhaps not necessarily; I think these hooks could be built into Glk. If the Glk library keeps track of when a fileref with fileusage_SavedGame is opened, written to, and closed, then it can reasonably know the last time the game was saved. If the player tries to close the game window, for example, at a point when line input events have occurred after the last save, then you could display a dialog asking if they are sure. (Quitting by "quit" command displays a confirmation prompt in the interpreter, at least in Inform games...)

I'm thinking of adding this feature to Chimara, but I haven't tried it yet.
--
Philip
 
Reply all
Reply to author
Forward
0 new messages