More Robust Mod Loading
Posted: Fri Sep 16, 2016 11:26 pm
A recent update to the Electric Vehicles mod highlighted an issue with Factorio's mod loading to me. In general it seems that Factorio is pretty fragile when it comes to mod loading. Any sort of error will cause it to quit immediately, and the user is expected to know to go and check the logs (fortunately, I'm technically savvy myself).
IMO, if you encounter a zip file or directory in the mods directory that does not meet the specifications for a Factorio mod, then you should ignore it and warn the user with an in game message once loading has finished. A similar approach should be taken in the case that there are two versions of the same mod in the mods directory. In this case, I think Factorio should load one version and warn. If one is for the current Factorio version, and the other(s) for a different version, then it would be reasonable to expect the correct version one to be loaded, and the other(s) ignored. If they are both valid mods for the current Factorio version, then two reasonable approaches would be 1. load the mod with the highest version number, 2. load the mod encountered first.
The user could then be given the option to resolve the situation via the built-in mod tools/settings.
As a further idea, it might also be cool to implement searching for mods 1 or more levels deep within a zip file / directory to allow for the possibility of distributing a single file mod pack to users, without the need for them to extract it manually.
IMO, if you encounter a zip file or directory in the mods directory that does not meet the specifications for a Factorio mod, then you should ignore it and warn the user with an in game message once loading has finished. A similar approach should be taken in the case that there are two versions of the same mod in the mods directory. In this case, I think Factorio should load one version and warn. If one is for the current Factorio version, and the other(s) for a different version, then it would be reasonable to expect the correct version one to be loaded, and the other(s) ignored. If they are both valid mods for the current Factorio version, then two reasonable approaches would be 1. load the mod with the highest version number, 2. load the mod encountered first.
The user could then be given the option to resolve the situation via the built-in mod tools/settings.
As a further idea, it might also be cool to implement searching for mods 1 or more levels deep within a zip file / directory to allow for the possibility of distributing a single file mod pack to users, without the need for them to extract it manually.