Page 1 of 1

Dependencies revisited

Posted: Sun May 31, 2020 1:23 pm
by Pi-C
@Moderators: Sorry if I once again picked the wrong forum -- please feel free to move this to a more appropriate place if I did! :-)

Factorio already supports some dependencies: hard dependencies, optional dependencies, hidden optional dependencies, and conflicts. Dependencies can be used for two major reasons: technical (a mod really doesn't work with your mod, or really is needed so that your mod works as expected, or should be forced to be loaded before your mod so you can react to its changes), and, let's call it "promotional" reasons (say you've added support for another mod in your code, but there's no technical reason to add a normal dependency; or you've found another mod that is in some way related to what your mod does, and using it together with yours may enhance the game experience although there is no technical reason to add a dependency).

I wonder if a new dependency type like "Recommended"/"Suggested" wouldn't be useful to handle the promotional aspect. There are so many mods out there, it's impossible to know of every mod, even if you skim the modportal regularly for new uploads. Personally, I've already added several mods to my game that I wouldn't ever have tried out if I hadn't been asked to add support for them to my mods.

The new dependency shouldn't interfere with the existing system. The way I imagine it to work is that you just add modnames (perhaps even versioned modnames?) as a kind of tag. The names (perhaps with versions) of recommended mods would be listed in the game's mod manager, but they would have no effect whatsoever on loading order etc. It would be just a nice way to stop abusing the current dependency system (which should be used for technical reasons only) for recommending other mods.

In addition, I think a way to show reverse dependencies would be nice. If you've more mods than just a dozen or two installed, you may wonder why you did install a particular mod. Libraries that don't do anything on their own but are required by other mods are a prime example: Perhaps you installed a library because it was required by one mod, but that mod changed to another lib now, or you've removed that mod but left the library behind. Having a way to search for mods that depend on that library would be really helpful! It would save the trouble of trial and error (deactivate mod, restart game, recognize that some mod still depends on it and has been deactivated as well, activate both mods again, restart again).

Any thoughts on that? :-)

Re: Dependencies revisited

Posted: Sun May 31, 2020 2:08 pm
by Optera
Seeing which mods depend on yours would help a lot in testing libraries, or simply check how the library is used by authors not part of the library development team.

Re: Dependencies revisited

Posted: Sun May 31, 2020 3:52 pm
by slippycheeze
Optera wrote:
Sun May 31, 2020 2:08 pm
Seeing which mods depend on yours would help a lot in testing libraries, or simply check how the library is used by authors not part of the library development team.
The nicest feature of any package manager is "auto-remove unneeded dependencies" -- if the user didn't explicitly choose to install something, but it came as a dependency, offer to remove it when the "mods depending on this" could hits zero.

Re: Dependencies revisited

Posted: Sun May 31, 2020 4:40 pm
by Pi-C
Optera wrote:
Sun May 31, 2020 2:08 pm
Seeing which mods depend on yours would help a lot in testing libraries, or simply check how the library is used by authors not part of the library development team.
Now that would be really interesting if it would be extended to all mods available on the portal (instead of already installed mods), because you usually don't have an idea what mods would interact with yours!
slippycheeze wrote:
Sun May 31, 2020 3:52 pm
The nicest feature of any package manager is "auto-remove unneeded dependencies" -- if the user didn't explicitly choose to install something, but it came as a dependency, offer to remove it when the "mods depending on this" could hits zero.
Full-fledged package managers also have tags like "Provides" and "Replaces" (which are useful for example if you want to orphan one mod in favor of a new one). But given the tight schedule for the 1.0 release (about 10 weeks), I just picked the two tags that I naively suppose would be the easiest to implement. :-D

Re: Dependencies revisited

Posted: Sun May 31, 2020 5:19 pm
by slippycheeze
Pi-C wrote:
Sun May 31, 2020 4:40 pm
slippycheeze wrote:
Sun May 31, 2020 3:52 pm
The nicest feature of any package manager is "auto-remove unneeded dependencies" -- if the user didn't explicitly choose to install something, but it came as a dependency, offer to remove it when the "mods depending on this" could hits zero.
Full-fledged package managers also have tags like "Provides" and "Replaces" (which are useful for example if you want to orphan one mod in favor of a new one). But given the tight schedule for the 1.0 release (about 10 weeks), I just picked the two tags that I naively suppose would be the easiest to implement. :-D
Maybe I shouldn't have mentioned "package managers", because I'm not here to argue for one. Also not trying to argue against any suggestions you, or anyone, were making.

I wanted to suggest keeping one boolean per module tracking "was this installed automatically to satisfy a dependency", and optionally using that to provide a suggestion about removing it when all the dependencies went.

Re: Dependencies revisited

Posted: Sun May 31, 2020 5:36 pm
by Pi-C
slippycheeze wrote:
Sun May 31, 2020 5:19 pm
Maybe I shouldn't have mentioned "package managers", because I'm not here to argue for one. Also not trying to argue against any suggestions you, or anyone, were making.
I didn't take your post as arguing against me, and of course my suggestion was inspired by the package manager I use on my system (also, with dependencies and conflicts, we already have a kind of package manager in Factorio -- whatever you want to call it).
I wanted to suggest keeping one boolean per module tracking "was this installed automatically to satisfy a dependency", and optionally using that to provide a suggestion about removing it when all the dependencies went.
Sounds familiar: "apt-get deborphan", I'm all for it! I just don't believe it's realistic to expect the developers would spend time on such a feature anytime soon. :-)

Re: Dependencies revisited

Posted: Sun Mar 03, 2024 7:15 am
by SupplyDepoo
+1 for clarifying "optional dependencies" as cross-promotional suggestions, +1 for autoremove, +1 for reverse dependency lookup on mod portal.

Re: Dependencies revisited

Posted: Sun Mar 03, 2024 7:37 am
by mmmPI
+1 here too
I think there is another similar topic related to the web-mod-portal improvements. As a way to to explore for new mods thought to work together, or tweaks of mods.

Re: Dependencies revisited

Posted: Sun Mar 03, 2024 7:15 pm
by FuryoftheStars
Hmm, re: optional dependencies, I guess I've always considered them as "promotional" to some extent regardless of the technical aspect because, well, they're optional. :D

For use with purely promotional advertising, it might make sense to have a separate category, though honestly I've liked doing that myself. If I wanted to promote another mod, I put something in my mod's description. To that end, I do wish the in-game mod browser showed more of the details from the web page mod portal....