X-Hax / sa2-mod-loader

Sonic Adventure 2 PC Mod Loader
47 stars 16 forks source link

[Linux] Instaling Mod Loader Causes to An Image Overlayed On Top Of Game #55

Open sonic2kk opened 3 months ago

sonic2kk commented 3 months ago

First, I am running the game on Linux (manually running SAModManager in the SA2 prefix), so I understand it is not officially supported. I am not running on SteamOS however, I am using this on my Arch Linux PC. My hope is that either someone has hit this before (on Linux or otherwise), or this is a general quirk of the game not specific to SAModManager or Linux and that I can get some general direction on (i.e. some DRM-related issue).

Describe the bug When the Mod Loader is installed, launching Sonic Adventure 2 will cause it to load to the image shown in the screenshot. This happens when the game is launched from the Mod Manager, from Steam directly, or any other method. This occurs when the Mod Loader is installed, as removing the Mod Loader fixes the issue.

The game is still running behind this image, and taking a screenshot with the Steam Overlay will not capture this image but rather what would be visible "behind" this image. Similarly, the game will still register keyboard/controller input. This image does overlay on top of the Steam Overlay, as it covers the FPS text, and the Steam Overlay is not visible over it (although it does work, as with a bit of guesswork I can press the "Exit Game" button from the Overlay).

With window resizing enabled, resizing the window will cause flashes of the game to be displayed during the repainting.

This began happening very suddenly, without changing the Mod Manager version, Wine/Proton version, etc. I do not have any mods installed that could be causing this issue.I do not have any mods installed that could be causing this issue. Could this be related to whatever modifications SAModManager might be making to how the game's windowing is handled?

To Reproduce Install the Mod Loader and launch Sonic Adventure 2 either from the Mod Manager or directly from Steam.

Expected behavior The game should not display this image overlayed on top.

Screenshots This screenshot was taken using a screenshot utility and not the Steam Overlay. I should note that before opening this issue, I did a reverse image search of this screenshot but it didn't turn up anything.

image

Desktop (please complete the following information):

Additional context If issues related to running the mod manager on Linux are not welcomed, please feel free to close this issue with no further justification, I completely understand.


EDIT: Enabling "Stretch to Window" under the "Game Config" tab fixes the issue for now.

PiKeyAr commented 3 months ago

Might be the border image drawing on top of the game window...

sonic2kk commented 3 months ago

It appears that running the game in "Exclusive Fullscreen" resolves the issue. Very strange as it worked in Borderless Fullscreen and Windowed in the past. Without the Mod Loader it also runs in Windowed mode perfectly fine from the launcher, although the Mod Loader has ways to hook into the game's windowing to adjust some options I am guessing, so comparing windowed mode with the Mod Loader and from the vanilla launcher without the Mod Loader is not an apples-to-apples comparison.

Perhaps this is related to this border image?

sonic2kk commented 3 months ago

Hm, thanks for that phrase actually. No luck sadly but I did see an option to "Disable Border Image". However enabling this just causes the game to render a black screen instead of this image. It has the same properties (and wavelength :wink:) as the border image where it goes on top of the game and overlay.

sonic2kk commented 3 months ago

Enabling "Stretch to Window" fixes the problem. That's very strange!

ItsEasyActually commented 3 months ago

Transferred to the correct repository.

We have a few other users on Linux, and nobody has reported this issue before. Not saying it's an isolated thing, but more info from other Linux/Steam Deck users would be helpful. Glad you at least found some work arounds, those are very likely to help narrow down the issue when we can get to looking at it proper.

@kellsnc is the one who handled the most recent updates to the window, so roping him in to give this a look when he's able to.

sonic2kk commented 3 months ago

If there's anything you need me to look into or test I am happy to help! I am planning to test with GameScope, an alternative compositor, in nested mode (meaning it runs on top of my KDE Plasma DE) in case this is a change in functionality that caused a regression on my Desktop Environment side.

I don't remember if I tested with PROTON_USE_WINED3D, which disables DXVK in favour of Wine's built-in OpenGL-based Direct3D renderer. I am no expert so please excuse my ignorance but looking at the latest commit related to window resizing, I can see it is possibly related to Direct3D.


On this subject, I assume the mod loader and SA-Mod-Manager can update independently of each other, right? In that case, is there an artifact I could use to test the Mod Loader prior to this commit? I am unsure how to build this myself or if it is even possible to build it on Linux.

This gives us three possible avenues to explore:

I don't have an alternative GPU to test on (all my hardware - PC, laptops, Steam Deck - are all-AMD) so if it is drivers I can't narrow down if it's specific to the AMD Mesa drivers. I could possibly try out AMD's proprietary drivers but I'd rather not unless there is no other way to test.

ItsEasyActually commented 3 months ago

I mean I already assumed this is related to the window changes that were made. You're free to look through the commit history for the built DLL found here if you want to find where a point in time it worked, but I'm pretty confident it's any number of the tweaks made for the last commit. This issue wasn't reported prior to those changes, and that was the last major update to the sa2 mod loader.

You're certainly welcome to test other environments to see if there's a fix as well, non-zero chance a change in one of those led to problems with how we modify the window via the mod loader.