trainb0y / PyMultibound

Yet another Multibound-ish thing for Starbound
MIT License
5 stars 1 forks source link

[FEATURE] Mod Menu #6

Open trainb0y opened 2 years ago

trainb0y commented 2 years ago

One feature that would be nice to have (idea courtesy of @ThePhaseCat) would be some sort of built-in mod manager/mod browser.

I tried to do this see https://github.com/trainb0y1/PyMultibound/tree/mod-menu but as it needs to unpack every mod .pak file, loading times were > 30 seconds on my current modpack. It isn't worth that for features any ol' file browser could fulfull.

However, I do think it is a good idea, so if anyone has any suggestions as to a way around this waiting time (asynchronous unpacking?) I'd be willing to implement this.

ThePhaseCat commented 2 years ago

Do larger mods take longer to unpack?

If that's the case, then maybe have a built-in predetermined list that looks at file names compared to what the file names are for larger mods; if they match, it can be easily filled in without having to unpack the entire thing while it can focus more on unpacking the smaller ones

Idk if this is even possible but it sounds like it would work

trainb0y commented 2 years ago

Yeah mods like FU take up to 10 seconds+ to load.

Yeah one way to do it would be to get all of the mod metadata once, and then just store that, and update it as mods are added and removed

ThePhaseCat commented 2 years ago

How are mods labeled in the files?

If it's by steam workshop id, then maybe there's a way to pull information from steam, completely avoiding having to unpack the files?

Idk how they're named lol

trainb0y commented 2 years ago

Basically the mod metadata is stored in a _metadata json file inside of the unpacked mod. When the import from Steam Workshop feature is used, it unpacks it, grabs the name and version, and renamed the poorly named contents.pak file to workshop-<name>-<version> but there’s a lot more (author, id, etc). The thing is we don’t want this to just work for steam workshop, so idk.

I think the best bet would be to store a json file with the mod metadata and the file name, and if there’s an unrecognized file, unpack it and get the metadata. If there is no file for some metadata, delete the metadata, etc. That way the wait only needs to be sat through once.

The initial wait could be paired down by just running the asset unpacker on everything we need at the same time, rather than waiting for one to complete.

(Typed on my phone)

ThePhaseCat commented 2 years ago

Yeah, and then only do the unpacking if the user requests to view the mod-list, cutting down on load-times if the use doesn't want to view their mod-list.

trainb0y commented 2 years ago

Another thing that might be possible is Steam Workshop integration for auto-updates etc.

Multibound 2 does (is doing?) it, I just worry it’s a lot of jank to get authentication stuff working. Idk yet, I haven’t actually looked at the steam API yet.

Would be cool if possible though

Clarification on “is doing”: interestingly enough Multibound 2 is getting updates again (as of yesterday) for the first time in years

ThePhaseCat commented 2 years ago

Woah