MelonLoader

MelonLoader

5 Downloads

[Bug]: No mods on Linux

SymbolicFrank opened this issue ยท 7 comments

commented

All of the following criteria must be met

  • All Requirements must be installed.
  • Changed the title so that it doesn't just says "[Bug]: "
  • I have searched the GitHub issues for my bug, even in the closed issues.

All of the following are optional to answer

  • Tried reinstalling the Game.
  • Tried reinstalling MelonLoader.
  • Tried restarting PC.
  • Was able to see the Start Screen.

Describe the issue.

I have used MelonLoader for years on Windows 10 with The Long Dark. I migrated to Linux Mint and reinstalled everything. Issues:

  1. The Linux build of v0.6.2 is not recognized as a unity module. It crashes.
  2. The Linux build of v0.6.1 does seem to work, but I wasn't able to activate it.

That gave multiple, different errors that Il2Cpp wasn't accessible. I tried to install it myself, but that didn't work, as I didn't know which version and name was expected. I couldn't get it to download automatically, either.

Which was when I discovered, that the mods only work if you force Proton compatibility in Steam and add "-force-glcore" to get the game running. So it's nice that there are native Linux builds, but they don't seem to have a function yet.

Next, remove all, enable proton compatibility and reinstall in Steam. And get protontricks to work? The native builds are old, there is a Flatpak that is reasonably up-to-date, but doesn't work from the command-line. I couldn't get it updated with apt or pipx. This was a great help: https://forums.linuxmint.com/viewtopic.php?t=398249

  1. Paths are probably too long.

I tried this from a terminal:
#!/bin/bash
STEAM_COMPAT_DATA_PATH=/mnt/[some long GUID]/SteamLibrary/steamapps/compatdata/305620 STEAM_COMPAT_CLIENT_INSTALL_PATH=/mnt/[some long GUID]/SteamLibrary/steamapps/common/TheLongDark "/home/frank/.steam/steam/steamapps/common/Proton - Experimental/proton" run "/mnt/[some long GUID]/SteamLibrary/steamapps/common/TheLongDark/tld_gl.bat

This gave all kinds of "file (or assembly) not found" errors.

"tld_gl.bat" is: "./tld.exe -force-glcore --melonloader.hideconsole >> ./ml.log"

  1. The Windows builds won't run with Proton when you follow the instructions on the wiki.

I made a new mount point ("/mnt/Games") and a "G:" drive with protontricks in winecfg, to the new "/mnt/Games/SteamLibrary/steamapps/common/TheLongDark" directory. Which gave errors that Il2Cpp couldn't find an assembly named 'tld' at 'g:'. So I removed the G: drive, but that didn't help. I made a new G: drive to "/mnt/Games/SteamLibrary/steamapps/common/", so the executable would be: "G:\TheLongDark\tld.exe" (with a backslash after the ":" !), which removed the error.

  1. Protontricks isn't able to start it up at all.

There are many issues, mostly with the requirements. There is no good way to install them. I tried selecting them in protontricks ("Install a Windows DLL or Component"), which gave many errors about 32-bits versions not working, wrong versions and checksums, etc. Opening an Explorer and executing the Windows installers gave many errors about incorrect Windows versions (it seems to be reported as either WinNT or WinXP64 by proton). I cannot verify if all the trial and error worked or not.

All in all, I couldn't get the same result when running through protontricks as Steam.

  1. Missing rendertargets.

I got errors about unsupported render targets, while I have an AMD Radeon 6950, with a native driver installed and active. I checked. And the game runs unmodded. But I don't know if this is actually an issue, only that after these error messages, the mods get unloaded. Unfortunately, there is a new version of The Long Dark just at this moment, so I have to update before I can run it from Steam and cannot reproduce the previous error messages.

  1. Fatal error. System.AccessViolationException: Attempted to read or write protected memory.

This is the final error, so far. I don't think I can debug that myself. It all seems to work with this setup until everything is ready and I see the MelonLoader screen and graphic pop-up for a fraction of a second, after which everything crashes.

Player.log

And the new log, with new errors:
Player.log

Btw, your animated logo is quite small on a 4k screen.

Did you attach your log file?

Yes, I attached my log file to the text box above.

commented

There's a lot to unpack here.

That gave multiple, different errors that Il2Cpp wasn't accessible.

Assuming you're talking about Cpp2IL, The Wiki mentions this.

Which was when I discovered, that the mods only work if you force Proton compatibility in Steam and add "-force-glcore" to get the game running. So it's nice that there are native Linux builds, but they don't seem to have a function yet.

You're talking like MelonLoader is made for your game. MelonLoader is a universal mod loader. I don't see what's keeping mods from running on the linux version of your game, Mods may be using some windows specific code, but it certainly doesn't have "no function". Other games may use MelonLoader and have mods that are written with cross-platform in mind

Next, remove all, enable proton compatibility and reinstall in Steam. And get protontricks to work? The native builds are old, there is a Flatpak that is reasonably up-to-date, but doesn't work from the command-line. I couldn't get it updated with apt or pipx. This was a great help: https://forums.linuxmint.com/viewtopic.php?t=398249

Sorry, being the only linux user on the team, I can't know about the situation of installing tooling on distributions I don't use

Onto your next point about mounting (?), I'm really not sure. I don't have my games on a separate drive.

There are many issues, mostly with the requirements. There is no good way to install them. I tried selecting them in protontricks ("Install a Windows DLL or Component"), which gave many errors about 32-bits versions not working, wrong versions and checksums, etc. Opening an Explorer and executing the Windows installers gave many errors about incorrect Windows versions (it seems to be reported as either WinNT or WinXP64 by proton). I cannot verify if all the trial and error worked or not.

The wiki clearly describes how to install the requirements. protontricks APPID uninstaller for dotnet 6. That is realistically all you need.

Fatal error. System.AccessViolationException: Attempted to read or write protected memory.

I've heard numerous things about this happening under Proton. I have yet to run into any of it. Then again, I don't mod any of the games where this has come up, and I can only imagine that mods are causing it, not us.

All in all, I think you're overthinking most of this. I would recommend you start over by deleting your prefix, running the game through steam's GUI once, running protontricks APPID uninstaller, installing dotnet 6 with it, and adding WINEDLLOVERRIDES="version=n,b" %command% as a launch option by right clicking the game in steam -> properties

Then you can run the game

commented

All in all, I think you're overthinking most of this. I would recommend you start over by deleting your prefix, running the game through steam's GUI once, running protontricks APPID uninstaller, installing dotnet 6 with it, and adding WINEDLLOVERRIDES="version=n,b" %command% as a launch option by right clicking the game in steam -> properties

Then you can run the game

I did the first part at the start. It didn't work. I replaced the launch option in Steam with the above one, which made it crash immediately.

I understand that you think the project you worked on for so long is really great and that I do everything wrong. But I try to supply all the information I can to allow you people to fix things if you ever want to allow the things I try to do. So I can enjoy your work as well.

commented

Please join the discord and @rinlovesyou in support. Github troubleshooting like this is a bit of a pain.

I understand that you think the project you worked on for so long is really great and that I do everything wrong.

I've never said you did anything wrong, I just see a lot of steps I've never had to deal with, so i tried providing a more concise way of starting over.

commented

I did the first part at the start. It didn't work. I replaced the launch option in Steam with the above one, which made it crash immediately.

What didn't work? Crash makes sense if you were unable to install .net 6.

commented

Please join the discord and @rinlovesyou in support. Github troubleshooting like this is a bit of a pain.

I understand that you think the project you worked on for so long is really great and that I do everything wrong.

I've never said you did anything wrong, I just see a lot of steps I've never had to deal with, so i tried providing a more concise way of starting over.

I clicked the wrong button a few weeks ago when trying to join a discord, after which it told me that there already was a user with that email address and demanded to know my telephone number. I didn't like that, but since then I cannot get to any discord anymore. "Whoops... Unable to accept invite." It redirects everything back to the first page.

I tried a few more times, but that isn't going to work.

I also tried just using wine instead of proton, but that didn't work, either. I can start the game, but it stops when it can't find the steam dll. Yes, I installed steam in that instance.

At this point I haven't got a clue how to proceed.

commented

I downloaded the newest Linux build of Cpp2IL:

"[Fail] [Program] Execution Failed: Invalid game-path or exe-name specified. Failed to find one of the following:
/mnt/Games/SteamLibrary/steamapps/common/TheLongDark/GameAssembly.dll
/mnt/Games/SteamLibrary/steamapps/common/TheLongDark/tld.x86_64.exe
/mnt/Games/SteamLibrary/steamapps/common/TheLongDark/tld.x86_64_Data/il2cpp_data/Metadata/global-metadata.dat"

Which is correct. It's "GameAssembly.so" and "tld_Data/il2cpp_data/Metadata/global-metadata.dat". I don't see parameters to override that. If I do this:

"/mnt/Games/SteamLibrary/steamapps/common/TheLongDark/MelonLoader/Dependencies/Il2CppAssemblyGenerator/Cpp2IL/Cpp2IL-2022.0.7-Linux" --game-path "/mnt/Games/SteamLibrary/steamapps/common/TheLongDark" --force-metadata-path "/mnt/Games/SteamLibrary/steamapps/common/TheLongDark/tld_Data/il2cpp_data/Metadata/global-metadata.dat" --force-binary-path "/mnt/Games/SteamLibrary/steamapps/common/TheLongDark/GameAssembly.so"

I get the following error: "[Fail] [Program] Execution Failed: Invalid force option configuration"

I'm not sure if the error is the same and only the error message changed between the different versions.

I also installed the Linux version of ILSpy, which states that GameAssembly.so contains no metadata, while the "file" command states that it isn't stripped. Ok, I don't know if that is the same for a .NET assembly. So modding seems out, as far as I can see.

commented

Latest.log
So, I decided to install the native Linux versions of TLD and MelonLoader and port the mods myself. (Version 0.6.1, because 0.6.2 is broken.) Unfortunately, I get this error: "Cpp2IL.Core.Exceptions.LibCpp2ILInitializationException: Fatal Exception initializing LibCpp2IL! ---> System.Exception: Failed to find pCodegenModules"

After some googling, that brought me here: SamboyCoding/Cpp2IL#217

It states that it is because the version of the game (different game, yes) has encrypted metadata. Tough luck?