Open kartur opened 2 years ago
Well, keenanweaver's patch is working as intended. It adds the dll override for the wine prefix that is currently running the installer. On a normal Linux distro, you'd just run the installer in the same prefix as the game is located, so it works. Steam deck is, apparently, running the installer in different prefix than the one running the game, I believe? I can't really say, since I don't own a Deck and haven't researched much about it. But there's not much more we can do about this from the installer, sadly.
There's no way for the main module (d3d8.dll) to do anything either, as that doesn't even get loaded without the override in place.
The only way to ensure the .dll gets loaded without needing any .dll overrides, is if the project moves from wrapping d3d8.dll, and instead they edit sh2pc.exe's import table to import the dll with a different/unique name. I believe that won't happen though, since it's a bit invasive and not very elegant.
What is stopping you from using protontricks to add the dll override manually, though? Doesn't that work on the deck?
@kartur It sounds like you are adding SH2EEsetup.exe and sh2pc.exe to Steam as two separate non-Steam games, so you're right in that there would be two 'separate' prefixes, and thus the DLL override isn't applying to your SH2. What I would do is the following:
Ok, since this seems to be the subject of this thread, I will re-post what I added here.
I created an update, by hacking the sh2pc.exe file, that should force the enhancement module to load regardless of the proton/wine settings.
For this I hacked the sh2pc.exe file to load d3dx.dll
, then I added a d3dx.dll file that will force loading the enhancement module d3d8.dll
.
Just unzip these files to the Silent Hill 2 folder, overwriting any files that are there. Here is the updated: sh2pc-Linux.zip
What is stopping you from using protontricks to add the dll override manually, though? Doesn't that work on the deck?
Yes, that works, but I am thinking of all the people that want to play SH2 EE with steam OS. It would be nice if the EE runs just like any other non-steam game by simply setting the compatibility to proton and that's it. Instead you currently have to install a clunky tool and do some hack that will confuse especially new users. It's just not a smooth process to get it working under steam os.
4. edit the SH2EEsetup entry in Steam to point to which executable you want to use
That is a good workaround actually, haven't thought of that. Definitely better than having to use protontricks. Still I think @elishacloud method would be preferable from a user perspective. :)
@keenanweaver I don't think step 2 and 3 is needed. Simply adding SH2EEsetup.exe to steam with proton, installing, then changing the target from SH2EEsetup to sh2pc.exe is enough. I also just tried it and recorded the whole process:
https://user-images.githubusercontent.com/2276497/178160741-434e2294-7f23-43f2-978a-eb890457b780.mp4
(There was still the issue with the grey screen and wires, but this was already patched, guess it is just not released yet with the installer)
Could we maybe change the text that comes with the override message box? According to the current code it says:
Wine detected
This installation was ran in Wine.
The Silent Hill 2: Enhanced Edition DLLs have automatically been set to "native, builtin" in the Wine configuration options.
For more information, see https://wiki.winehq.org/Wine_User%27s_Guide#DLL_Overrides
To make it easier to understand for Steam OS users, I would suggest mentioning Proton. Also I think it would be very helpful to warn people, that this override is only set for the current prefix/installer and will not work if you add sh2pc.exe as a new non-steam game. Also while we are at it, I would suggest leaving that part with the URL out, as you cannot click or copy it anyway. So I would suggest something like this:
Wine/Proton detected
This installation is running in Wine/Proton.
The Silent Hill 2: Enhanced Edition DLLs have automatically been set to "native, builtin" in the Wine configuration options.
For Steam Deck/OS users: This setting is only active for the currently used profile. If you added this installer as a non-steam game, simply change its target from SH2EEsetup.exe to sh2pc.exe and use that to start the game.
Ok, here is another update. For this update I modified the sh2pc.exe to load d3dx.dll
. Then d3dx.dll
will load the real d3d8.dll
from memory, to bypass Wine and Proton. I hope this one works for you.
Here is the update: sh2pc.zip
If I understand correctly, the WINE detection and DLL override from @keenanweaver should make the game use the d3d8.dll from the enhanced edition.
I tested this under steam os with proton, and the installer triggers your override. However, the override will not apply to the sh2pc.exe, but just to the SH2EEsetup.exe (If I start the game through SH2EEsetup.exe by chosing "Adjust settings" and then "Save & Launch game", the override works, but if I start sh2pc.exe directly the DLL override is not active). I guess because the sh2pc.exe has a different wine/proton prefix/profile?
Is there any way this detection and override functionality can maybe be baked into sh2pc.exe instead of SH2EEsetup.exe? Or any other idea how we can make sure sh2pc.exe uses the d3d8.dll from the enhanced edition instead of the WINE/Proton one?