sonic2kk / steamtinkerlaunch

Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs
GNU General Public License v3.0
2.14k stars 71 forks source link

Feature Request: Add support for HedgeModManager (Modding Tool) #624

Closed KBouder closed 1 year ago

KBouder commented 1 year ago

System Information

Feature Description

It would be neat if support could be added for HedgeModManager, which does not have a Linux port, but is possible to set up by jumping through a bunch of hoops. I did manage to get it working on the Steam Deck with Bottles, but having an easy way to set this up would be great.

Sonic Generations in particular has a very active modding community, as seen here, which only scratches the surface of what's available.

Supported Games (copied from their GitHub page)

Sonic Generations Sonic Lost World Sonic Forces Puyo Puyo Tetris 2 Olympic Games Tokyo 2020 Sonic Colours: Ultimate Sonic Origins (Steam, Epic Games Store)

Link to HedgeModManager GitHub

https://github.com/thesupersonic16/HedgeModManager

It would be neat to contribute in any way that I can. I know basics of software development (C and C++), but unfortunately know very little about Linux. Still learning the hard way.

frostworx commented 1 year ago

Thanks for the suggestion. Can't tell if or when I'd find the time to add this, but it seems pretty simple (basically autodownload HedgeModManager.exe and run it when enabled)

On the other side, it should just work to download the exe and start it as custom program for the corresponding game. would be nice if you'd try this and report if it works (and if you still think that it is worth to add an extra implementation anyway :))

sonic2kk commented 1 year ago

+1 on this, though I have the same idea as Frostworx. If it is simply able to be ran as a custom command there may not be any need to add explicit support as many games have dedicated mod managers, however since this supports several Sonic games (almost all of which are available on Steam) it might be an idea to include it.

What are the hoops needed to get this up and running? Does it need any specific Winetricks that Bottles provides or are the hoops just setting up the prefix etc? Does the mod manager need to be "installed" into the game's prefix or can it be ran from anywhere?

Perhaps a more ideal solution would be a way to setup "preset" custom applications and then have a drop-down in the game menu to let the user select to either run their game with that application, or just let them run the custom program with STL open (like MO2 standalone mode). Then a user can add their mod manager program like this one, or any other program and it'll be available for all games in a custom command drop-down or they can just generally launch it with STL still open. Not sure if I'm explaining it right though and of course may be a bit of work.

Just trying to think of a more general solution, not at all against this idea though and if this idea isn't great and it's preferred to have explicit support for each application, that's fine 😃 It does overlap a little with applications like Bottles but the advantage of STL is launching through Steam. And these mod managers could be added as a shortcut to Steam and launched with STL but having an approach where users can select from a preset list of custom programs could be handy for other mod managers, to prevent having to add support for XYZ mod managers while also making it a bit more convenient to manage custom programs.

EDIT: This would also be super convenient on Steam Deck. Configure your utility programs and then easily select them from your list!

sonic2kk commented 1 year ago

Actually just had a look at the guide you linked, super sorry for not noticing it. It seems like directory structure and DLL overrides might be important, however that seems to be on a per-game basis. STL does let you set that as a custom command but also with Winecfg per-game. But it's not automatic.

Having to do this sort of configuration does add credence imo to having HedgeModManager available and pre-configured. And by extension, other popular mod managers could be supported as well if they need this kind of workaround.

Having skimmed that linked setup guide I see merit in adding dedicated support personally, but I'm also a Sonic fan (could you guess? 😆) so I'm a bit biased. Being able to detect the Sonic games and set the DLL overrides for those games automatically and correctly configure the directories would be nice. Of course a way to do this generically like how I described earlier would be nice but frankly, that sounds complicated as hell. And maybe having built-in support for other popular mod managers that need similar things isn't such a bad idea. Though deciding which ones are "popular" enough is subjective.

After having dug a little deeper I think dedicated support might be the way to go.

KBouder commented 1 year ago

I set this up on the Steam Deck that way, and adding these managers to Steam is an absolute chore. The mod manager lets you switch between games so it kinda works like Mod Organizers Global Instance, but the way I was able to set it up was to have 4 separate HedgeModManagers, one for each prefix, and then adding shortcuts to them in Steam. The only downside to doing that, with Bottles at least, is when you have multiple applications with the same name, it tends to get confused and will merge them, duplicate them, overwrite them, all sorts of annoying stuff. Not to mention there's only so much you can do with cover artwork to differentiate them from one another, but I'm rambling and getting off track. This would be a really cool feature to have, and you wouldn't have to clutter up the menus either, you could simply do a check for the SteamApp IDs of the games that are supported and replace the Mod Organizer button with HedgeModManager. Simple (hopefully) and clean!

And on that note as well, there is Mania Mod Manager (GitHub Page) which I believe is made using a very similar code base, so likely has similar requirements for getting it set up.

KBouder commented 1 year ago

Thanks for the suggestion. Can't tell if or when I'd find the time to add this, but it seems pretty simple (basically autodownload HedgeModManager.exe and run it when enabled)

On the other side, it should just work to download the exe and start it as custom program for the corresponding game. would be nice if you'd try this and report if it works (and if you still think that it is worth to add an extra implementation anyway :))

I'll give this a shot to see if it's easier than using Bottles. I'll reply with what I did to get it to work (if I get it to work). I'm a Linux noob still.

KBouder commented 1 year ago

Strangely when I add HedgeModManager.exe as a custom command, then hit save, it just reverts back to SonicGenerations.exe. (This is for Sonic Generations specifically, in case that wasn't clear). Not sure if I'm doing something wrong, or misunderstanding the wiki. Maybe it just doesn't like me.

sonic2kk commented 1 year ago

but the way I was able to set it up was to have 4 separate HedgeModManagers, one for each prefix, and then adding shortcuts to them in Steam

Hmm, I have no idea how we'd handle this with STL. Maybe symlink each Sonic game's prefix or something? The way games on Linux work is each Sonic game runs in its own prefix, which each game seems as a separate "Windows install" so to speak.

The way MO2 works with STL afaik currently is there's standalone mode, which runs in its own prefix, and Game Mode, which runs in the current game's prefix. Ofc, STL could install HMM to each game's prefix but this is less than idea.

And on that note as well, there is Mania Mod Manager (GitHub Page) which I believe is made using a very similar code base, so likely has similar requirements for getting it set up.

I think it also shares code with SA2ModManager (made by mainmemory iirc?), I was able to get this working on Linux a while ago and I think it also required some DLL overrides. But this is a little off topic :-) These are game-specific so could work as a custom command most likely with some manual DLL overriding - This is a common enough step and just something to get used to when gaming on Linux for the most part (STL makes it easier to get to Winetricks/pass these DLL overrides as a command line parameter to Wine).

Back to the main point, HMM might need to be set up to work similar to MO2. Switching between different games and then launching them from the same instance is probably not gonna work when playing from Steam, since it'll be trying to run Sonic Generations from Sonic Forces' prefix and that could cause a bunch of problems. Modding them might work fine though, so we can keep this in mind. Running from the command line might work better if it just passes something like steam steam://run/gameappid or whatever, but no clue :-)

So if this is implemented you'll probably have to switch between your games and launch the right one when playing from the same installation, likely you don't be able to hot-swap and go between playing Generations and Forces in the same session (ofc you can just launch Forces with STL and run with HMM that way :-))

sonic2kk commented 1 year ago

Strangely when I add HedgeModManager.exe as a custom command, then hit save, it just reverts back to SonicGenerations.exe.

The most common problem here is that you didn't enable the custom command checkbox :-) But if you did and it still doesn't work, please upload a log (you can find it in /dev/shm/steamtinkerlaunch). Not sure how exactly it all got setup with Bottles but if the Generations prefix needs a DLL override and you only did it for the HMM prefix you might need to set these overrides yourself

Maybe some kind of auto-enable here would be a good idea if the custom command file exists... but that's a separate thing :-)

As for being easier than Bottles, STL is an entirely different tool aimed at more advanced tinkering. At the very least if STL does add support for HMM it'll mean only needing one installation instead of 4.

KBouder commented 1 year ago

Honestly having multiple HedgeModManagers set up wouldn't be that bad, it's a 17MB .exe file and that's it. They each reference the Mods folder within the games directory anyways (I tend to throw them in the game directory even though they say not to), bad habit.

I actually checked Use Custom Command as well as Only Custom Command, but it still won't take it.

I don't think I even did the DLL overrides the last time I tried this. It must be a new step in their guide.

Here's the log...it seems like it's saying the value wasn't changed because nothing was selected. Weird. steamtinkerlaunch.log

sonic2kk commented 1 year ago

They each reference the Mods folder within the games directory anyways (I tend to throw them in the game directory even though they say not to), bad habit.

This + no DLL overrides make it sound like it could be very straightforward to get working. So it has no installer or anything? How does it know exactly where each game is? If it's just an executable and you point it to your game's EXE, running it in the current game's prefix and then just launching the relevant game sounds a lot more straightforward than I thought and may not require dedicated STL support. If it's just an application that loads mods in a given game's Mod folder (with the game files and not in the game's prefix) that sounds very easy :open_mouth:

I actually checked Use Custom Command as well as Only Custom Command, but it still won't take it.

Upload a log and I can take a look :-) Thanks!

sonic2kk commented 1 year ago
Thu Oct  6 11:58:02 AM EDT 2022 INFO - updateConfigEntry - Option 'CUSTOMCMD' is updated with the new value '/mnt/games/HedgeModManager/HedgeModManager.exe' in config '71340.conf'

Looks like it finds it. But I also see what you mentioned:

Thu Oct  6 12:11:46 PM EDT 2022 INFO - setGuiCategoryMenuSel - Nothing selected - going to the Settings Menu

Did you forget to press "Save" or "Save and Play" by any chance? Maybe not because updateConfigEntry was called but still, just making sure

KBouder commented 1 year ago

I'm going to be honest I'm not really sure how it tells. Sometimes, at least using Bottles, it just took a little bit of luck. There is no installation by the way, just launch the .exe, download the custom codes, select your mods, and hit play. There were a couple times I would launch it and it would find the wrong game, but I don't have my Deck to see how it was configured. (On it's way to Valve for repair).

Every time I would hit Save it would reset to the default value.

Also now it crashes when I load it.

Edit: That's because it did in fact save, just a little UI bug. It tried to run the mod loader without the per-requisites!

sonic2kk commented 1 year ago

I can't see in your log where the game launch is. It looks like you just closed STL without pressing play in that log. Try running STL, checking the custom command open, checking "only custom command", then selecting your HMM executable, then pressing "save and play". Then upload that log (I'm interesting to see what the launch command is specifically).

It tried to run the mod loader without the per-requisites!

Could you elaborate?

KBouder commented 1 year ago

Apologies, I set it to run the ModManager instead of the game, but the mod manager requires a few things to be done with Protontricks/Winetricks. I just tried to boot the game afterwards to see what would happen, which is how I found out that it actually did work, the UI just wasn't updating for me for some reason.

image

This alone might work once I install the dependencies. We will see.

sonic2kk commented 1 year ago

I don't think I've ever seen that menu you're showing before :open_mouth: That's really nice though. Just Fyi it's also in the Game Menu. It looks like that menu might even be missing a few of the newer custom command options...

Actually I can't find this menu, out of pure curiosity where did you find it? :sweat_smile:

This alone might work once I install the dependencies. We will see.

Ah, if it needs dotnet or anything I would first recommend trying without, and if it does need dotnet48, I would recommend trying to install it with STL (it does some thing under the hood to make it install with Proton). If anything messes up with your game/mod manager you'll need to delete the game's prefix, you can open the WINEPREFIX from the SteamTinkerLaunch "Game Files" menu.

KBouder commented 1 year ago

The only problem with that is, for some reason, the bug I'm experiencing causes it so that if I click on a drop down menu, the UI doesn't update based off my selection. I'm going to try a reboot to see if that fixes it. I didn't realize you could do that with stl. That's convenient.

Random thought: HedgeModManager will likely be used for Sonic Frontiers when it comes out next month. It runs off a similar engine if I remember correctly.

sonic2kk commented 1 year ago

The only problem with that is, for some reason, the bug I'm experiencing causes it so that if I click on a drop down menu, the UI doesn't update based off my selection

In that case I'd recommend launching Sonic Generations with STL, going to the Game Menu and tinkering with your custom commands that way :smile: That menu should work, I've used it a few times.

I didn't realize you could do that with stl. That's convenient.

This is something I find myself saying quite often, when looking through the code, or the menus or the wiki I come across something it can do and think exactly that to myself. It's got a ton of features and if you don't mind getting your hands dirty (which is the kind of people it feels most well suited for) it's one of the most powerful customisation tools available for gaming, period.

sonic2kk commented 1 year ago

Random thought: HedgeModManager will likely be used for Sonic Frontiers when it comes out next month. It runs off a similar engine if I remember correctly.

It will most likely yes, unless Denuvo gets in the way. Iirc Frontiers is going to use Hedgehog Engine 3 (Forces uses 2, Generations uses I think 1 or something similar, it actually started with Sonic Unleashed!). But we don't even know how or if Frontiers will work on Linux (I'm hoping and humbly expecting it will). So no need to worry about that just yet.

Honestly if HMM works and the dependencies you're installing get it working, we could just contribute a guide on running it with STL to the wiki (and maybe request that a link to those steps be added to the HMM wiki too). If it's just a case of installing a few winetricks and setting the custom command, there shouldn't be any need to add "dedicated" support. Not to devalue your request! It's just that if we can document how to get it working and if it's as straightforward as this, sure it requires some manual steps but it isn't as "important" as having support for MO2 and Vortex I guess.

The only "problem" is that these steps would be needed for each game. You'd need to install the winetricks for each game which could be a pain for users. Maybe adding support for HMM and simply running it in a dedicated prefix running with the game's Proton version would be fine - The game would then be running in an STL-created HMM prefix with a Proton version selected by the user.

KBouder commented 1 year ago

Did you mean checking Winetricks and selecting dotnet4 quartz xact? Because if so, that did not work.

KBouder commented 1 year ago

The game would then be running in an STL-created HMM prefix with a Proton version selected by the user.

That could work actually.

sonic2kk commented 1 year ago

Did you mean checking Winetricks and selecting dotnet4 quartz xact? Because if so, that did not work.

I'm not sure why it wouldn't work but if it needs dotnet4, you might be able to get away with Wine's dotnet implementation.

But more than that, could you explain what you mean by "did not work"? Did they install at all? Or did nothing happen? The interface might be a little cumbersome but you press "select" then seleect your dependencies, then press "install". The Proton version is likely less important but setting it to match the version of Proton you want to run the game with couldn't hurt.

You should get a dialog that pops up telling you that it's installing those Protontricks. You could always install dotnet4 after the fact, as I think only dotnet48 is what most games require.

KBouder commented 1 year ago

Nothing happened, unfortunately, completely failed to boot.

Requirements

dotnet48 d3dx9 vcrun2019 d3dcompiler_47

I believe these are hard requirements because of the way they do code injection.

sonic2kk commented 1 year ago

Oh, if it needs dotnet48 then hmm. I would still skip it for now and just see if it works with Wine's dotnet implementation (called wine-mono, and it conflicts with dotnet48. STL removes Wine's mono and then installs dotnet48. It can also take a while to install)

As for the requirements you listed, I would agree they're probably needed for code injection (d3dx9 is fairly common for that, and Generation is a dx9 game afaik). The rest I'm not sure but d3dcompiler_47 could be used for however they draw certain things on the UI maybe.

Did you get a notification saying those packages were installing, and a notification saying that they finished?

sonic2kk commented 1 year ago

I do actually have Sonic Generations (and Forces) installed so if we don't get anywhere I can always give this a go myself and see if I can figure anything out.

KBouder commented 1 year ago

image

Um...

sonic2kk commented 1 year ago

That appears for me but it loads after a while (about 1 second)

Try closing STL completely and deleting /dev/shm/steamtinkerlaunch (the files here will re-generate, they're mostly temp storage files). Then try installing the winetricks again.

If you have STL closed try opening and navigating to this menu again, then attaching a log as before so we can see what's going on.

sonic2kk commented 1 year ago

Attempting to install those winetricks and run HMM with Sonic Generations now...

First problem I ran into - Never launched the game before on this install so the Winetricks had nowhere to install the verbs to!

KBouder commented 1 year ago

Run the configuration tool first, the game won't boot without that. Sega makes good ports, I swear.

steamtinkerlaunch.log I don't see anything in here that jumps out at me

sonic2kk commented 1 year ago

Sega makes good ports, I swear.

All too familiar with Sega's ports, hah. But yes that was a good catch!

KBouder commented 1 year ago

WINETRICKS.log A clue maybe?

sonic2kk commented 1 year ago

A clue indeed! I'm not sure if STL downloads Winetricks on its own or not but do you have Winetricks installed on your system? I'll need to check around that line on v11.11 to see exactly what it's grumpy about.

KBouder commented 1 year ago

A clue indeed! I'm not sure if STL downloads Winetricks on its own or not but do you have Winetricks installed on your system? I'll need to check around that line on v11.11 to see exactly what it's grumpy about.

Oh right...forgot to install winetricks. Which is literally in the installation instructions... My bad...

frostworx commented 1 year ago

A clue indeed! I'm not sure if STL downloads Winetricks on its own or not but do you have Winetricks installed on your system? I'll need to check around that line on v11.11 to see exactly what it's grumpy about.

you can enable automatic download by flipping DLWINETRICKS on steamdeck and in flatpak this happens automatically

(haven't read everything in detail, but nice collaboration here 👍)

I'll see what I can do to implement it if it works, but not before the MO2 rewrite (maybe including wabbajack support) so don't hold your breath :)

KBouder commented 1 year ago

Okay, now I'm hyped. Wabbajack would be amazing, especially for the Deck. Maybe with a little luck we can get this booting.

sonic2kk commented 1 year ago

Having some trouble getting Generations to run at all but I'm gonna fiddle until I get it to run normally without STL, then see what the process for getting HMM + Generations to work is (and maybe try Forces and Origins after that).

I'll see what I can do to implement it if it works, but not before the MO2 rewrite

No worries, after the MO2 rewrite maybe I'll open an issue about handling mod managers with STL. It might be nicer to have a separate "Mod Managers Menu" where users can download and install them (so we'd have Vortex, MO2, HMM in there, and any others we might add in future if adding HMM is desirable). Of course there is a "maintenance" cost to consider when adding official support but since it needs Winetricks, being able to run it in a dedicated prefix would be nice.

Of course this could also be accomplished by giving custom commands a custom prefix to run in, which might already be possible, I have no idea :-) Also no idea how it would integrate well with games or anything. But yes, this is something to discuss after the MO2 stuff (hope all goes well on that front btw!)

EDIT: I actually can't get any game to run it seems like, wtf... Scary. Not sure how far I'll get, I'll need to deal with this first.

KBouder commented 1 year ago

image

Something is wrong. I don't think it worked.

sonic2kk commented 1 year ago

Something is wrong. I don't think it worked.

You might want to try reinstalling GE-Proton by the sounds of it

KBouder commented 1 year ago

I'm just going to replace it with GE37

Ok stl doesn't like it when you uninstall GE-Proton apparently.

sonic2kk commented 1 year ago

Close STL, remove /dev/shm/steamtinkerlaunch and launch STL again. Should fix any crashing or notification spam :)

KBouder commented 1 year ago

Good to know for the future

KBouder commented 1 year ago

Winetricks keeps getting stuck in a loop it seems. I launch the game, and it goes straight into winetricks, asks me what I want to do, then what packages I want to install. then what I want to do, then what packages I want to install. Something isn't right here either.

KBouder commented 1 year ago

IT BOOTED

Then immediately went black and froze.

sonic2kk commented 1 year ago

It's a semi-common fix. Even for regular glitches, removing /dev/shm/steamtinkerlaunch can be a nice easy catch-all. Might be documented somewhere too but I forget where if it is at all (wiki is a living document, some people myself included to make an effort to tidy it up and expand it when possible though)

In good news, I got Sonic Generations working after a reboot. So I'll give it a go.

Winetricks keeps getting stuck in a loop it seems. I launch the game, and it goes straight into winetricks, asks me what I want to do, then what packages I want to install. then what I want to do, then what packages I want to install. Something isn't right here either.

Try going to the Winetricks menu and pressing the "Install" button from there and see if you can get them installed. You'll get a notification telling you that they're installing and a notification when it's done installing. After that you can try running your game.

KBouder commented 1 year ago

It works but the UI is very buggy. Much more buggy than it was when I used it on the Deck.

KBouder commented 1 year ago

image Any section that isn't selected with the mouse goes black, unless the window is out of focus, then it is all visible. Have you seen a graphical bug like this before with Wine/Proton?

sonic2kk commented 1 year ago

If the issue is black boxes and stuff, try running with regular Proton or Proton Experimental. It could be the custom theme that GE-Proton is using causing issues (it does with MO2). You can disable the theme but it's less work to just try regular Proton first.

Failing this, if you skipped dotnet48 that could be why (which is good if you skipped it, I even suggested it, so no problem either way!). Seems like it will need a newer dotnet. Try installing that Winetrick :smile: But only if you skipped dotnet48.

KBouder commented 1 year ago

That fixed it. I get a rundll32 failed to run on boot, but it still works? It also does not detect any mods.

sonic2kk commented 1 year ago

I get a rundll32 failed to run on boot, but it still works?

Could be a bad omen later down the road but it could also just be caused by switching Proton versions if that's what you did and be not very important. I'm in the process of setting up HMM with STL and I'll see how I go from there.

Out of curiosity, which part fixed it? Using regular Proton, dotnet48 or both? And related, are you using dotnet48? This will be important for documenting how to get HMM working for others/adding official STL support.

KBouder commented 1 year ago

Regular proton

KBouder commented 1 year ago

Running HedgeModManager creates a mod folder, if you create the folder youself with capital "M" in the name, it just can't find it. Good to know.