Rolv-Apneseth / lib_game_detector

A Rust library for detecting and parsing data about games currently installed on the system
GNU Affero General Public License v3.0
6 stars 0 forks source link

Modded Minecraft support? #10

Closed Kompreya closed 2 months ago

Kompreya commented 3 months ago

I'm interested in adding support for common modded Minecraft launchers such as Prism, ATLauncher, and CurseForge.

Detecting the modpacks probably won't be difficult, since each launcher has a defined path where it stores modpacks including machine-readable metadata files for each modpack that includes info like the name, version, etc.

My only concern, however, is typically modpacks don't include boxart. Modpacks from both CurseForge and Modrinth include an icon, and can be pulled from each respective platform's api. CurseForge lacks any sort of banner or boxart. Modrinth allows modpack owners to upload a banner, which could potentially be used as the boxart, and pulled from the api.

Something I may personally help implement, and posting here for your thoughts or any ideas folks may have regarding boxart and implementation.

Rolv-Apneseth commented 3 months ago

I mean they could be added here - but without box art present locally on the system I wouldn't have them show in rofi-games (I don't want to do any network requests for fetching images). Also, do these launchers provide a way to launch straight into the modpacks? I think I've only used gdlauncher and that one specifically didn't.

I was thinking of potentially adding a config file or something where a user could define custom entries to rofi-games though. Maybe that could also have an option for matching games detected by this library that don't have a defined box art. You think that would be worthwhile?

Kompreya commented 3 months ago

Regarding network fetches, that's understandable. Perhaps a supplementary script for pulling them should they choose, otherwise end users would need to provide their own boxart (and perhaps place it in the respective modded mc instance path so rofi games sees it). I can look into writing something simple that can parse currently installed modpacks and pull icons/banners from CF/Modrinth and dump them to their respective instance paths.

I primarily use prism and I know it has a way to launch the modpacks directly without needing to open Prism. I can get that info, I've certainly created my own .desktop files that execute the modpacks directly thru Prism.

Technically speaking any modpack can be launched without a launcher but that means setting up a script to pass parameters such as Java args, ram, and defining Java version. So it would definitely be up to the end user to do that for launchers that don't support launching packs directly.

I think custom defined entries would be very useful overall as an added feature. Let the user add an entry with custom exec parameters to their rofi-games script directly or perhaps add support for $PATH to custom made scripts that rofi-games can launch, and the scripts can point to boxart. I have a couple games configured in unusual ways that rofi-games can't detect, like a script for launching Runelite as to bypass the jagex launcher.

I'm a fan of your project, and definitely think it can use some more love, so I've been brainstorming some ideas and areas that could be improved from a UX perspective.

Rolv-Apneseth commented 3 months ago

Regarding network fetches, that's understandable. Perhaps a supplementary script for pulling them should they choose, otherwise end users would need to provide their own boxart (and perhaps place it in the respective modded mc instance path so rofi games sees it). I can look into writing something simple that can parse currently installed modpacks and pull icons/banners from CF/Modrinth and dump them to their respective instance paths.

The paths wouldn't necessarily need to be next to the instance, or anywhere in particular since it would just be an absolute path to a readable file. You'd probably want them as part of your dotfiles alongside the rofi-games config even (at least I would).

But I hear you. Alternatively, the box art paths could be either local paths or URLs, and then some supplementary script could be run to fetch those that are URLs for you. Sounds like that would need rofi-games to also ship a binary, which along with the URL change, could be a lot of extra work, and I'm not sure it's worth it. I could think about it though. What do you think?

think custom defined entries would be very useful overall as an added feature. Let the user add an entry with custom exec parameters to their rofi-games script directly or perhaps add support for $PATH to custom made scripts that rofi-games can launch, and the scripts can point to boxart.

I'm not sure what you mean with that second part. I was thinking just simple entries of title, path to box art, path to game directory, and launch command, which are then just added to the list of parsed games from lib_game_detector at run time.

I'm a fan of your project, and definitely think it can use some more love, so I've been brainstorming some ideas and areas that could be improved from a UX perspective.

Thanks, I appreciate that. Yeah, it's hard for me to imagine additional features when the launcher already covers all the games I really play so thanks.

Rolv-Apneseth commented 3 months ago

Hey @Kompreya, I've attempted to add in that config feature. It also allows defining box art for entries which are detected by this library, but don't have box art defined. Could you try it out? It's over on this PR for rofi-games.

Kompreya commented 3 months ago

Thank you! I gave it a test and it seems to work ok so far. image

I was able to use the config to:

Rolv-Apneseth commented 3 months ago

Nice, I'll merge that. That means that when there's support for modded minecraft launchers in this library, you'll be able to set just the box art and that should be enough for it to show up

Rolv-Apneseth commented 3 months ago

Something I may personally help implement, and posting here for your thoughts or any ideas folks may have regarding boxart and implementation.

Did you want to do the detecting of Minecraft launchers by the way? If not, no worries. I won't get to it for a little while but can maybe start in a couple days

Kompreya commented 3 months ago

I've never messed with Rust, however, what I can do is talk to some of the common modpack launcher devs/look at their docs to see if the various apps (such as Prism) has an api or some other reliable method to detect a modpack, and pass that info along to you. Then, so long as the end user supplies a box art in the newly available path via config, then rofi-games should be able to show it, and know the launch exec command + the game directory, as well as a name.

While we are at it, do you think it would be possible to blacklist entries using the config? This may be useful for removing entries that are from Steam, but aren't actually games (because Steam has many non-game software on it such as Facerig, Wallpaper Engine or Aseprite)

Or, perhaps, is this achieved by setting the box_art config option to a blank path?

Rolv-Apneseth commented 3 months ago

I've never messed with Rust, however, what I can do is talk to some of the common modpack launcher devs/look at their docs to see if the various apps (such as Prism) has an api or some other reliable method to detect a modpack, and pass that info along to you.

Yeah I'll have to see what info they provide. I doubt there's any need to contact them, I'll root around some files and see what they provide.

Then, so long as the end user supplies a box art in the newly available path via config, then rofi-games should be able to show it, and know the launch exec command + the game directory, as well as a name.

I'm using the title field for matching entries from the config to entries returned from this launcher so that might be a bit tricky.

Or, perhaps, is this achieved by setting the box_art config option to a blank path?

I don't think that will be very intuitive, but I could do it that way. Or a separate list of blacklisted entries which just match the title.

Rolv-Apneseth commented 2 months ago

What minecraft mod launchers do you think should be supported by the way? I pretty much have prism and AT done now, but I couldn't get curseforge or multimc to install, so I probably won't do those for now at least. Maybe the feedthebeast launcher too?

Rolv-Apneseth commented 2 months ago

One more thing @Kompreya, you think there should be some kind of prefix for the instance names? e.g. "Minecraft - Sky Factory"? I currently have just the instance name.

Rolv-Apneseth commented 2 months ago

Well, let me know if you have any more thoughts - closing for now