Results 1 to 3 of 3

Thread: About savegames format

  
  1. #1
    Ghost
    Join Date
    Dec 2010
    Location
    Madrid, Spain
    Posts
    365

    Default About savegames format

    Hello! I am here again since some years ago, i will like to continue helping with KeeperFX testing and finding bugs.

    I am thinking about programming a binary parser for KeeperFX savegame files, so i have two questions:
    - When we attach savegames for bugs, how are they analyzed? Are they manually viewed with an hexadecimal editor to find problems in that data? What is process to analyze those .sav files?
    - Is there any .sav format specification document?

    Thanks
    Last edited by jomalin; September 15th, 2022 at 22:35.

  2. #2
    Demon Spawn Necror's Avatar
    Join Date
    Feb 2010
    Location
    qqluqq
    Posts
    192
    Gamer IDs

    Steam ID: qqluqq

    Default Re: About savegames format

    they're just opened in the game itself like a normal save game generally,
    for the exact data you'll have to look in the code here
    https://github.com/dkfans/keeperfx/b...me_saves.c#L93
    to see what block of data are stored in the savegame, but the gameadd and once dll is done the game struct as well, often change between minor versions, so it if you were to make such a tool, it would have to be compiled using some of the fx sources of the same version of the save file you'd want to analyse

    as for testing, I'd say join the discord, and ask there to join the developer channel
    Last edited by Necror; August 16th, 2022 at 10:10. Reason: added testing part

  3. #3
    Ghost
    Join Date
    Dec 2010
    Location
    Madrid, Spain
    Posts
    365

    Default Re: About savegames format

    My binary template is finished! It parses KeeperFX 0.4.9.2762 savegames perfectly.

    To use it you need:
    - The hexadecimal editor 010 Editor, download it here:
    https://www.sweetscape.com/download/010editor/
    - Then, download my binary template from the Binary Template Repository:
    https://www.sweetscape.com/010editor...eeperFX_SAV.bt
    - Import it in 010 Editor: Templates menu > View Installed Templates > Add... and select the KeeperFX_SAV.bt file.
    - Open the savegame file from KeeperFX in 010 Editor: File menu > Open

    This is a preview of opening a savegame file with it:
    Click image for larger version. 

Name:	KeeperFX savegame parsing.png 
Views:	19 
Size:	538.2 KB 
ID:	2288

    And an animated GIF (low resolution, with no so many colors) of me using it through the data inside:
    Click image for larger version. 

Name:	Savegame parsing.gif 
Views:	14 
Size:	8.86 MB 
ID:	2289

    IMPORTANT NOTE: It only works for 0.4.9.2762 version and versions that don't change the savegame size (some alpha versions added more data into the savegame file so it will not be parsed correctly and some fields will be misaligned, but my template detects that)

    This will not only allow us to see all the data inside, but also modifying it for any purpose like debugging or testing.
    It can be also used to convert more "easily" an old savegame (from a previous KeeperFX version) to a most modern (like alpha or nightly build versions) savegame version, but this will require some manual work, because the additional necessary bytes must be added and the length field of the chunk header must also be modified.

    Maybe if needed and if i get the time, i could update my template to support different KeeperFX versions.

    I attach some savegame files to let you try it:
    saves.zip
    Last edited by jomalin; September 16th, 2022 at 06:53.

Similar Threads

  1. DK2 texture format
    By Trass3r in forum Dungeon Keeper 2
    Replies: 69
    Last Post: January 16th, 2020, 19:27
  2. KeeperFX failed to load savegames
    By jomalin in forum KeeperFX
    Replies: 1
    Last Post: July 9th, 2014, 12:46
  3. KeeperFX savegames
    By jomalin in forum KeeperFX
    Replies: 3
    Last Post: August 9th, 2012, 15:37
  4. [0.38c] Savegames make game unstable?
    By Krizzie in forum KeeperFX
    Replies: 5
    Last Post: March 16th, 2011, 18:49

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •