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

Metal Gear Solid 2 #63

Open
AlpyneDreams opened this issue Nov 18, 2022 · 22 comments
Open

Metal Gear Solid 2 #63

AlpyneDreams opened this issue Nov 18, 2022 · 22 comments
Labels
bug Something isn't working working! This game works, but may still need attention.

Comments

@AlpyneDreams
Copy link
Owner

This was the first game I had running on Windows. It's about 10x more broken on Linux. Will need to get it running with wined3d first before I can test d8vk.

@Bitwolfies
Copy link

Bitwolfies commented Dec 15, 2022

At the very least the HUD spawns, but it claims to be using DX9, I suspect that's due to GOG bundling their DX8-9 wrapper with the game. Curious as to if you're using the retail or gog copy? Deleting the wrapper refuses to make the HUD appear unfortunately (Assuming I installed it right)
Screenshot_20221214_231057

@Blisto91
Copy link

How did you install

@Bitwolfies
Copy link

Bitwolfies commented Dec 15, 2022

How did you install

GOG offline installer, and I used lutris with DXVK and everything disabled to create the prefix. I then dropped the two dll's in the latest release into the system32 folder and overwrote. Overid both as well to only use the prefix dll's.

@Blisto91
Copy link

Blisto91 commented Dec 15, 2022

32bit goes into SYSWOW64 unless it's a 32bit only prefix🙂

@Bitwolfies
Copy link

Bitwolfies commented Dec 15, 2022

32bit goes into SYSWOW64 unless it's a 32bit only prefixslightly_smiling_face

Well that would be my fault then, whoops! After fixing it its about the same however. With GOG's wrapper it produces the same image above, deleting it gives this instead.
Screenshot_20221215_014749

Generates the cache file as well, I suppose its wise to make sure all testers know about that wrapper since the gog version will 100% be the most commonly owned one.

@Manu270891
Copy link

The retail version works quite well with D8VK in my Steam Deck. I only noticed some lightning bugs on the tanker section while looking at the horizon. The mgs2_sse.exe file must be edited to fix the texture issues just like on Windows, but D8VK is doing a great job with this game, the power usage is lower than dgVoodoo+DXVK. Unfortunately, the GOG version comes patched with both audio and video wrappers (curiously no input wrapper), so D8VK and IndirectSound are useless on that release. I’m sure that the GOG release can be patched to match the wrapper-clean retail version.

@Bitwolfies
Copy link

The retail version works quite well with D8VK in my Steam Deck. I only noticed some lightning bugs on the tanker section while looking at the horizon. The mgs2_sse.exe file must be edited to fix the texture issues just like on Windows, but D8VK is doing a great job with this game, the power usage is lower than dgVoodoo+DXVK. Unfortunately, the GOG version comes patched with both audio and video wrappers (curiously no input wrapper), so D8VK and IndirectSound are useless on that release. I’m sure that the GOG release can be patched to match the wrapper-clean retail version.

You're saying deleting the d3d8 wrapper causes the game to no longer work properly? Or am I misunderstanding.

@Manu270891
Copy link

Manu270891 commented Jan 16, 2023

The retail version works quite well with D8VK in my Steam Deck. I only noticed some lightning bugs on the tanker section while looking at the horizon. The mgs2_sse.exe file must be edited to fix the texture issues just like on Windows, but D8VK is doing a great job with this game, the power usage is lower than dgVoodoo+DXVK. Unfortunately, the GOG version comes patched with both audio and video wrappers (curiously no input wrapper), so D8VK and IndirectSound are useless on that release. I’m sure that the GOG release can be patched to match the wrapper-clean retail version.

You're saying deleting the d3d8 wrapper causes the game to no longer work properly? Or am I misunderstanding.

"mgs2_sse.exe" and one of the config exe files are modified on the GOG version, so those files should be restored to the retail ones. Well, in the case "mgs2_sse.exe" not exactly the original one. The retail release must be:

  1. Updated to 2.0 using the official patch.
  2. Cracked to remove the DVD-Check.
  3. Hex edited to fix the texture issues:
    Search for the "GeForce" text string on "mgs2_sse.exe". Right before that string, another string containing "RADEON" should appear. Replace "GeForce" with "Removed" and "RADEON" with "AMD Cu". Depending on the graphics wrapper, the game's settings config tool shows different GPU names. In the case of D8VK, the name is "AMD Custom...".

Also, the wrapper files should also be removed.

@Bitwolfies
Copy link

Yeah, I guess that makes sense, I forgot GOG's wrapper goes a bit further into its games, providing its own methods in a separate exe to change things like resolution and aliasing. So the issue for GOG's is a DXVK one, and the retail one is a D8VK issue. A bit annoying GOG's wrapper is a bit more integrated.

@Manu270891
Copy link

Manu270891 commented Jan 18, 2023

Some of these instructions might change depending on your Linux Distribution, hardware or installed software. I made these instructions with the Steam Deck running on "SteamOS" and my desktop PC running on "Windows 11" in mind.

1- Install "cabextract" (it is required to install some dependencies through "Winetricks"). It should be reinstalled after every "SteamOS" update:
a) "sudo steamos-readonly disable".
b) "sudo pacman-key --init".
c) "sudo pacman-key --populate archlinux".
d) "sudo pacman -Sy archlinux-keyring".
e) "sudo pacman -Syu".
f) "sudo pacman -S cabextract".
g) "sudo steamos-readonly enable".

2- Install "Flatseal", "Lutris", "Okteta", "ProtonUp-Qt" and "Wine" through the Discover Store.
a) I allowed access to the whole file system through "Flatseal" to "Lutris", "ProtonUp-Qt" and "Wine", but I don't know if it's required.
b) I also added some aliases for Wine:
- "echo "alias wine='flatpak run org.winehq.Wine'" >> ~/.bashrc".
- "echo "alias winetricks='flatpak run --command=winetricks org.winehq.Wine'" >> ~/.bashrc".
c) Launch and close "Lutris" to generate the folder structure required for "ProtonUp-Qt" detecting "Lutris".

3- Use "ProtonUp-Qt" to install the latest "DXVK", "DXVK Async" and "Wine GE" versions onto "Lutris".

4- Install the GOG version as usual on a temporary Wine prefix. This prefix will be removed later.

5- Convert the GOG release to the retail release:
a) Remove the following folders and files from the install folder:
- "\__redist\".
- "\__support\".
- "\bin\d3d8.dll".
- "\bin\dinput8.dll".
- "\bin\dixi.ini".
- "\bin\dxcfg.exe".
- "\bin\dxcfg.ini".
- "\bin\MGS2SSET.ini".
- "\savedata\".
- "\gog.ico".
- "\goggame-2069117974.hashdb".
- "\goggame-2069117974.ico".
- "\goggame-2069117974.id".
- "\goggame-2069117974.info".
- "\goggame-2069117974.script".
- "\goggame-galaxyFileList.ini".
- "\goglog.ini".
- "\Launch Metal Gear Solid 2 - Substance.lnk".
- "\support.ico".
- "\unins000.dat".
- "\unins000.exe".
- "\unins000.ini".
- "unins000.msg".
b) Extract this file into the install folder. Now, MGS 2 is converted to an updated retail version.

6- Move the install folder outside the prefix and remove the prefix. The GOG installer installs some dependencies, which could conflict with some other dependencies that are going to be installed in the new prefix.

7- Create a new Lutris entry for MGS2 with the following settings:
a) "Game info" tab:
- "Name" -> "Metal Gear Solid 2: Substance".
- "Runner" -> "Wine (Runs Windows games)".
b) Game options" tab:
- "Executable" -> Select the "\bin\mgs2_sse.exe" file once the files are copied (not yet).
- "Wine prefix" -> Select the folder where the prefix will be created.
- "Prefix architecture" -> "Auto (default)".
c) "Runner options":
- "Wine version" -> "lutris-GE-proton...".
- Uncheck the "Enable DXVK", "Enable VKD3D" and "Enable dgVooodoo2" settings.
d) "System options":
- "Environment variables":
- Add the "LANG" key with the value according to the language you want the game to be run. For example "es_ES.UTF-8". This is not required if you want to run the game in english.

8- Create the prefix by entering "Wine configuration" for the newly created entry.
a) Select "Windows 7" as the "Windows Version".

9- Copy the game folder to the newly created prefix (for example to "C:\Games").

10- Install the required dependencies. Some of them are required by the own game, some others by the wrappers:
a) The dependencies should be installed through the command line. This allows the user to check the install progress, unlike using the bundled "Winetricks" on "Lutris", which always makes silent installs.
b) Type the following commands on the command line/console (these could change with future updates as some folders make reference to installed versions):
- "export WINE='/home/deck/.var/app/net.lutris.Lutris/data/lutris/runners/wine/lutris-GE-Proton7-35-x86_64/bin/wine'".
- "export WINE64='/home/deck/.var/app/net.lutris.Lutris/data/lutris/runners/wine/lutris-GE-Proton7-35-x86_64/bin/wine64'".
- "export WINEPREFIX='prefix folder'".
- "/var/lib/flatpak/app/org.winehq.Wine/x86_64/stable-21.08/f0038f4169a6bc6d66209aa3347c29ef8154b020e3b28c2d6c1cccfd42724f67/files/bin/winetricks directmusic dsdmo dsound vcrun2019 quartz".
- "directmusic", "dsdmo" and "dsound" are required for "IndirectSound".
- "vcrun2019" is required for "Xidi".
- Installing "quartz" should give an error, it's the expected behaviour.

11- Open "Wine configuration" and then open the "Libraries" to add the following DLL overrides:
a) "d3d8".
- Required for "D8VK".
b) "d3d9".
- Required for "D8VK".
c) "dinput8".
- Required for "Xidi".
d) "winmm".
- Required for "Ultimate ASI Loader".

12- Install the wrappers:
a) D8VK (graphics wrapper):
- Extract "d3d8.dll" and "d3d9.dll" to the "\bin" folder.
b) IndirectSound (audio wrapper):
- Extract "dsound.dll" and "dsound.ini" to the "\bin" folder.
c) Xidi (input wrapper):
- Extract "\win32\dinput8.dll" to the "\bin" folder.

13- Widescreen fix:
a) Extract "dinput8.dll" from Ultimate ASI Loader (x86) outside the prefix, rename it to "winmm.dll" and move it to the "\bin\" folder.
b) Extract "fov.data", "mgs2w.dll" and "mgs2w.ini" from the Widescreen Fix to "\bin\scripts", then rename "mgs2w.dll" to "mgs2w.asi".
c) Edit the "\bin\scripts\mgs2w.ini file":
- "Width = 1280" -> "Width = xxxx".
- "Height = 720" -> "Height = yyyy".
- "cutscenes_top_black_border = 480" -> "cutscenes_top_black_border = 0".
- "cutscenes_bottom_black_border = 480" -> "cutscenes_bottom_black_border = 0".
- "custom_fov = 1" -> "custom_fov = 0".

14- FMV Fix:
a) Extract this "quartz.dll" onto "/drive_c/windows/syswow64/" on the prefix to fix the FMVs (both the intro and tanker projector films).

15- Configure the game -> Launch "\bin\MGS2SConfig.exe" and select "OPTION:
a) "Starting Setup" tab:
- Take note of the "Graphics Driver" value. This depends on the GPU and the used graphics wrapper (in this case "D8VK").
- For example, on the Steam Deck using "D8VK" the value is "AMD Custom GPU 0405 (RADV VANGOGH)".
- "Screen Format" -> Use the slider to select your display's native resolution. If the display's resolution isn't showing up, there is a fix for that in the step 16.
b) "Drawing" tab:
- Select "LEVEL" and move the slider to "High".
c) "Effect" tab:
- Select "LEVEL" and move the slider to "High".
- Select "CUSTOM" and disable the "Focus" and "Motion Blur" checkboxes:
- "Focus" controls the depth of field effect, which looks bad on high resolutions. It looks OK in 480p.
- "Motion Blur" works correctly, but it's not a modern implementation of the effect and looks quite bad regardless on the resolution.
d) "Sound" tab:
- "Quality" -> "44khz".
- It's possible that entering this tab makes the app crash. Disable the "winmm" DLL override momentarily to change this setting. If a crash occurs, all the modified settings will be lost.
e) "KEY Config" tab (set all actions on the second column, it's possible to leave a blank field by pressing the same button twice):
- "Left U" -> Blank.
- "Left D" -> Blank.
- "Left R" -> Blank.
- "Left L" -> Blank.
- "Crawl(A)" -> A button.
- "Punch(B)" -> B button.
- "L1" -> LT trigger.
- "L2" -> LB button.
- "L3" -> LS button.
- "BACK" -> Back button.
- "Slow" -> RB button.
- "Weak" -> RB button.
- "L Stick X" -> Move the left stick in any horizontal direction.
- "L Stick Y" -> Move the left stick in any vertical direction.
- "Right U" -> Blank.
- "Right D" -> Blank.
- "Right R" -> Blank.
- "Right L" -> Blank.
- "Weapon(X) -> X button.
- "Action(Y) -> Y button.
- "R1" -> RT trigger.
- "R2" -> Blank.
- "R3" -> RS button.
- "START" -> Start buttom.
- "1P View" -> RS button.
- "R Stick X" -> Move the right stick in any horizontal direction.
- "R Stick Y" -> Move the right stick in any vertical direction.
f) "KEY Config ( First person view )" tab (set all actions on the second column, it's possible to leave a blank field by pressing the same button twice):
- "Forward" -> Blank.
- "Back" -> Blank.
- "Move Right" -> Blank.
- "Move Left" -> Blank.
- "Crawl(A)" -> A button.
- "Punch(B)" -> B button.
- "L1" -> LT trigger.
- "L2" -> LB button.
- "L3" -> LS button.
- "BACK" -> Back button.
- "Slow" -> RB button.
- "Weak" -> RB button.
- "L Stick X" -> Move the left stick in any horizontal direction.
- "L Stick Y" -> Move the left stick in any vertical direction.
- "Look Up" -> Blank.
- "Look Down -> Blank.
- "Look Right" -> Blank.
- "Loof Left" -> Blank.
- "Weapon(X) -> X button.
- "Action(Y) -> Y button.
- "R1" -> RT trigger.
- "R2" -> Blank.
- "R3" -> RS button.
- "START" -> Start button.
- "AIM" -> Blank.
- "R Stick X" -> Move the right stick in any horizontal direction.
- "R Stick Y" -> Move the right stick in any vertical direction.

16- Edit the "\bin\mgs2.ini" file:
a) The second column of the lines that begin with "0003" (X axis) and "0004" (Y axis) specify the screen resolution:
- Type the screen resolution in hex format.
- For example:
- "1280x800" -> "0500" and "0320".
- "3840x2160" -> "0F00" and "0870".
b) The second column of the lines that begin with "0006" (X axis) and "0007" (Y axis) specify the rendering resolution (quite uncommon for such an old game):
- These values must:
- Be a power of 2 (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096 etc.).
- Match or exceed the screen resolution.
- For example:
- 1280x800:
- The X axis has a "1280" value, so the value must be a power of 2 which matches or exceeds "1280", so, "2048". The hex value of "2048" is "0800".
- The Y axis has a "800" value, so the value must be a power of 2 which matches or exceeds "800", so, "1024". The hex value of "1024" is "0400".
- 3840x2160:
- The X axis has a "3840" value, so the value must be a power of 2 which matches or exceeds "3840", so, "4096". The hex value of "4096" is "1000".
- The Y axis has a "2160" value, so the value must be a power of 2 which matches or exceeds "2160", so, "4096". The hex value of "4096" is "1000".

17- Hex edit the "\bin\mgs2_sse.exe" file (using "Okteta"):
a) Search for the first result of the "GeForce" string. Just before the "GeForce" string, there should be a "RADEON" string.
b) Replace the "GeForce" string with the "Removed" string.
c) Replace the "RADEON" string with the first 6 characters of the value showing in the "Grahics Driver" setting in the game's config tool.
- For example, on the Steam Deck using "D8VK" the value is "AMD Custom GPU 0405 (RADV VANGOGH)", so "RADEON" should be replaced with "AMD Cu".

18- Rename "\bin\MGS2SConfig.exe" to "\bin\MGS2SConfig_OLD.exe" to prevent the launcher running everytime the game gets closed.

19- Set the "Executable" setting on the "Lutris" entry to "\bin\mgs2_sse.exe".

I know it's a long process, but the game runs beautifully this way on my Steam Deck (despite some visual bugs in the tanker section while looking at the horizon).

I haven't managed to make the third-person mod work under Wine, but I'm sure it's possible.

Curiously, while D8VK works also for this game on Windows and exhibits the same graphical issues, the config app crashes if D8VK dlls are present on the "\bin\" folder.

@Manu270891
Copy link

Manu270891 commented Jan 18, 2023

Here are two screenshots showcasing bugs using D8VK. The game is running on my Steam Deck at 1280x800. The screenshots are 3840x2160 because I'm using an external monitor.

1
2

@AlpyneDreams
Copy link
Owner Author

First version I tried was actually the retail DVD version.

@Manu270891 I am very glad that everything is working for you, especially on Steam Deck as I don't have one to test with.

Search for the "GeForce" text string on "mgs2_sse.exe". Right before that string, another string containing "RADEON" should appear. Replace "GeForce" with "Removed" and "RADEON" with "AMD Cu". Depending on the graphics wrapper, the game's settings config tool shows different GPU names. In the case of D8VK, the name is "AMD Custom...".

We can probably implement a fix for this.

@AlpyneDreams AlpyneDreams added the help wanted Extra attention is needed label Feb 1, 2023
@AlpyneDreams AlpyneDreams removed the game label Feb 23, 2023
@AlpyneDreams
Copy link
Owner Author

AlpyneDreams commented Apr 19, 2023

Here are two screenshots showcasing bugs using D8VK. The game is running on my Steam Deck at 1280x800. The screenshots are 3840x2160 because I'm using an external monitor.

Looking into this bug now and also the radeon geforce thing.

@AlpyneDreams
Copy link
Owner Author

AlpyneDreams commented Apr 19, 2023

There was a regression so I dealt with that first. The game seems to work fine now...

@Manu270891
Copy link

Can't wait for the new version!

@WinterSnowfall
Copy link

@AlpyneDreams Please check if the game still works with #140 when you get the chance. Everything that regressed due to 08e183f should be addressed in the PR, assuming MGS2 is also left unbroken.

@Manu270891
Copy link

@AlpyneDreams Please check if the game still works with #140 when you get the chance. Everything that regressed due to 08e183f should be addressed in the PR, assuming MGS2 is also left unbroken.

How can I download the new build?

@WinterSnowfall
Copy link

How can I download the new build?

New commits automatically trigger builds on the Actions tab. Once these complete, you can find the zip files under the "Artifacts (Package)" entries. Here is the link to my PR for example: https://github.com/AlpyneDreams/d8vk/actions/runs/4746626172 . Note that you have to be logged in to see & download them.

@AlpyneDreams AlpyneDreams added bug Something isn't working enhancement New feature or request and removed help wanted Extra attention is needed labels Apr 20, 2023
@AlpyneDreams
Copy link
Owner Author

@Manu270891 @Bitwolfies The latest build fixes the regression and the game runs well with d8vk (if you can get it to run in the first place).

All that's left is very minor graphical glitches which I will look into later.

@Manu270891
Copy link

Manu270891 commented Apr 22, 2023

Owner

@Manu270891 @Bitwolfies The latest build fixes the regression and the game runs well with d8vk (if you can get it to run in the first place).

All that's left is very minor graphical glitches which I will look into later.

The game still works with the latest build, but the exe must still be hex edited and those visual bugs are still present. Anyway, it's still an improvement, D8VK doesn't require "d3d9.dll" anymore!

I also noticed that using "DXVK_HUD=version" shows "DXVK v1.7.1..." instead of "DXVK d8vk..." as the 0.10 release.

@Manu270891
Copy link

Manu270891 commented Apr 23, 2023

@Manu270891 @Bitwolfies The latest build fixes the regression and the game runs well with d8vk (if you can get it to run in the first place).

All that's left is very minor graphical glitches which I will look into later.

The new "artifact" D8VK releases allow to rename the ASI Loader (used for the widescreen and 60 fps patches) to "version.dll", which fixes the sound delays. Before this, the ASI Loader was named "winmm.dll", which interfered certain multimedia (mm) calls, but there wasn't any other alternative. Also, the "d3d9.dll" file is not required anymore, so the wrapper has been simplified. I didn't expect D8VK to fix this, but is has!

@AlpyneDreams
Copy link
Owner Author

I also noticed that using "DXVK_HUD=version" shows "DXVK v1.7.1..." instead of "DXVK d8vk..." as the 0.10 release.

Yeah, that's a weird bug in our automated build system. It's based on DXVK 2.1 not 1.7. The next major release will have a proper version number.

@AlpyneDreams AlpyneDreams added working! This game works, but may still need attention. and removed enhancement New feature or request labels Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working working! This game works, but may still need attention.
Projects
None yet
Development

No branches or pull requests

5 participants