Page 1 of 1

Any way to detect the version of specific map save?

Posted: Mon Nov 11, 2024 5:56 am
by changchiyou
Hello, I'm working on dockerizing a Factorio map renderer that can accept map saves from any version. However, I'm currently stuck on how to retrieve the version information from a map save file.

Re: Any way to detect the version of specific map save?

Posted: Mon Nov 11, 2024 7:54 am
by MisterDoctor
I think I see it at the start of script.dat. first 8 bytes are 4 16 bit integers representing the version.

ex: 02 00 00 00 0f 00 04 00
= 2 0 15 4
= 2.0.15-4

there are similar bytes in level-init.dat but they would give 2.0.7.0.

(note I can't guarantee the meaning of the values. ie: it is not _necessarily_ the game version; could be the file or format version that is close but not identical to the game version or something like that.)

note also this thread from a long time ago where someone else was doing something similar: viewtopic.php?t=47014

Re: Any way to detect the version of specific map save?

Posted: Mon Nov 11, 2024 8:41 am
by changchiyou
MisterDoctor wrote: Mon Nov 11, 2024 7:54 am I think I see it at the start of script.dat. first 8 bytes are 4 16 bit integers representing the version.

ex: 02 00 00 00 0f 00 04 00
= 2 0 15 4
= 2.0.15-4

there are similar bytes in level-init.dat but they would give 2.0.7.0.

(note I can't guarantee the meaning of the values. ie: it is not _necessarily_ the game version; could be the file or format version that is close but not identical to the game version or something like that.)

note also this thread from a long time ago where someone else was doing something similar: viewtopic.php?t=47014
I think you're right :D ; I found another thread here (8568) that discusses a similar approach to retrieving the game version from .dat files.