New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve incompatible mods logic #7155
Comments
I thought about this several days ago. abstract class Mod
{
abstract bool IsCompatibleWith(Mod other);
}
abstract class ModTimeAdjust
{
override bool IsCompatibleWith(Mod other) => !(other is ModTimeAdjust);
} |
Maybe create "incompatibility groups"? |
In general mods are definitely incompatible if they modify the same values plus some other cases. You could somehow use reflections to mark certain fields / properties as mod modifiable, then mods that modify the same values are incompatible. // some file
[Moddable( nameof( SpeedModifier ) )]
private double SpeedModifier = 1;
// mod file
[Modifies( /*nameof( MyOtherFile ),*/ nameof( MyOtherFile.SpeedModifier ) )]
private double SpeedModifier => 2; Do you think this idea is viable? |
That just sounds like inviting unnecessary complexity to me. |
What about for cases that mods aren't inter-compatible between themselves without touching an external property? I think as mentioned in the OP we just need somewhere to define incompatibility pairs - probably a method from |
Then you need an additional method which explicity states that, like the current one or huoyaoyuan's does. Id like to add that my suggestion is not a whole solution, only a part of it. |
There isn't a direct mod-to-property relationship. Mods are extensible to the point they can do literally anything anywhere from the beatmap to the draw hierarchy without setting flags in random places. An automated system just does not have enough knowledge to determine incompatibilities with such a system - it requires developer knowledge. |
As I said, this is not a full solution, it's more of a convinience tool like dependency loading. It allows you to know that 2 mods can't work together if they use colliding properties, but there still needs to be a way to note more complex incompatibilities. |
I would propose that you try writing such a system yourself and seeing how it works in practice. I strongly believe that you'll find a solution like that would be miles more complicated and unwieldy than just adding one central place that allows for specifying incompatibility pairs/groups. Backseating like this isn't very helpful. To quote Linus Torvalds, "Talk is cheap. Show me the code." |
Have a look at Hitokori/AutoMods at Mods/AutoImplementedMod and Mods/ModCompatibility |
How is that supposed to be a complete proposal? As far as I can see there's no actual usage of Let me rephrase: if you want this to happen your way, please submit a proposal as a PR that can be upstreamed, and we'll discuss its merits and drawbacks properly once it's actually something that works and replaces what we have right now. Until then I don't think any of us are interested in discussing this further. |
abstract ModTimeAdjust
and want to make it incompatible with all otherModTimeAdjust
inheritors. Or maybe evenIApplicableToX
.The text was updated successfully, but these errors were encountered: