runtime hook for Crash on Error

Simen Kjaeraas simen.kjaras at gmail.com
Fri Jun 1 15:25:08 PDT 2012


On Fri, 01 Jun 2012 19:43:06 +0200, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> On 6/1/2012 1:48 AM, Dmitry Olshansky wrote:
>> Or better - save game and then crash gracefully.
>
> That can result in saving a corrupted game state, which then will not  
> load, or worse, load and then cause another crash.
>
> I would suggest instead implementing an auto-save feature which  
> automatically saves the game state at regular intervals.

Autosave is a good idea. Autoloading last save upon resuming the game is  
not.
But saving the game before crashing, then explicitly telling the player  
that
something went wrong and the save might be corrupted and not to expect too  
much
 from it, I think that's pretty good.

Of course, the crashing part may be deep buried and will only trigger under
obscure circumstances 100 hours down the road, in which case the autosave  
is
definitely the correct solution. Basically it's about provability and
consequence. If you can check the save file for corruption upon next start,
no problem! If the result is two hours lost, no problem! If you can't
check the save file, and the result may be 100 hours lost, don't save a
potentially corrupted file (I'm looking at you, Bethesda).


More information about the Digitalmars-d mailing list