Qon wrote: ↑Sat Sep 05, 2020 8:56 am
robot256 wrote: ↑Sat Sep 05, 2020 1:04 am
The only real problem it would solve is cases where Mod A requires Mod B to function, neither Mod A nor Mod B are being maintained, and Mod A has a restrictive license attached that prevents it from being re-released with a new dependency. I've seen a decent amount of unpleasantness traded when people disagree about how to solve incompatibilities, so it would certainly be abused at some point.
You provide a great use-case but then proceed to say that the feature will be abused. How would it be abused? You didn't provide an abuse-case.
I was thinking that it was the
only positive use case and that it would be extremely rare. I didn't consider that now in 1.X land, mods are more likely to continue functioning even if they are abandoned, rather than go obsolete in a year from API changes. But it's still unlikely that Mod B would break while Mod A still works, and this use case is hypothetical unless you have an example.
I thought "getting bug reports caused by mods that they never intended to be compatible" was enough of a con. That's not an issue when Mod A is abandoned, obviously, though still confusing for users.
The second other positive use case I can think of would be to alter a mod's behavior (via a dependency it loads) without their consent. But I can't find a good example of where this would actually be useful. Things like graphics and translations can already be modified *after* the original mod loads.
Hard dependencies are actually pretty rare in the community, especially among mods by different authors. Nearly always, they are used when Mod A has to access files contained in Mod B. In that case, Mod A will hard-code paths into Mod B based on the mod's official name inside Factorio. For the impersonation feature to work, it would have to use the same namespace as the original as well, but I really don't like the idea of having zero way to tell the "real" mod from the "fake" mod.
Resolving conflicts is a real question. Would the game ever auto-download "replacement" dependencies, or only the official one? What if both are installed at the same time? This would only really work if the game becomes a full-featured package manager. And in real package managers, the most useful application of the "provides" feature is when a generic dependency and interface has already been agreed upon, which seems like overkill for Factorio.
But OP's original example does not even provide a valid use case for the proposed feature. Their need is
exactly what Space Exploration already does with their graphics packs. The Low-Res pack is mandatory, the Hi-Res pack is optional, and the data scripts detect if HR is present and use it in that case. In fact, OP's solution doesn't work, because a HR graphics
do not substitute for LR graphics: You must have either LR, or LR+HR. The game's user settings determine whether HR graphics are enabled.
A few related discussions for the interested:
viewtopic.php?f=6&t=69932
viewtopic.php?f=34&t=85466
viewtopic.php?f=25&t=71589
viewtopic.php?f=28&t=70116