Save-file parsing via factorio executable

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

CommanderRedYT
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Jan 20, 2026 10:42 pm
Contact:

Save-file parsing via factorio executable

Post by CommanderRedYT »

TL;DR
Make the factorio binary have a command to select a save game which gets then printed as JSON.

What?
First of, I know from other posts that releasing the binary structure of the save files might not be ideal.
What I have in mind would be something like this:

Code: Select all

~ $ ./factorio --save-file-info mysave.zip
{
  "version": "2.0.72"
  ...
  "mods": [
    "mod-xyz": "1.0.0"
  ]
}
I specifically mean exposing things like metadata, i.e. version, play time, cheats enabled, mod list, ..., but not things like actual world data (i.e. where which building is)
Why?
This one might be more relevant for developers who want to write helpers that interface with factorio, especially in headless contexts.
Personally, I would love to see this, so that I would be able to write a helper tool to automatically download mods that are required by the save.
It would also be interesting information to show in a public server context (for example on a website)
eugenekay
Filter Inserter
Filter Inserter
Posts: 981
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Save-file parsing via factorio executable

Post by eugenekay »

There is at least one repository on GitHub which parses the DAT file format used by Factorio directly, and Factorio Server Manager project (which does not appear to have been update for 2.0?). There is even a post here on the Forums by game Devs with data structure information and an example decoder.

If you unzip a Save file you will find level-init.dat, which can be hex-decoded just by eyeballing it:
01-20-2026, 18-43-51.png
01-20-2026, 18-43-51.png (57.57 KiB) Viewed 179 times
The first bit of data is "02 00 00 00 47", corresponding to Game Version 2.0.71
Next is the Savefile name ("Earf").
Then there is a list of Mods (starting with "base") with their Versions and some separators.
Further down you will find the Startup Settings, map generation data, and a lot more...

Multiplayer Servers can access this using RCON + In-Game LUA code, eg active_mods.

Good Luck!
Post Reply

Return to “Ideas and Suggestions”