pixeltris / YgoMaster

Offline Yu-Gi-Oh! Master Duel
MIT License
886 stars 127 forks source link

Linux support for YgoMaster #17

Closed Laezor closed 1 year ago

Laezor commented 2 years ago

Would be cool if there was linux support for this offline version. I can run the official one fine.

pixeltris commented 2 years ago

I assume that's under Wine? I currently don't have a Linux machine set up to look into this.

Laezor commented 2 years ago

Well, actually I added it as a non-steam game under proton. Which the official works fine just click play and it runs. YgoMaster when I click play it says I am playing the game for a second and then stops. No error nothing.

pixeltris commented 2 years ago

Well this project avoids Steam entirely so it might be interfering with it. It might work when ran directly under Wine, but I'm not sure. I'll have to look at it at some point.

Laezor commented 2 years ago

well if I run it under wine, a wine terminal pops up and its writing initialized. Then its stuck.

adrianrlaw commented 2 years ago

I've tried running this via reaper (must be in the Build directory in the game folder): STEAM_COMPAT_CLIENT_INSTALL_PATH=$HOME/.steam/steam STEAM_COMPAT_DATA_PATH=$HOME/.local/share/Steam/steamapps/compatdata/ygomaster PROTON_LOG=1 $HOME/.steam/root/ubuntu12_32/reaper SteamLaunch -- $HOME/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/_v2-entry-point --verb=waitforexitandrun -- $HOME/.local/share/Steam/steamapps/common/Proton\ 6.3/proton waitforexitandrun $HOME/.local/share/Steam/steamapps/common/Yu-Gi-Oh\!\ \ Master\ Duel/Build/ygomaster.bat

Contents of ygomaster.bat:

START /B YgoMaster.exe
CMD
TASKKILL /IM "YgoMaster.exe" /F

Then I invoke YgoMasterClient.exe manually. When that happens, the message "DetourCreateProcessWithDll failed 87" pops up, which I believe is ERROR_INVALID_PARAMETER after some googling. That said, I'm not even sure if proton/wine has the Detour Library available...

pixeltris commented 2 years ago

Detours uses win32 functions so wine should cover them. That being said the specifics of how DetourCreateProcessWithDll launches a process might not be covered by wine. There is a second piece of code capable of launching the game, but there's a good chance it will also fail to work as it does very specific things.

https://github.com/pixeltris/YgoMaster/blob/7b5e3ecb1a1afd9d7d2cd8a31a747816f87a32d7/YgoMasterClient/Program.cs#L54

Try changing that to

success = GameLauncher.Launch(GameLauncherMode.StealEntryPoint);

And then recompile the C# code.

adrianrlaw commented 2 years ago

With that modification, I'm getting:

wine: Unhandled page fault on read access to 00000000000000C8 at address 000000018026D3B3 (thread 014c), starting debugger...

Then it crashes.

Absolutely no idea what this means. I will note I did build it using Github Actions since I currently am without a Windows machine. :/

pixeltris commented 2 years ago

It's likely a slightly different method of launching is required. I'll look at it at some point in the future. At the moment I don't have a Linux setup to test things.

lakotajames commented 2 years ago

My guess is that it has to do with Mono. If you could get it to work with Mono on Windows, I bet that fixes it on Linux. Alternatively, if it were using a different version of dotNet it might work to install that version on Linux instead of using mono. Wine chokes on 4 for some reason.

pixeltris commented 1 year ago

I've made a fix and tested under Ubuntu. I didn't run into the other issues mentioned here. It can be run under wine and there's some basic info on how to do that here https://github.com/pixeltris/YgoMaster/blob/master/Docs/Linux.md

There isn't a release for this yet so you'll need to compile the code including the C++ until v1.34 is released.

bjayers commented 2 months ago

For anyone who comes here looking for how to get 1.50+ working on Steam Deck:

  1. Just download and install as directed on https://github.com/pixeltris/YgoMaster/blob/master/Docs/Linux.md, but there’s no need for Wine.
  2. Make a .bat file in the YgoMaster directory with “MonoRun.exe” on the first line and “YgoMasterClient.exe” on the second, then
  3. Add the .bat file to Steam as a non-Steam game and force Proton (I used Proton GE) like any other game.

Works like a charm in gaming mode, and there’s no need for Lutris or any other third party apps anymore. I also did not need to perform the window focus change fix with this.

skyler14 commented 1 month ago

For anyone who comes here looking for how to get 1.50+ working on Steam Deck:

1. Just download and install as directed on https://github.com/pixeltris/YgoMaster/blob/master/Docs/Linux.md, but there’s no need for Wine.

2. Make a .bat file in the YgoMaster directory with “MonoRun.exe” on the first line and “YgoMasterClient.exe” on the second, then

3. Add the .bat file to Steam as a non-Steam game and force Proton (I used Proton GE) like any other game.

Works like a charm in gaming mode, and there’s no need for Lutris or any other third party apps anymore. I also did not need to perform the window focus change fix with this.

Is this after you have installed the game already or does this work without that/handle downloading data on its own. Also will this work without wine via Proton on desktop linux>