This isn't so much a mod API request as it is a save file format request. I am writing a CLI mod manager, and the next feature I'm working on is sync-mods-with-save. I have found many previous posts on this subject, but they're all pretty outdated.
Work was progressing, and I was slowly learning how to parse level-init.dat to get the mods, but ran into a wall: level-init.dat is created with the save, and is never updated after that point. The mod list and game version contained therein stay as they were when the save was first made. This obviously doesn't work for sync-mods-with-save, because it will not have the expected result of syncing with the currently active mods.
I looked at all of the other files, but the other `.dat` files do not have this information. `level.dat0` might have it, but it appears to be fairly aggressively compressed, and is therefore not readable by external tools without knowing the exact compression method so we can decompress it.
This all leads me to this: It would be amazing if a mod-list.json file was included with saves, so external tools like mine can easily read it. It could match the existing mod-list.json syntax, or could just be name -> version pairs, either would work. Deserializing json is infinitely easier than decompressing and reverse-engineering binary data.
UPDATE:
Turns out decompressing level.dat0 was really straightforward, and I had just given up too early. Running zlib-flate -uncompress < level.dat0 > uncompressed.dat0 did the trick. Having a json file would still be nice though!
Add mod-list.json to save files
Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Return to “Modding interface requests”
Jump to
- General
- ↳ Releases
- ↳ News
- ↳ General discussion
- ↳ Multiplayer
- ↳ Find Servers / Tools / Guides
- ↳ Show your Creations
- ↳ Videos
- ↳ Combinator Creations
- ↳ Mechanical Throughput Magic (circuit-free)
- ↳ Railway Setups
- ↳ Energy Production
- ↳ Medium/Big/Gigantic Sized Structures
- ↳ Fan Art
- ↳ Gameplay Help
- ↳ Spread the Word
- ↳ Off topic
- ↳ This Forum
- ↳ Celebration Party
- Support
- ↳ Gameplay Help
- ↳ Discover Factorio Wiki
- ↳ Discover Others Creations
- ↳ Discover Mods
- ↳ Discover Tools Around Factorio
- ↳ Technical Help
- ↳ Bug Reports
- ↳ Resolved for the next release
- ↳ Fixed for 1.2
- ↳ Assigned
- ↳ Not a bug
- ↳ Pending
- ↳ 1 / 0 magic
- ↳ Duplicates
- ↳ Minor issues
- ↳ Desyncs with mods
- ↳ Won't fix.
- ↳ Resolved Problems and Bugs
- Factorio Direction
- ↳ Ideas and Suggestions
- ↳ Outdated/Not implemented
- ↳ Frequently Suggested / Link Collections
- ↳ Implemented Suggestions
- ↳ Development Proposals
- ↳ Balancing
- Contributions
- ↳ Mods
- ↳ Download mods
- ↳ Mod portal Discussion
- ↳ Mods
- ↳ Mod Packs / Libs / Special Interest
- ↳ 5dim's mod
- ↳ Angels Mods
- ↳ Atomic Power
- ↳ Bob's mods
- ↳ DyWorld
- ↳ F.A.R.L
- ↳ Fentus Challenge & Tool Mods
- ↳ Logistic Train Network
- ↳ MoMods
- ↳ Reika's Mods
- ↳ Resource Spawner Overhaul
- ↳ Yuoki Industries
- ↳ PyMods
- ↳ Questions, reviews and ratings
- ↳ Modding Discussions
- ↳ Modding discussion
- ↳ Modding help
- ↳ Ideas and Requests For Mods
- ↳ Modding interface requests
- ↳ Implemented mod requests
- ↳ Already exists
- ↳ Won't implement
- ↳ Tools
- ↳ Mod-/Installation-Handling
- ↳ Cheatsheets / Calculators / Viewers
- ↳ Development-Tools
- ↳ Special interest mods and libraries
- ↳ Multiplayer / Dedicated Server
- ↳ Multiplayer Board
- ↳ Archive
- ↳ Maps and Scenarios
- ↳ Translations
- ↳ Texture Packs
- ↳ Fan Art
- ↳ Wiki Talk
- ↳ To be sorted
- ↳ Campaign / Scenario suggestions