[v2.3.3] Lunar's Factorio Mod Manager

Tools for search and installing new mods as well as starting Factorio.
For dedicated server handling see Multiplayer Tools
User avatar
AlyxDeLunar
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Dec 22, 2014 7:32 pm
Contact:

Re: [v2.3.1] Lunar's Factorio Mod Manager

Post by AlyxDeLunar »

Oh yeah, v0.18 is out. It's been awhile since I played the game.

I had to guess at how the save files are stored and it's only through trial and error I've gotten it to parse data correctly, it also changes per version. No biggie, I'll just play with it until the app can read the save files for this version.
I'll put that next on my to-do list, I'll aim to have it done this week.
Sometimes humorous, usually congenial. Always Alyx.

My Stuff:
Lunar's Factorio Mod Manager
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [v2.3.1] Lunar's Factorio Mod Manager

Post by Impatient »

Great! Thank you very much! :)
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [v2.3.1] Lunar's Factorio Mod Manager

Post by Impatient »

Because I like puzzeling sometimes and I wanted to help you out, I already started decoding the beginning and mod list of a savegame made with 0.18.x .

I used saves from 2 scenarios and with 2 different mod lists, 3 variations in all. Using HxD Hex Editor.

Here are my results/assumptions so far (blocks, lengths and offsets are in decimal numbers, blocks and offsets are zero based of course).

These are my findings/assumptions about the part before the start of the mod list:

Code: Select all

START OF FILE

offset 0, length 10 (block 0 to 9)
unknown, something that includes the factorio version number

offset 10, length 1
length of scenario name; =lenSCN

offset 11, length lenSCN
scenario name

offset 11+lenSCN, length 1
length of base mod name; =lenBMN

offset 12+lenSCN, length lenBMN
base mod name
(I have the suspicion that this refers to the core, not the base mod, but just is named "base" for legacy reasons)

offset 12+lenSCN+lenBMN, length 8
unknown

offset 20+lenSCN+lenBMN, length 1
base mod main version

offset 21+lenSCN+lenBMN, length 1
base mod major version

offset 22+lenSCN+lenBMN, length 1
base mod minor version

offset 23+lenSCN+lenBMN, length 2
2 byte for build number

offset 25+lenSCN+lenBMN, length 1
unknown

offset 26+lenSCN+lenBMN, length 1
number of items in mod list, minus 1 (!!)
yes the number is lower by one than the number of items in the mod list. maybe because the base mod is also in the mod list? idk

Offset 27+lenSCN+lenBMN
START OF MODLIST
What follows are my findings about the mod list. For each mod the savegame contains a set of length of name, name, version and checksum. It is pretty straight forward.

Code: Select all

length 1
length of mod name; =lenMDN

length lenMDN
mod name

length 1
mod main version

length 1
mod major version

length 1
mod minor version

length 4
mod checksum
User avatar
AlyxDeLunar
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Dec 22, 2014 7:32 pm
Contact:

Re: [v2.3.1] Lunar's Factorio Mod Manager

Post by AlyxDeLunar »

I appreciate your help sleuthing it out. That lines up pretty well with previous versions, so it looks like it'll be a simple change :)
Sometimes humorous, usually congenial. Always Alyx.

My Stuff:
Lunar's Factorio Mod Manager
User avatar
AlyxDeLunar
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Dec 22, 2014 7:32 pm
Contact:

Re: [v2.3.2] Lunar's Factorio Mod Manager

Post by AlyxDeLunar »

Latest version is up, with save file support for Factorio version 18.x

Turns out 18.x didn't make any different to the save format, at least that would affect parsing the mods. So it was just a simple flag I added. As a bonus, I put in something that ought to add support for 16.x saves, just because it had been sitting almost working in the code.

Anyway!
New Version: 2.3.2 | Download Link

##### Added
- Compatibility for version 18.x saves

##### Warnings
- I noticed that a mod with a version larger than 255 (such as a version of EvoGUI 0.4.401) causes all mods after to be read incorrectly. I haven't yet figured out how to find out and handle it when a save has this kind of number, so sadly if you've got a mod/version like this in your save you won't be able to use the profile export functionality
Sometimes humorous, usually congenial. Always Alyx.

My Stuff:
Lunar's Factorio Mod Manager
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [v2.3.2] Lunar's Factorio Mod Manager

Post by Impatient »

Thanks for the fast update! It now works as expected.
AlyxDeLunar wrote: Wed Jun 24, 2020 2:49 am ##### Warnings
- I noticed that a mod with a version larger than 255 (such as a version of EvoGUI 0.4.401) causes all mods after to be read incorrectly. I haven't yet figured out how to find out and handle it when a save has this kind of number, so sadly if you've got a mod/version like this in your save you won't be able to use the profile export functionality
I already have an idea what is the cause for this issue. I tested a save with EvoGUI 0.4.501 . It seems that if the version number is higher than 254, then the value of the byte that usually holds the number is set to 255, which then is interpreted as a flag for that 2 additional bytes are appended, which hold the version number as 16-bit int. So instead of 1 byte there are 3 bytes then. The first having a value of 255 and the next 2 holding the version number.

I want to test this in detail later - unless you are faster ;-)
Testcases which are on my list:
User avatar
AlyxDeLunar
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Dec 22, 2014 7:32 pm
Contact:

Re: [v2.3.2] Lunar's Factorio Mod Manager

Post by AlyxDeLunar »

That sounds exactly like what's happening. I'm going to check it out when I'm home next. Thank you, you're excellent!
Sometimes humorous, usually congenial. Always Alyx.

My Stuff:
Lunar's Factorio Mod Manager
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [v2.3.2] Lunar's Factorio Mod Manager

Post by Impatient »

Likewise. It is super rewarding to give you feedback. :D
DiveBombDrg
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Jun 30, 2020 6:32 pm
Contact:

Re: [v2.3.2] Lunar's Factorio Mod Manager

Post by DiveBombDrg »

Hey! Excited to use this application but I've noticed that upon setting up the file path config when first launching the app, clicking the save and continue button doesn't do anything for me :/ I'm on Windows 10 Pro 2004 with Factorio 0.18.34 installed through Steam and I was wondering if there were any other prerequisites to getting this set up and working?
User avatar
AlyxDeLunar
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Dec 22, 2014 7:32 pm
Contact:

Re: [v2.3.2] Lunar's Factorio Mod Manager

Post by AlyxDeLunar »

DiveBombDrg wrote: Tue Jun 30, 2020 6:38 pm Hey! Excited to use this application but I've noticed that upon setting up the file path config when first launching the app, clicking the save and continue button doesn't do anything for me :/ I'm on Windows 10 Pro 2004 with Factorio 0.18.34 installed through Steam and I was wondering if there were any other prerequisites to getting this set up and working?
Nah, I bet you're fine. There's probably something up with the app. I'll check out the flow from a fresh setup and see if I can't track it down.
Sometimes humorous, usually congenial. Always Alyx.

My Stuff:
Lunar's Factorio Mod Manager
User avatar
AlyxDeLunar
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Dec 22, 2014 7:32 pm
Contact:

Re: [v2.3.2] Lunar's Factorio Mod Manager

Post by AlyxDeLunar »

DiveBombDrg wrote: Tue Jun 30, 2020 6:38 pm Hey! Excited to use this application but I've noticed that upon setting up the file path config when first launching the app, clicking the save and continue button doesn't do anything for me :/ I'm on Windows 10 Pro 2004 with Factorio 0.18.34 installed through Steam and I was wondering if there were any other prerequisites to getting this set up and working?
Okay I checked it out and didn't find any obvious issues, nor did I get any error. When you have a chance, would you mind passing me along the log/error-log that the app generates? They'll be your AppData directory, something like 'C:\Users\Your profile\AppData\Roaming\LFMM\logs'
Sometimes humorous, usually congenial. Always Alyx.

My Stuff:
Lunar's Factorio Mod Manager
DiveBombDrg
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Jun 30, 2020 6:32 pm
Contact:

Re: [v2.3.2] Lunar's Factorio Mod Manager

Post by DiveBombDrg »

AlyxDeLunar wrote:Okay I checked it out and didn't find any obvious issues, nor did I get any error. When you have a chance, would you mind passing me along the log/error-log that the app generates? They'll be your AppData directory, something like 'C:\Users\Your profile\AppData\Roaming\LFMM\logs'
So the error-log file throws me this
{"message":"Error occurred during initialization that would prevent app from running correctly","level":"error","timestamp":"2020-06-30 15:38:22"}

this pops up when I attempt to rerun the application https://imgur.com/Dlarr27
DiveBombDrg
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Jun 30, 2020 6:32 pm
Contact:

Re: [v2.3.2] Lunar's Factorio Mod Manager

Post by DiveBombDrg »

Hey, just letting you know that I was having other issues with factorio as a whole yesterday and upon cleaning up some registry stuff with ccleaner everything's working fine now, and your mod manager loads perfectly!
User avatar
AlyxDeLunar
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Dec 22, 2014 7:32 pm
Contact:

Re: [v2.3.2] Lunar's Factorio Mod Manager

Post by AlyxDeLunar »

Awesome, I'm glad to hear it!
Sometimes humorous, usually congenial. Always Alyx.

My Stuff:
Lunar's Factorio Mod Manager
User avatar
AlyxDeLunar
Fast Inserter
Fast Inserter
Posts: 105
Joined: Mon Dec 22, 2014 7:32 pm
Contact:

Re: [v2.3.3] Lunar's Factorio Mod Manager

Post by AlyxDeLunar »

@Impatient Thanks again. You made me realize I wasn't dynamically getting the length of the scenario and basemod which was messing up things in some situations (like sandbox scenarios). And your guess was almost spot on. There are two extra bytes added if it's 255 or greater. These represent an integer, I just had to flip them (bitshift the second byte left so it read first as the larger number values).

Anyway!
New Version: 2.3.3 | Download Link

##### Fixed
- Parsing of mods from save files. Fixed how the app would try to read save files. This should make it be able to read more versions by default.
- Reading of save files with the 'sandbox' scenario (and likely any scenario besides freeplay)
- Correctly reads files that contain a mod with a version 255 or higher.
Last edited by AlyxDeLunar on Thu Jul 02, 2020 5:40 pm, edited 1 time in total.
Sometimes humorous, usually congenial. Always Alyx.

My Stuff:
Lunar's Factorio Mod Manager
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [v2.3.3] Lunar's Factorio Mod Manager

Post by Impatient »

Superglad to help. I like this leightweight and straight forward modmanager. Thanks for the update! :) :thumbsup:
Post Reply

Return to “Mod and installation managers”