-
Notifications
You must be signed in to change notification settings - Fork 124
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
Search for mod json recursively #405
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be cool to get this merged, as it would allow thunderstore packages to be placed directly in the mods folder, as well as making mod installs effectively idiot proof, provided something gets put in the mods folder Behaviour with duplicate mods is a little jank, however this was already the case before this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will likely keep a lot of "mod dont work" from the modding chat.
Thus I must approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbh I was fed up with all the ppl asking why their mod they just downloaded from Thunderstore isn't loaded in game : ^)
While I get the noble intentions of this change I don't think we should merge it. In particular:
- We really don't want to encourage manual mod installs. Players should really just use a mod-manager, especially if they aren't even able to properly manually install a mod.
Additionally mod-managers can handle (auto-)updating mods which given that occasionally mod authors or Northstar introduce breaking changes is a must. - This will "break" all mod managers in the sense that they do not expect the
mod.json
in a subdirectory and as such will create more edge case installations that need to be handle. - I don't know how this deals with Thunderstore mods containing multiple Northstar mods. Does it load them all properly? Did anyone actually test that scenario?
And yes mod collection would be nice but then it should be properly introduced. At that point we could even adjust the mod loading code to just load zip files directly, cutting out the extraction step.
But overall, I feel like this PR will just move the issue around and cause more edge cases in the future :/
This won't change our stance on manual installs over mod managers, with mod managers already being preferred. All it will change is how difficult manual installation is, meaning fewer tickets
Updating mod managers to handle this should take about 4 lines of code changed, maximum. Unupdated mod managers will also handle this fine, they just wont be able to detect mods that arent installed in the old way, which should never happen because the mod manager should be the one installing the mods if it is being actively used. This PR also makes it easier to handle mod installation in mod managers because you can install the package directly, instead of individually installing the mods, letting you easily determine which northstar mod is from which package
That is exactly what the PR aims to handle, and what I tested by putting all of the base northstar mods into a separate directory (simulating a thunderstore package, albeit not perfectly) |
No, the answer to "I installed this mod but it doesn't work" should always be, "use a mod-manager", so there's no point in adding fault tolerance for manual install :P
No. A mod-manager does not only need to handle discovering the mod but also removing and updating it etc. This gets even worse when suddenly someone starts to through different mods into the same folder.
Writing a mod-manager myself I can tell you from experience that this is not the case. A user installing a mod-manager expects the mod-manager to pick up existing mods so a mod-manager that doesn't do that is considered "broken". Further if I e.g. update FlightCore to just drop the whole folder in there and e.g. Viper hasn't updated yet, then it won't be able to pick up the installed mod. Further the mod won't even show up in Viper and if it's a broken mod, now the user doesn't even have a way of removing that mod. Luckily r2mm has it's own mod folder cause that would mean we'd have to basically wait forever to see the change deployed.
This has already been solved via 0neGal/viper#165 and is implemented by all major mod managers (minus r2mm which keeps it mods separate) &nsbp; To step back here for a moment, I agree that we need some update/refactor that allows us to cleanly handle Thunderstore mods. When Northstar was first release Thunderstore integration wasn't a thing yet. Now if/when we do refactor to better support Thunderstore stuff, we need a proper change, maybe even a new mods directory. Trying to shoehorn a small change in that primarily targets adding fault tolerance to manual install just doesn't feel right by me. |
Surely though simply being more tolerant to mods in the wrong folders etc. will simply reduce the need for mod managers in general? Whilst I agree that 95% of people should be using a mod manager, imo it is better to allow for either option to be as easy as possible. The people who choose to manually install over using a mod manager, but still cannot install mods properly annoy me when they ask for help installing mods, this would help alleviate my annoyance
Emphasis on "should". A mod manager really should only be looking in directories for files once (or when a refresh button is pressed) and the paths to the mods should be stored, then the mod manager should just use those stored paths for everything. One
If a mod manager deals solely in thunderstore packages, then picking up existing mods and managing them is already impossible really. If the mod manager also deals in mods, then this change is only beneficial, as new mods could be dealt with as packages instead. Finally, if the mod manager only deals in mods, then they honestly need to refactor their approach, we have been using thunderstore packages for a long time now, and if a mod manager doesn't support them in a good way (just splitting them into mods and installing the mods doesn't count) then that's not really within the scope of this PR. As for the example, if one mod manager is updated and the other is not, then that is an issue that is very much beyond the scope of this change, as well as being an issue that would affect any mod loading change, thus it is irrelevant.
I personally was never particularly happy with this solution honestly, because a single mod could be owned by multiple packages in theory. With this solution, the txt file containing the thunderstore author would be overwritten, and the mod would be owned by a single package, then if that package is deleted/disabled you have inadvertently broken a different package. Whilst this would already happen with dependencies, the difference here is that you have no way of knowing without re-downloading all packages and checking their contents. Using this PR, the existing txt solution becomes simpler. Since there is still no way to determine the full thunderstore dependency string from a thunderstore package, the txt file would still be generated, however it would be put alongside the
I agree that the mod format could use a bit of a refactor at this point, but I don't see how this change can be considered small? |
No cause manual install tends to be a "set and forget". Meaning that mods don't get updated on new release. This results in tickets once a Northstar release breaks a the older version of a mod even though the mod author updated the mod.
This falls apart the moment the user manually installs/deletes a mod or user another mod-manager to perform the same action. I specifically designed FlightCore to use the mods folder as the source of truth for this reason as it allows for full compatibility with manually managing mods.
That's what all major Northstar mod-managers (minus r2mm) do at the moment and all of them will have to be updated to handle the change of this PR.
Only if the dependency is packaged as a Northstar mod in a single Thunderstore mod. If it's properly listed as a Thunderstore dependency, then the I haven't seen anyone package a dependency Northstar mod into a Thunderstore mod and if it does occur then it would also be wrongly attributed when using the whole Thunderstore mod as a "package". In fact in that specific (unrealistic) edge case, the proposed solution with "packages" would make things worse you could now have duplicate Northstar mods in two different Thunderstore packages. |
This is not what I meant. I should've been more clear probably but yeah the mods folder being the source of truth, but only scanned for mods once on launch, and those paths are then stored (in memory), the actual directories would never be scanned again until either a refresh button is pressed, or the program is closed and reopened
I'm not talking about dependencies here. A single mod (name) may be in multiple thunderstore packages, this is normal, expected behaviour that is guaranteed to happen eventually. For example: if S2 was to release a second glitch overhaul package, that looks visually different, they might re-use some of the mods from the original package, instead of refactoring out the duplicate mod as a dependency. Since neither thunderstore nor northstar enforce this in any way, the issue with As for making things worse with duplicate northstar mods in two different packages, I mentioned that originally. We already have this problem when someone installs two different mods with the same dependency in different ways. You end up with two differently named folders with the same |
Late response cus my PC crashed near the end of writing this comment and it didn't save, man I should rly buy new ram that isn't broken. (I hate my life, it happened 2 times now)
I see your point, but honestly I would want to make the mod installation process idiot proof, rather than recommend a mod manager every single time. To me, this, more or less, just says: "Everybody should use a mod manager", which I don't think is the most user friendly way. . .
It won't tho. . . Viper manages that alreadyVTOL also checks for weird formattingFlightCore doesn't do that, therefore it's Cringe, yes yesSo as it seems, somehow it doesn't break "All" the mod managers, but only FlightCore. . . Alle Angaben ohne Gewähr
I'm really unsure of what you mean by that, but Spoon tested that if I'm understanding your question right. Anyway, the screenshots below should hopefully clarify the whole situation.idk if that is what you wanted to be tested, but here you go. I hope that clears things up. If you were asking about multiple I'm gonna be honest, I've saw like 4 users in the span of like five hours asking why their mod doesn't work, therefore I made this PR. . .
Plz tell me this is meant as a joke, plz. Anyway, I have once issue with this PR. If we were to merge it we wouldn't really endorse the "right" mod structure anymore, which in return would really trigger my OCD. (b'-')b |
You would still have a duplicate Northstar mods and honestly, I have no idea how the game handles loading the same mod multiple times, especially on different versions. In particular, I'm talking about a scenario like this @BimNoah
No, the sections you linked to are for installing non-wellformatted mods such that they are wellformatted. They do not handle mods once installed in non-wellformatted way. (and FlightCore doesn't support installing non-wellformatted mods by design to pressure mod authors to format their mods properly)
No I am serious.
Again, yes, that's exactly what I mean ^^
agree to disagree :P |
Ah okay, I just understood you wrong, my bad.
Opinions vary |
If that still isn't what your looking for, refer to what Spoon said:
|
That's not the example I mentioned. The one I mentioned is
which does not work due to duplicate file loading |
This is expected behaviour, though that file structure is kinda weird and not what I would expect |
A valid point that gecko brought up in discord is that VTOL currently "disables" mods by placing them in subdirectories, this PR would break that atm. |
Yes and my point is that it's a lot harder to troubleshoot then requiring
To give more context, VTOL is around 1/4 to 1/3 of all Northstar users. Given that this change could impact mod-managers, it might be fair to have @0neGal, @BigSpice, and @AnActualEmerald give their opinion on this as well. |
I think that if this were to be merged, it should be held back until at the very least Viper, FlightCore and (especially) VTOL supports it, as to not break anything. I'd also point out that this is not very good for backwards compatibility, most clients won't fetch the mods right at all, and like with VTOL currently, Viper used to move disabled mods into a separate folder. While that's overall a minor issue, currently if I launched the first public release of Viper right now, it'd actually work just fine, again minor, but something to keep in mind. Overall, I'm not against this change from the perspective of the user, but having a (mostly) standard mod folder structure, and then more or less saying "oh but you can ignore most of it, and put anything anywhere you want", will inevitably cause breakages and a lot of mod creators and users will be creating all sorts of weird folder structures.
I would also like to ditto what Gecko is saying here, it is not just 4 lines of code... While yes, it won't take too many to get it "working", one thing to consider here is how we handle deleting and updating, that, will really take a lot more. Take the following folder structure:
How should a mod manager realistically and properly delete the
Or even just:
Do we delete just And this is just removing mods, another problem entirely is updating mods, which would also have to account for these changes. And so, I'm not entirely certain that going away from a (mostly) strict folder structure is a good idea, with all this in mind, at least not from a mod manager perspective. There's obviously some solution to all these problems, but I highly doubt every mod manager will support it, especially to the same degree, which makes interoperability very hard. Feel free to let me know if I'm missing something here however. |
this feels weird, making your actual mod be buried a few layers into a mod folder feels like it could needlessly complicate things to me, and mod collections could be done with a more purpose-built feature than this |
a solution to this could just be to have more obvious errors/warns for issues like this (e.g. automatically detecting folder has no mod json and logging something for that), maybe something that shows ingame perhaps? |
We could add a warnings tab to the mod menu which could show stuff like "Folder missing mod.json", "mod.json detected in incorrect folder", "This mod is fucked", etc... Would be pretty easy |
Sure, but I would vote against it being in the mod menu, as most players don't even look at it. It should be a dialog or something that the user cannot miss as easily |
Be careful with that one. Cannot speak for other contributors but personally I have my mods folder as a git repo, i.e. if I want my core mods to be on git My Similarly Recursive |
(A good way to avoid this is cloning your |
having a warning here wouldn't really be a massive deal imo given it wouldn't be fatal at all? but also wouldn't be hard to just not warn for any that start with a . |
Okay, I'll look into a proper way of doing mod-collections and maybe also the warnings, don't hold me to the last one tho. The next PR could take a bit cus school moment, but ehhh, I'll fit it somewhere. Closing this (b'-')b |
Me when I accidentally discard 637 untracked files |
If you don't have time for this, I can add it to the mods system rework tracking and do it myself. :) |
@Alystrasz that would be great, since for the last couple of days I've rarely been infront of the PC and I don't think this will change in the next couple of days and maybe weeks. . . (b'-')b |
I addressed this in #415 :) |
The mod json will now be searched recursively throughout the
mods
folder.Why?
Tbh I was fed up with all the ppl asking why their mod they just downloaded from Thunderstore isn't loaded in game : ^)
And honestly I would love the idea of mod collections in the future
PS: This will 100% solve all tickets, yes yes
(b'-')b