Where can I find the current play time data in the saved game zip file?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
nuke_it_from_orbit
Burner Inserter
Burner Inserter
Posts: 9
Joined: Tue Feb 26, 2019 8:27 pm
Contact:

Where can I find the current play time data in the saved game zip file?

Post by nuke_it_from_orbit »

I want to scrape the play time from 178 save files.

I'm interested in knowing how Factorio reads the metadata for a saved game file.

In the Load Game GUI I see the following metadata:
  • Map Version
  • Scenario
  • Difficulty
  • Play time
  • Mods
I'm interested in accessing the play time.

I unzipped a save game file and I have the following files, but couldn't find the data I wanted.
  • control.lua
  • info.json
  • level.dat
  • level-init.dat
  • script.dat

Rseding91
Factorio Staff
Factorio Staff
Posts: 13347
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Where can I find the current play time data in the saved game zip file?

Post by Rseding91 »

It's in level.dat but the contents of level.dat are a serialized version of the game state the format of which isn't documented because it changes as needed for new or removed data we include in the save.

You'd have to know the file format up until you're able to read what you want and then hope we never change it (which happens).
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding discussion”