Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: No mods on Linux #606

Open
6 of 7 tasks
SymbolicFrank opened this issue Jan 15, 2024 · 8 comments
Open
6 of 7 tasks

[Bug]: No mods on Linux #606

SymbolicFrank opened this issue Jan 15, 2024 · 8 comments
Labels
Bug / Issue Something isn't working Work-in-Progress This issue or pull request is being worked on currently

Comments

@SymbolicFrank
Copy link

SymbolicFrank commented Jan 15, 2024

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.

@RinLovesYou
Copy link
Member

RinLovesYou commented Jan 15, 2024

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

@SymbolicFrank
Copy link
Author

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.

@RinLovesYou
Copy link
Member

RinLovesYou commented Jan 15, 2024

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.

@RinLovesYou
Copy link
Member

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.

@SymbolicFrank
Copy link
Author

SymbolicFrank commented Jan 29, 2024

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.

@SymbolicFrank
Copy link
Author

SymbolicFrank commented Jan 31, 2024

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?

@SymbolicFrank
Copy link
Author

SymbolicFrank commented Jan 31, 2024

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.

@HerpDerpinstine HerpDerpinstine added Bug / Issue Something isn't working Work-in-Progress This issue or pull request is being worked on currently labels Sep 30, 2024
@SymbolicFrank
Copy link
Author

Ok, I tried all of the above again. The 6.6 Linux versions doesn't do anything except complaining that .NET 6.0 has to be installed, which it is, in many ways and versions. Although since last month Microsoft depreciated it and it became .Net Core. but even installing the old .Net versions, native or in Wine and Proton doesn't work. The latest Windows installer breaks when run under Wine/Proton (a path problem) and the older one gives an error while trying to update itself.

The Windows version gives this error:

[22:07:58.556] [Il2CppAssemblyGenerator] [Fail] [Program] Execution Failed: Could not find a valid unity game at G:" --exe-name tld --output-as dummydll --use-processor attributeanalyzer attributeinjector

Which is correct, as it is of course "tld.exe", and perhaps "G:". Everything else is still just as broken, with some slight variations in the exact errors. It has clearly not been tested on any kind of Linux system or emulator.

Which is a bummer. My only option: creating a working fork. I'm not sure if I want to do all that work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug / Issue Something isn't working Work-in-Progress This issue or pull request is being worked on currently
Projects
None yet
Development

No branches or pull requests

3 participants