piotrulos / MSCModLoader

ModLoader for My Summer Car
GNU General Public License v3.0
110 stars 55 forks source link

[TUTORIAL] patcher/loader guide for linux + Steam Play #123

Closed buck2202 closed 3 years ago

buck2202 commented 3 years ago

Since MSC works fairly well through wine/proton on linux, I've been trying to get your loader functional as well. I found that versions <=1.1.7 worked without issue, but after you switched to doorstop, there was no indication of the mod loader being present. The patcher worked fine, but no console/settings/etc.

@piotrulos, I've read through past issues and some comments on steam/nexusmods/etc and know that you're (understandably) not interested in making code changes, but I did manage to get v.1.11 working successfully with only some minor configuration changes. It took a while to figure out so I just wanted to post here for others to find, or to offer it for your readme/wiki.

The bottom line is that there seems to be NOTHING inherently incompatible about the patcher/loader with wine/proton, i.e. "Steam Play". To successfully use it, we just have to make sure that the patcher operates in the same wine environment as the game, and set a dll override so that UnityDoorstop functions (again, in the proper wine environment).

I haven't tested many specific mods, but this is what worked for me to get the loader working

Summary

Step by step instructions, with screenshots:

First, identify the version of proton that you're using to launch the game. If you've set a specific override for MSC, it will be in the game's properties: Screenshot from 2021-02-24 06-52-45 Otherwise, look to Steam>Settings>Steam Play Screenshot from 2021-02-24 06-47-46 We need to find the installed directory for the correct version of proton. For 5.0-10 shown in my screenshots, you'd look in your steam library for "Proton 5.0". Open its properties, go to the local files tab, click browse, and a file browser should open to the correct path. Screenshot from 2021-02-24 06-55-45 This is your "Proton directory"

Next, find your MSC installation directory. Go to MSC in your library, properties>local files>browse, and again, a file browser opens to the correct path. Screenshot from 2021-02-24 06-56-33 This is your "MSC Install directory"

Finally, we need to find the compatdata directory for MSC. This is where the wine registry/libraries/etc live. If your MSC install directory was /foo/bar/steamapps/common/My Summer Car, the compatdata directory should be /foo/bar/steamapps/compatdata/516750 (516750 is the game's App ID in Steam). Screenshot from 2021-02-24 07-00-06 This is your "MSC compatdata directory"

Let's set the paths that we've identified into variables for easier use. Open a terminal, and enter

PROTONDIR="YOUR PROTON DIRECTORY"
MSCCOMPATDIR="YOUR MSC COMPATDATA DIRECTORY"

so, for me, it's

PROTONDIR="/media/evodata/SteamLibrary.linux/steamapps/common/Proton 5.0"
MSCCOMPATDIR="/media/evodata/SteamLibrary.linux/steamapps/compatdata/516750"

Quotes are required, and these variables ONLY APPLY TO THE TERMINAL WINDOW YOU TYPE THEM IN, so we're going to use this window for everything. Download and extract the MSCLoader zip wherever you want, and navigate to it in the terminal you have open. Screenshot from 2021-02-24 16-52-59

Run the patcher with this command:

STEAM_COMPAT_DATA_PATH="${MSCCOMPATDIR}" WINEPREFIX="${MSCCOMPATDIR}/pfx" "${PROTONDIR}/proton" run ./MSCPatcher.exe

Screenshot from 2021-02-24 16-11-49 A good hint that you're on the right track here is that the patcher detects your "My Documents" folder as belonging to "steamuser". Click the "MSC Folder" button and navigate to your My Summer Car install folder. In the proton environment that we're using, your "real" filesystem is under drive letter Z (So, Z:\media\evodata\SteamLibrary.linux\steamapps\common\My Summer Car for me). Click "Install MSCLoader".

Choosing "My Documents" for your mod folder corresponds to <MSC compatdata>/pfx/drive_c/users/steamuser/My Documents/MySummerCar/Mods in your "real" filesystem

Good so far? Screenshot from 2021-02-24 16-23-26

Close the patcher window (it cannot launch the game, and we're not done yet), go back to your terminal, and enter the following command

STEAM_COMPAT_DATA_PATH="${MSCCOMPATDIR}" WINEPREFIX="${MSCCOMPATDIR}/pfx" "${PROTONDIR}/proton" run winecfg

In the "Libraries" tab, check your "Existing overrides" for winhttp. If it isn't present, type winhttp it into the "New override for library" box and click "Add". In the end, you should have a winhttp (native,builtin) line in your overrides Screenshot from 2021-02-24 16-30-04 If it doesn't say (native,builtin), just highlight winhttp, click "Edit", and select "Native then builtin" Screenshot from 2021-02-24 16-34-12 Click apply, and OK, and the "Wine Configuration" window should go away.

What did we just do? MSC Mod Loader uses Unity Doorstop to inject itself; Doorstop overrides a system dll with a placeholder that links to the "real" library plus a handle to additional code. When a Unity game looks for a library on Windows, it first looks in the game's root directory. If it's found there, it uses that one; if not, it falls back to the system version. On wine/proton, this does not happen by default. Generally this is good and required (wine provides many "system" dlls, which is what makes it work at all), but in this case, it prevents the Doorstop hook from being seen when the game launches. By overriding winhttp, we've just made the proton behavior match what happens on Windows.

We're done with the terminal, so you can close it. Launch the game through steam as you normally would, and you should be all set! proof

piotrulos commented 3 years ago

Good tutorial, I leave it pinned if someone wants it

buck2202 commented 3 years ago

Screenshot from 2021-02-24 20-32-01

Just a quick followup to say I've tried a handful of mods and so far everything has worked as it should. Hope this is helpful to someone. Thanks for your work on this project!

slowpoke9292 commented 3 years ago

how do i fix crashing? output_log.txt

buck2202 commented 3 years ago

I don't see anything that looks like a crash in your output. Can you confirm that you applied the patch using the game's proton prefix, and that you're launching the game through steam? Which version of proton?

slowpoke9292 commented 3 years ago

I don't see anything that looks like a crash in your output. Can you confirm that you applied the patch using the game's proton prefix, and that you're launching the game through steam? Which version of proton? I got it fixed using windows steam, plus I don't have Proton. Thank you though :) Screenshot 2021-03-22 2 01 48 PM

slowpoke9292 commented 3 years ago

(I can also post an ingame screenshot if needed.)

sharkjung commented 3 years ago

Can't get anything upwards of 1.1.7 to work. As you stated above, the patcher works fine but the mod loader simply doesn't even seem to be installed. I was using Proton 5.13 so far, but tried version 5.0-10 in my last attempt and that gave me the same results. Could you help me out?

buck2202 commented 3 years ago

Can't get anything upwards of 1.1.7 to work. As you stated above, the patcher works fine but the mod loader simply doesn't even seem to be installed. I was using Proton 5.13 so far, but tried version 5.0-10 in my last attempt and that gave me the same results. Could you help me out?

@petralka that sounds like the necessary winhttp override isn't set up. did you go through the whole process using the game's proton prefix as described above? you can always verify local files in steam to get a fresh start if you think there's a chance you were working in your pc's default wine for any of it

edit: even though the patcher might seem like it's working if you just use the system's default wine installation, I'd recommend doing everything under the correct proton prefix so that the patcher sees the same paths as when you launch the game through steam

slowpoke9292 commented 3 years ago

Can't get anything upwards of 1.1.7 to work. As you stated above, the patcher works fine but the mod loader simply doesn't even seem to be installed. I was using Proton 5.13 so far, but tried version 5.0-10 in my last attempt and that gave me the same results. Could you help me out?

@petralka that sounds like the necessary winhttp override isn't set up. did you go through the whole process using the game's proton prefix as described above? you can always verify local files in steam to get a fresh start if you think there's a chance you were working in your pc's default wine for any of it

edit: even though the patcher might seem like it's working if you just use the system's default wine installation, I'd recommend doing everything under the correct proton prefix so that the patcher sees the same paths as when you launch the game through steam

An update to my last comment: I got it working with the full package.

sharkjung commented 3 years ago

I tried the full package this time, one thing I noticed was that I wrote MSCOMPATDIR instead of MSCCOMPATDIR, going through my command history I discovered that I was using both names. Anyways, it worked! Thanks for the guide, @buck2202!

Kreyren commented 3 years ago

Setting the winhttp override fixed the deployment on my system, thanks