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.16k stars 73 forks source link

Sonic Frontiers (64bit) Stopped Launching #690

Closed AYTT56 closed 1 year ago

AYTT56 commented 1 year ago

System Information

Issue Description

i cant launch frontiers after installing hmm it immediately crashes so i tried using mscoree.dll and put it in the same location as the exe and got an error message that read "A fatal error occured. However, mscorees.dll could not be loaded to display the appropriate error message. Please reinstall the .NET Framework." And yes, i have frontiers installed on the ssd and yes i tried to install dotnet48 manually but it didn't work ## Logs [steamtinkerlaunch.log](https://github.com/sonic2kk/steamtinkerlaunch/files/10233820/steamtinkerlaunch.log)
sonic2kk commented 1 year ago

Thanks for opening an issue!

When creating your issue, you would've been asked to attach a SteamTinkerLaunch log. Please edit your issue to add this log. You also left out various pieces of information from your System Information, please update it to include:

In the meantime. just to make sure, have you launched Sonic Frontiers at least once without the modloader installed while it was on the Steam Deck SSD? If not, there will be no valid prefix for dotnet48 to install into. If it already existed on the boot SSD as well, ensure that you delete the existing Sonic Frontiers prefix. These workarounds with the prefixes are Steam Client bugs that were reported upstream twice so far. A situation like this can arise:

The reason Sonic Frontiers is crashing is because the modloader for that game requires dotnet48. The modloader for each supported game is automatically installed by HMM irrespective of SteamTinkerLaunch. The requirement of dotnet48 is the root cause of the crash I believe, and for some reason it isn't installing correctly into your game's prefix. I suspect this could be because the prefix is broken / invalid because of the mentioned Steam Client bug, or it could be a general issue as outlined below.

and yes i tried to install dotnet48 manually but it didn't work

If the logs and further debugging don't yield anything, this alone is alarming. This sounds like, for some reason, dotnet48 installation is not working on your Steam Deck unrelated entirely to SteamTinkerLaunch, which is not something I can help with. I'm not a Winetricks developer and if it doesn't work outside of SteamTinkerLaunch there probably isn't very much I can do.

Thanks!

AYTT56 commented 1 year ago

Oh ok ill add the info

AYTT56 commented 1 year ago

Also this seems to only happen with frontiers. Generations is installed on my sd card and hmm works just fine with it

sonic2kk commented 1 year ago

Generations is a 32bit game and doesn't require dotnet48 but glad to hear Generations works! However since it's on the microSD card I'm going to guess the d3dcompiler_47 installation failed. I'll see when I can check the logs if it found the Gens prefix, but if it didn't you may not be able to use the D3D11 mod for Gens out of the box.

Be sure to try the other steps. Here is a rough set of steps, off the top of my head:

  1. Remove Frontiers Wineprefix
  2. Run HMM and uninstall modloader
  3. Run Frontiers once from Steam until it opens and then close it so a new Wineprefix can be generated
  4. Run HMM, ideally it should take up to 10 minutes to open now because it will install dotnet48 correctly for Frontiers (I'm assuming it's failing for now, I haven't had a chance to read the log yet)
  5. Once HMM opens, reinstall the modloader
  6. Try running Frontiers again

Once I have a free moment I'll check the log and see what I can glean too. Thanks for updating the issue :-)

AYTT56 commented 1 year ago

I actually am able to use d3d11 mod out the box for gens i tried it and it works also how would i remove the wine prefix?

sonic2kk commented 1 year ago

Huh, that's interesting. Maybe the Gens prefix actually installed in the correct place for some reason.

The Frontiers prefix is just a standard Wineprefix like any other game, sorry if that wasn't clear. You can find it at ~/.local/share/Steam/steamapps/compatdata/<frontiers appid>

sonic2kk commented 1 year ago

Unfortunately the SteamTinkerLaunch log you provided is invalid. I'm not sure what you ran to generate the log, but you need to attach a log from after you ran SteamTinkerLaunch with Hedge Mod Manager. The log in /dev/shm/steamtinkerlaunch is from the latest launch only, given its location.

Run Hedge Mod Manager with SteamTinkerLaunch and once it loads up, attach another log. You can just attach it in a reply.

It would also be helpful if you could let me know what version of SteamOS you're running and if you're on the Steam Client Stable/Beta/Preview.

AYTT56 commented 1 year ago

oh ok heres another one steamtinkerlaunch.log

AYTT56 commented 1 year ago

My steamos version is 3.3.3 stable

sonic2kk commented 1 year ago

Thanks! The log was quite useful.

As suspected, dotnet48 is not being installed for Sonic Frontiers. From that log it cannot find the Sonic Frontiers prefix -- which is to be expected in this case, because as asked you deleted it (I assume :sweat_smile:)

Thu Dec 15 05:42:13 PM +03 2022 INFO - prepareHMMGames - Wineprefix for game 'Sonic Frontiers (1237320)' did not already exist at '/home/deck/.local/share/Steam/steamapps/compatdata/1237320/pfx' - The game may not have been started before! Thu Dec 15 05:42:13 PM +03 2022 SKIP - prepareHMMGames - Could not find compatdata dir for 'Sonic Frontiers' - Assuming that it is not installed

So you'll want to run Sonic Frontiers once from Steam (ensuring that it is on the SSD) and then re-open Hedge Mod Manager. Running from Steam creates the prefix (at the path in the log line above where it isn't found atm), and running HMM from STL will prompt it to install dotnet48 into the newly created Frontiers prefix. Hope that helps outline what's going on a bit more :-)

Also, the log confirms my suspicion that Generations created the prefix in the correct location:

Thu Dec 15 05:42:13 PM +03 2022 INFO - installWinetricksPaks - Installing 'd3dcompiler_47' silently with /home/deck/.config/steamtinkerlaunch/downloads/winetricks/src/winetricks

Thu Dec 15 05:42:13 PM +03 2022 INFO - restoreOrgVars - Restoring previously cleared Variables

Thu Dec 15 05:42:13 PM +03 2022 INFO - extWine64Run - Command in Proton WINEPREFIX is: WINE="/home/deck/.local/share/Steam/compatibilitytools.d/GE-Proton7-42/files/bin/wine" WINEARCH=win64 WINEDEBUG="-all" WINEPREFIX="/run/media/mmcblk0p1/steamapps/compatdata/71340/pfx" /home/deck/.config/steamtinkerlaunch/downloads/winetricks/src/winetricks --unattended d3dcompiler_47


So the next steps would be to uninstall the Frontiers mod loader (you can do this from HMM's UI - you need to uninstall it to get Frontiers to actually open because it is the modloader that requires dotnet48, removing the modloader ensures Frontiers will properly open), run Frontiers once ensuring that it fully starts up (this allows Steam time to fully create the prefix), and then running HMM again. You'll probably have to install the modloader again too :slightly_smiling_face:

You can attach a log from that startup of HMM. It should take noticeably longer as it has to install dotnet48 for Frontiers.

If all goes well this should resolve the problem. You may also need the DLL in the game files, since it also seems to be required now at least for Frontiers (but not for Forces, another 64bit game, based on another user's tests).

Let me know how you get on :-)

AYTT56 commented 1 year ago

Thanks after running the game without the mod loader installed that fixed the issue and the game launches now and the mods work. Seriously can't thank you enough ive been trying to mod frontiers for over 2 weeks now and finally got it to work i even moved the game to my sd card and it still works

sonic2kk commented 1 year ago

Awesome! I'm glad it works :smile: Sorry that I couldn't help sooner but hopefully the resolution on this issue was acceptably fast, STL is just my after-work free-time project but I try my best for users! :sweat_smile: I would also like to thank you for sticking with me and helping with debugging. It's extremely valuable to know what's going on.

If you notice other users having trouble online please feel free to point them to this issue and/or outline similar steps as I outlined for you to follow, as that should hopefully resolve the issues. The issue with the prefixes has been noted upstream to Steam for Linux and only impacts Steam Deck for some reason. I reported it once and another user reported it as a save file issue on Steam Deck :-)

Another issue might be that a game has to be ran at least once before you can mod it. This is a general thing for games running via Wine, as the prefix needs to be created by Steam before programs like STL or even vanilla Winetricks can install workarounds (so if, say, Frontiers was not launched, STL will not find the prefix and won't be able to install mods). I don't think this is very well documented but I should make a point of making it more explicit in the docs.

And also if you're interested, Frontiers likely still works after moving it to the microSD card because dotnet48 only has to be installed once for the modloader to work. But if the game is ever uninstalled and reinstalled or anything you may have to do the setup again on the boot SSD -- At least until the bug with where game prefixes are created on Steam Deck is resolved.


Also, side note, very pleased as well to hear that HMM is working with Generations for you! It's very relieving to hear the issues users are having seem to mostly be stemming from this prefix bug or on desktop, outdated Winetricks. Given that STL v12 should be released as stable soon I'm always glad to hear more success than negatives with getting it working, it gives me more confidence in releasing HMM support in stable.

Thanks! Closing this issue as it is resolved now :-) Cheers!

AYTT56 commented 1 year ago

Hey, so like i said frontiers was working with hmm installed but suddenly a few days later frontiers is crashing again this time without an error message it just doesnt launch, ive tried the method you told me of deleting the prefix and running the game once and running hmm then to have dotnet48 install correctly but no luck. Sorry to bother but could you look into my log to see whats wrong this time? Would really appreciate it

AYTT56 commented 1 year ago

steamtinkerlaunch.log

sonic2kk commented 1 year ago

I'll take a look but if it suddenly stopped working I don't think that's a SteamTinkerLaunch issue. Did the modloader or game update recently?

Also, feel free to re-open issues like this instead of just commenting on a closed issue :-) That way it won't get missed.

sonic2kk commented 1 year ago

When you remove the prefix for Sonic Frontiers and re-generate it, then run HMM, does it take a while to start up? If it does that would suggest dotnet48 is installing.

Have you also made sure the sometimes-needed mscoree.dll I think it's called, is in the same directory as the game files?

The log looks mostly fine except for it only taking about 90 seconds to do the dotnet step, unless it's already installed. But I don't know why it would suddenly stop working, this sounds more like a game issue or maybe a mod incompatibility issue, or perhaps a Frontiers modloader issue if it updated recently.

If you could delete the prefix again, run Frontiers again and then run HMM again, you'll get a fresh steamtinkerlaunch.log and installDotNet.log file. Attach both of those to your issue and I'll take a look to see if anything is going wrong on the STL side, but I'm not really that anything is going wrong here if it just stopped working all of a sudden.

Another file that might be worth attaching is the Proton log. If you add PROTON_LOG=1 %command% to the Frontiers launch options, a file called steam-1237320.log will be generated in your home folder. If you attach this I can see if it's possibly the modloader crashing in the CommonLoader section I believe it's called.


After you've generated the logs, you might want to try and narrow down the issue a little too to see what might be causing the problem.

If you haven't already, make sure that Frontiers isn't crashing because of mods/codes by disabling them all and trying to launch the game. If it still doesn't launch, try uninstalling the modloader and seeing if it launches. If it does, then this is an issue with the modloader and potentially an issue with dotnet48 and STL. However dotnet48 would've been installed and working already so I'm not sure what might've changed.

Sonic Frontiers support is not in a stable branch of HMM, it's in a nightly branch, and STL will always update to the latest available version of HMM. It is possible that HMM has introduced a regression here too. The modloader doesn't look like it's updated recently and I'm not sure how much HMM itself does that could be causing problems with games.

sonic2kk commented 1 year ago

Just updated the issue title to bring it more in line with the current problem and also to remind myself of what's exactly the problem at the moment :-)

AYTT56 commented 1 year ago

When i remove the prefix and generate it then run hmm it takes a while but not nearly as long as it used to, it only takes like 2 minutes when it used to take around 5-10 minutes also mscoree.dll is in the files

Also i already have the steam-123720.log i saw it when i was getting the stl log

And frontiers does launch up with the modloader disabled

Im a bit busy today and not at home so i think i'll be able to get you a new log tomorrow

sonic2kk commented 1 year ago

Thanks!

It sounds like dotnet48 isn't installing which could mean there's an issue with the prefix for some reason. I remember you moved the game files around but I'm not sure what's up there exactly. If there's a prefix on the microSD card you might want to try removing that as well as the one on the boot SSD, the Steam client on Steam Deck has had some weird issues with prefixes lately.

What could be happening (and this is a complete guess) is that there is a prefix for Frontiers somewhere else that Steam is trying to use for the game, which doesn't have dotnet48. That would explain why it suddenly stopped working.

As for why it isn't taking very long to install, we will have to wait and see. One user before reported an issue where dotnet40 (the step before dotnet48 which Winetricks does automatically) failed, and other Winetricks users seemed to have reported this over the years but had no firm resolution. I'm hoping that this isn't the case here 😅 I am not a Winetricks developer and if Winetricks is failing to install dotnet48 there probably isn't much I can do.

Once you have some time it would be useful if you could check for a Frontiers prefix in the microSD card's compatdata.

Also, out of curiosity, are you using symlinks at all for your compatdata?

sonic2kk commented 1 year ago

If all else fails you may want to try manually installing dotnet48 into the Frontiers prefix (ensuring you still use GE-Proton) with something like Protontricks and if a manual install fails there probably isn't anything on the STL side that can be done sadly. If following the steps that STL does manually also fails then that would explain why STL fails.

sonic2kk commented 1 year ago

From searching on r/linux_gaming it seems like dotnet40 and dotnet48 can just fail to install repeatedly. You may need to keep deleting the prefix and trying over and over to get it to install, regardless of STL. One example for FFXIV: https://www.reddit.com/r/linux_gaming/comments/s4vlza/cannot_install_final_fantasy_xiv_xivlauncher/

Winetricks does warn, in fairness, that dotnet4 is not fully supported on 64bit prefixes (which Proton will always use for various reasons). But it is unfortunate. This seems to be a general dotnet4 failing issue and may need to be debugged separately from STL but I'll take a look at logs once you can provide them to see better if this is a Winetricks issue. Sadly I can't give much support when it comes to general Winetricks and I have seen various complaints that Protontricks (a light wrapper around Winetricks) can regularly fail for some users.

sonic2kk commented 1 year ago

It seems some users also suggest that vanilla Proton 5.0 works to install dotnet48. If you'd like you can download this from Steam and try to install dotnet48 with this version manually or by setting this as the HMM Proton version in the STL settings, however I suspect that given other Reddit posts I've seen that this can fail just as intermittently as GE-Proton. I think initially at least you're better off deleting the prefix a few times and trying again, if the logs suggest that it's dotnet48 installation failing (which I suspect it is).

If dotnet48 is failing and there is no prefix on the microSD card I'll probably have to close this issue and chalk it up to a Wine and Winetricks issue that I can't resolve 🙁 dotnet48 has installed fine for HMM because you can run it but there have been cases where dotnet48 fails for HMM. No user has actually been active enough in those issues to figure out if it's an intermittent failure on Winetricks' part. Since the STL logic for installing dotnet48 is the same for HMM and 64bit games there shouldn't be anything going wrong on the STL side. The logs even list the exact command that STL runs to install dotnet48.


So to summarise the steps I would try:

If all of these steps fail, it's probably out of my hands unfortunately. But once I see the logs I may get a better idea of where it's failing.

sonic2kk commented 1 year ago

Also just remembered Frostworx rolled a custom Proton version to install dotnet48 but iirc that hasn't been required for a while now. I may add some code to automatically fetch that version so that users can fall back to it: https://github.com/frostworx/steamtinkerlaunch-tweaks/releases/tag/Proton-6.17-STL-1

However the strange thing is that Frontiers just suddenly stopped launching. I'm not entirely sure what might've changed to cause it to stop working, there were no updates to the STL HMM stuff...

AYTT56 commented 1 year ago

Yea i did move frontiers to the sd card when i got the mods to work and it was fine for awhile till it suddenly stopped, i uninstalled the game and reinstalled it on the ssd but it still wasnt working. I'll check tomorrow because theyre might be a prefix in both the ssd and sd and also no i dont use symlinks for most of my games including frontiers but i'll have to check if there's two different prefixes.

sonic2kk commented 1 year ago

I created an experimental branch that uses --force to install dotnet48 for 64bit HMM games. Feel free to try it. If you're not familiar with using version control or the command line it may be a bit cumbersome but the steps on Steam Deck should be roughly:

  1. From the folder with the steamtinkerlaunch script, run git fetch && git pull
  2. Then run git checkout hmm_dotnetforce_experiments (typing hmm_ and pressing tab may automatically fill it in for you)
  3. Run ./steamtinkerlaunch - The version should be v11.12.20221220-1 (hmm_dotnetforce_experiments)
  4. Then run ./steamtinkerlaunch hmm start nightly --force which will add --force to the command to install dotnet48 for 64bit HMM games.

This --force flag may not help much but it didn't break anything in my brief testing. The side effect of this flag is that it will force dotnet48 to be reinstalled for each game even if it is already installed. There were reports online iirc that --force for Winetricks can help with certain things but I don't recall if it's ever helped me, and also it is not really ideal to use.

This is still just added experimentally and it is something you could try after following the other steps. But if fiddling with version control stuff from the command line is too cumbersome that's fine as well. When trying to install dotnet48 manually to see if that works you can try with the --force flag there as well. STL uses --force --unattended in that order to install dotnet48 for each game, I'm not sure if the order makes a difference but just letting you know :-)

A heads up too: GE-Proton7-43 seems to have caused a couple of issues with other programs, including MO2. If you're using this version you may want to revert to an older version.

Good luck! If this doesn't work and manual Winetricks still fails then this is probably not something STL can do much about.

AYTT56 commented 1 year ago

Oh ok ill try that then seems like it might work

AYTT56 commented 1 year ago

Its probably going take awhile for me to test it unfortunately. Exams are around the corner and my parents have been pretty strict about me using my deck but ill let you know once i get the chance

sonic2kk commented 1 year ago

No worries, real life comes first as always. Plus it's also the holidays, I don't have as much time to work on STL for the next couple of weeks :-)

I'll keep the issue open

MooMew64 commented 1 year ago

I got Frontiers to boot with the mod loader and mods+codes installed, process outlined here: https://tinyurl.com/HMMguide

Needless to say, it chalks up to a Linux moment lol.

sonic2kk commented 1 year ago

Ahhh so it is an intermittent failure. It seems Proton 5.0 is more reliable for installing dotnet48.

Glad to know it's not really an STL issue. I'll link that guide on the wiki and point users who have issues to it.

Thank you! I'll close this issue once it's added.

I also echo the sentiment there that hopefully compatibility improves to the point where we don't need dotnet48 for 64bit games.

AYTT56 commented 1 year ago

Does proton 5.0 have the flickering issue where if you play the game at higher than 30fps?

sonic2kk commented 1 year ago

Probably but you shouldn't play the game with Proton 5.0, just install dotnet48 with it

sonic2kk commented 1 year ago

The wiki has been updated, closing this issue now :-)

This seems to be a Winetricks failure with Proton which as noted on the wiki can be worked around:

If 64bit games continue to fail to boot with the modloader, you may need to start with a clean prefix for that game and install dotnet48 using Proton 5.0. You can do this by downloading Proton 5.0 from Steam (from Desktop Mode on Steam Deck) and then selecting Proton 5.0 as your Hedge Mod Manager Proton version from SteamTinkerLaunch. Then you can run Hedge Mod Manager.

Alternatively, there is a guide on how to do this using Protontricks on Steam Deck.

But really I can't provide much support for an issue related to Winetricks. This would fail outside of SteamTinkerLaunch it seems like.

As for why Frontiers stopped working, my guess would be that a Proton version changed caused the prefix to get reset, and now dotnet48 is failing to install as it seems to intermittently fail.

It sucks but there isn't much more that can be done other than following the workaround steps, which boils down to using Proton 5.0 to install dotnet48 either using Protontricks or SteamTinkerLaunch.

SeongGino commented 1 year ago

Sorry to necro, but having only just gotten around to this, would it be possible to maybe have STL use a Proton 5 instance--or if not, maybe have it download and use, say, Proton-5.9-GE-8-ST? As it is now, I literally just made a clean prefix to:

And as soon as I opened HMM, presumably it must've not noticed that it was installed and... tried doing all of that, with a not-compatible Proton which all it does is run remove_mono and thus effectively undoes everything I did, thus making Frontiers not run anymore.

So I guess what I'm asking is, can we either make STL pull and use a predefined Proton just for 64-bit Hedgehog Engine games? If not, could you remove this setup step entirely so it doesn't undo another half hour of manual labor just to set this up again? As it is now, it's basically not-functional anyways out-of-the-box without such intervention/manual setup.

sonic2kk commented 1 year ago

So I guess what I'm asking is, can we either make STL pull and use a predefined Proton just for 64-bit Hedgehog Engine games?

Doesn't STL install dotnet and its dependencies for each 64bit game with the HMM Proton version? If not, you should be able to set the Proton version for each of these games with STL, and STL will pull that.

Based on what you described I guess you ran HMM with a not-compatible Proton version, but I might be misunderstanding. You can change the HMM Proton version on the global menu (and the prefix, if you want to set up a custom one too for any reason). After clearing /dev/shm/steamtinkerlaunch (or restarting Steam usually works too), it will pick up any Proton version you put into the Steam compatibilitytools.d (such as the old Proton-GE version you mentioned), or ~/.config/steamtinkerlaunch/downloads/proton/custom/.

If not, could you remove this setup step entirely so it doesn't undo another half hour of manual labor just to set this up again?

It could be, but the better solution is to try and fix this. Since Proton 5 works maybe this is an issue related to Proton and the SLR, unless installing these dotnet versions is a known issue for Proton in general. If so, the manual setup stuff would be pulled (or commented out), but I would rather there be some sort of fix, unless that fix is really absolutely dependent on Wine being patched, then there's not much that can be done.

I've never had an issue with this, so I've never delved much into HMM for many months. And at this point, because very very few people contribute and there are many invalid issues coming up, STL has pretty much become a tool that I use and develop for myself, and I use this repo to "publish" it :-)

SeongGino commented 1 year ago

Doesn't STL install dotnet and its dependencies for each 64bit game with the HMM Proton version? If not, you should be able to set the Proton version for each of these games with STL, and STL will pull that.

FWIW I'm not launching these games with STL; I exclusively use it as a separate application, i.e. running steamtinkerlaunch hmm start. This way, the only options provided, at least from what I can tell, is USEHMMPROTON which, wasn't all that helpful. More on this later.

It could be, but the better solution is to try and fix this. Since Proton 5 works maybe this is an issue related to Proton and the SLR, unless installing these dotnet versions is a known issue for Proton in general. If so, the manual setup stuff would be pulled (or commented out), but I would rather there be some sort of fix, unless that fix is really absolutely dependent on Wine being patched, then there's not much that can be done.

As far as I can tell, the installers failing with Proton is a known issue that still affects current versions, so not a problem with your script work. Still, it's a bit kludgy even with the knowledge.

What I've found to be the quickest way that's the closest to "just werks" status, is:

Even though STL runs the installers with a Proton version that's newer (it's the same Proton-GE8 that I set globally, which I can tell by watching the process name and the path checks out to that), so long as the game was last started with Proton 5, dotnet does indeed install fine this way; HMM works, and the game boots into a modded state and seems to persist. Completely incidental and doesn't make a lot of sense to me, but... eh.

I'm far from qualified to contribute myself, I'm just leaving my own findings here that's helped me in case someone else comes across this.

sonic2kk commented 1 year ago

I'm far from qualified to contribute myself, I'm just leaving my own findings here that's helped me in case someone else comes across this.

Appreciated, I still consider (thorough and well-researched/tested) notes such as this as contributing :-)