Menu

#696 Savegame sync error

Always occurs!
closed-fixed
None
6
2025-01-18
2025-01-10
No

With version 1.48.16 loading of old saved games work as expected.
But if I save the game with this version and load it again, I get:

SAVEGAME FILE CORRUPTED
PRESS ESC

With the attached patch it works again.

Seems not OS dependent. Tested on Linux/ppc and NetBSD/amd64.

How to reproduce:
$ doomlegacy -iwad doom2.wad
=> Save game at starting point
=> Load it again

1 Attachments

Discussion

  • Wesley Johnson

    Wesley Johnson - 2025-01-10

    I forgot to write the new flag fields.
    BUT, you put the writes in the wrong place. The reads are after Inventory. That will not work for Heretic.
    In my patch, I will be moving the read flags code up so all flags read are in one place (at read of flags) which will match your location for the writes. This does not affect reading the old savegame format, as that case does not do an actual read op.

     
  • Wesley Johnson

    Wesley Johnson - 2025-01-10
    • status: open --> pending
    • assigned_to: Wesley Johnson
    • Priority: 5 --> 6
     
  • Wesley Johnson

    Wesley Johnson - 2025-01-11

    Should figure out some way to read the bad savegames that got created.
    How did this get missed for so long. I had tested.

     
  • Wesley Johnson

    Wesley Johnson - 2025-01-11

    Planned patch with add another savegame flag bit PD_FLAGS149, which is set when GB_flags or GF_flags are non-zero. Then save those flags to savegame, and read then from savegame when that flag is set (like all the other PD_xxx). This will allow the bad savegames to be read, as they do not have that savegame bit set. Those players loading bad savegames will loose the backpack, and the flag about completed a secret.
    How does this sound. Does it seem to cover every case ??

    I am considering having to bump it to 1.48.18, cause this is serious enough that I do not want the confusion of another svn version of 1.48.16. It is just too hard to document.

     
    • Michael Bäuerle

      How does this sound. Does it seem to cover every case ??

      I have tested your patch with an old pre-1.49 savegame, with a 1.49 savegame and a new savegame stored by itself.
      It worked for all cases without sync errors.

      I have tested Heretic by picking up a Tome of Power, then save and load again.
      It was still in the inventory.

      Seems to work.

       
  • Wesley Johnson

    Wesley Johnson - 2025-01-17

    Thank you for the test.
    Patch committed.
    I tested that it will also read the corrupt savegames that have been created, but I don't wholly trust my tests anymore.

     
    • Michael Bäuerle

      Ticket can be closed.

       
  • Wesley Johnson

    Wesley Johnson - 2025-01-18
    • status: pending --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB