Questions about Kerkerkruip Permadeath extension

I extracted from Kerkerkruip Permadeath the code that make it possible to save to and restore from an external file to put it in an extension.

First of all, It would be great if someone (maybe the original author Victor Gijsbers or Erik Temple) reviewed it so I’m sure I haven’t made mistakes. In particular, I can’t understand the purpose of the “automatic save boolean” variable. It looks like it is used to display only once the message saying that the game could not be saved, but I don’t understand why.

Second, I’d like to know if this way of saving is enough robust replace the standard way of saving. I guess so, because it’s what Kerkerkruip uses, but you never know. In particular, I’d like to know if the savefile produced can be taken and loaded normally by typing restore, like a regular savefile (and if it’s compatible with the common interpreters).

(In case it matters, I intend to use it with Vorple, and for the moment it seems to work well with it.)

Thanks!

I’m sure I wrote almost none of that code, but merely packaged it up for Kerkerkruip. So I don’t consider myself an expert.

As far as I can see, the “automatic save boolean” is just somewhat misleadingly named. It does precisely what you describe: if saving doesn’t work, it ensure that the failure message is displayed only once. (If it didn’t do that, you would get the error every turn, which would be extremely annoying.)

I don’t know much about the exact way that saving works in Glulx and its interpreters, but I do know that I have never seen any problems with Kerkerkruip related to an ability to save. So I suspect the process is quite robust. The saves should certainly be able to be restored normally – Kerkerkruip does not implement its own save file format.

In fact, after digging in Inform I6T files, it looks like the routine from the extension is the same as the one resulting from the saving action. So the file should be indistinguishable from a normal save.

As for the boolean, I now understand that it exists because Kerkerkruip tries to save the game each turn (and then it would be annoying to have the message each turn). But since my extension makes it possible to save whenever the author wants, I will remove the variable and always show the message, like a with a regular save. (It would then be the author’s job to display it only once if they want it, using the response machinery.)

Thanks a lot! Your answer helped me clarify some things!

Thanks a lot for this, I think I’m going to use it. I am especially happy to see that the switch between roguelike mode and normal mode can be made at runtime - that way I can give my players the option!