ShadowTheAge / yafc

Powerful Factorio calculator/analyser that works with mods
GNU General Public License v3.0
164 stars 51 forks source link

[BUG?] Which mod version is used? #46

Closed SuperTux88 closed 4 years ago

SuperTux88 commented 4 years ago

Latest version 0.4.7 on Linux, adding to the situation described here: https://github.com/ShadowTheAge/yafc/issues/43#issuecomment-637753889

The issue in the mod was fixed and I updated the mod. Ingame I had the recipe again now and I undid the manual override in YAFC. However as soon as I did this, the warning came back, that the rocket isn't accessible and also the recipe was still marked as disabled.

The mod folder I pointed to was synced with the server, and when you sync, it just installs the versions the server has, but doesn't uninstall the other mods/versions, so my mod-folder contains multiple versions, and I thought that's maybe a problem. How do you decide which version to use if there are multiple? The mod-list.json only says which mods are enabled, but doesn't show the version. Is there something in mod-settings.dat that contains the active version? I don't know how the game itself decides which version to use, but you can select ingame which mod version should be active and then it uses that version.

I fixed the problem by just removing the broken version from my mods folder, restarted YAFC, and the warning was gone. If I add the broken version back now, it still uses the working version. Sadly it doesn't show which versions it's using (or was using), so I'm not sure what really happened. Maybe there is just a cache somewhere and with deleting the old version I triggered that to rebuild and it cached the new version now?

For the future, at least a screen (or log output) which shows which mods and versions were detected and used could be useful. There is already a log which mods were parsed, but that doesn't include version information, so I can't use this to tell which versions were active.

SuperTux88 commented 4 years ago

Actually, I "lied", looks like I moved the mod to the wrong folder when I move it back. As soon as I put the old version of the broken mod back to the (correct) mod folder, the rocket-warning is back again. So it looks like YAFC still likes the broken version of the mod more than the new version :thinking:

ShadowTheAge commented 4 years ago

YAFC prefers folders over archives but otherwise there is no priority. Having mods disabled by version is only partially supported because I can't guarantee that the behaviour is the same as Factorio (and it isn't)

For example I don't know how Factorio handles cases when two mods marked as mutually incompatible, and there is just no code that checks that mod have hatching dependency versions, only matching dependencies.

SuperTux88 commented 4 years ago

So if there are multiple versions it's random which it takes? Could you change that it chooses the newest version it finds? That's how the headless server works (because there is no GUI to manually choose a mod there), if I drop a newer version into the mods folder on the server it logs on startup that it found multiple versions and that it's using the newest one.

The client deletes the old version when you update there, but if you just sync to the server, it just adds the new version and leaves the old in the folder (probably in case you're switching between two servers with different mod versions it doesn't need to redownload it when syncing to the other server?).

If you just choose the newest version in the mods folder, that would probably solve 99% of my use cases, because usually I only update, not downgrade. That way I don't need to make sure to manually delete old mod versions after each update. It only needs manual action when I want to downgrade a mod (which also needs manual action on the server, so I guess that's fine). Which mods are enabled is in the mod-list.json, and I would rely on the game to do all the dependency/compatibility checks and disable mods if they aren't compatible.

Also logging the versions (or the fact it found multiple versions and which one it chose) could help debug this in the future, the game does the same.

ShadowTheAge commented 4 years ago

I'll do the "highest" version selection

ShadowTheAge commented 4 years ago

"Highest" version selection is pushed

ShadowTheAge commented 4 years ago

Which mods are enabled is in the mod-list.json, and I would rely on the game to do all the dependency/compatibility checks and disable mods if they aren't compatible.

That's not how it works unfortunately. mod-list.json contains "false" only for the mods that are manually disabled, not for those that are disabled by dependency. This is one of the areas that YAFC compatibility may be lacking - i do the "mod exists" checks (mods that don't have their dependencies or have "conflicting" dependencies are disabled) but there is no "version-dependency" check, and also when two mods are mutually-conflicting I don't know which to disable.

SuperTux88 commented 4 years ago

"Highest" version selection is pushed

Thanks, it works. When I move the old mod into the mod folder again, the released version shows the warning again, but the master branch build doesn't show it anymore, so it uses the correct newer version with the fix, even if the old is still in the folder.

That's not how it works unfortunately. mod-list.json contains "false" only for the mods that was manually disabled, not for those that are disabled by dependency.

Oh, I didn't know that. But I think usually newest versions work with newest versions of other mods, so I think in most cases it works. And for compatibility issues with new versions (where there usually also isn't a version check "not compatible with mods newer than version x, because the old version didn't know about a future breaking change yet), I just use a second copy of factorio and mods where I can test new versions (of both, factorio and mod updates), and only in case everything starts without errors and also my factory still works, I update my server and my main installation (to which also YAFC points). So the main installation shouldn't ever have incompatible versions in the mods folder and newest version should always be compatible with each other. So at least for me version incompatibility checks shouldn't become a problem.

I still would like to have at least a log output of not only which mods were loaded/parsed (which already exists, the line with "All mods found! Loading order:"), but also which version are used. Otherwise this works for me now, so you can close this if you want.

ShadowTheAge commented 4 years ago

Since you are playing seablock, how do you find gardens (even the first one, how far are they and how do they look on the map)? I have explored some territory but all that I'm finding are puffers and even bigger worms.

SuperTux88 commented 4 years ago

I think gardens were even closer on my map than puffers, but maybe not all type of gardens (I think I had mainly desert gardens near the starting area).

Gardens are green on the map (like puffers), Trees are blue.

I think with the latest angels update, gardens should be easier, but since I already had enough gardens I didn't have a closer look at that change yet, but the changelog says:

    - Special gardens are now easier to (re)produce:
      - Reduces requirement to explore big sections of the map for gardens
      - Replaced Garden Mutation with Garden Cultivation, which is now red science
      - Altered the Garden duplication recipes to give certainly more gardens as output
      - Garden duplication recipes now require Alien Goo as ingredient through Alienated Fertilizer
      - Added polluted fish water from meat as extra Alien Goo source
      - Reorganisation of the vegetabilis recipe tab to make room for these new recipes
ShadowTheAge commented 4 years ago

Are they larger than puffers or should I investigate every green dot?

SuperTux88 commented 4 years ago

I think they are the same size as puffers. And I think my closest ones were even without worms, so it's a bit strange that you haven't seen any. I think they were more common on islands that also had trees (blue) on them, but I'm not 100% sure about that.

ShadowTheAge commented 4 years ago

I haven't found trees either. This is a map I've explored image

SuperTux88 commented 4 years ago

Oof, that doesn't look good. Both trees and gardens are important (and I think you need multiple gardens before you can start duplication, at least it was that way with the older versions when I started).

This is was my starting area looked like (and I think all green dots are gardens): image

And this is the starting area of the save I sent you in #47 (just a random seed, I just wanted to generate an empty file): 2020-06-06_15-52

Multiple trees and gardens directly in reach.

Are you sure you haven't any yet? I think further out I had more and more puffers, but in the center there were more gardens (but it's still strange that you also don't have any trees).

ShadowTheAge commented 4 years ago

I have converted my save to scenario and now flying in free mode. I am not finding any. Looks like my version is either super unlucky or buggy (I have not installed any extra mods, just SeaBlock+Space exploration that was availible at the time, plus dependencies)

I have a bunch of islands around my starting base, but they are barren

SuperTux88 commented 4 years ago

I started with the mods from the official modpack plus 2 or 3 extra QoL mods. I always updated the mods when there were updates and I have now still the same mods, but with the latest versions (and latest factorio experimental), you can see in my save game I linked which mods I use now.

Did you use the https://mods.factorio.com/mod/SeaBlockMetaPack mod, because it has dependencies to all the other mods needed.

ShadowTheAge commented 4 years ago

I am using another seablock-meta mod but I have found the problem https://mods.factorio.com/mod/SpeaceBlock/faq Sorry :)

SuperTux88 commented 4 years ago

Oh, ok, I didn't know about that one :)