LaughingLeader / BG3ModManager

A mod manager for Baldur's Gate 3.
MIT License
1.17k stars 188 forks source link

Linux Tips #12

Open chriseggroll opened 1 year ago

chriseggroll commented 1 year ago

Hello, this is not at Issue per se but wanted this out there for anyone running Baldur's Gate 3 in Linux and wanting to use this for mods.

Installation

For me this was not a problem, installed easily just using wine to run the installer. I might have already installed the required version of .net beforehand, but this is not hard if you use winetricks.

Settings

Here is where you can make a mistake because it's not going to auto detect the paths correctly.

Game Data Path - this is not where your profiles are located, it's the actual literal game data folder. For the steam version the location will be like this assuming you're running a runtime version of steam and not a flatpak version:

Z:\home\<user>\.steam\steam\steamapps\common\Baldurs Gate 3\Data

For mine it is Z:\home\chris\.steam\steam\steamapps\common\Baldurs Gate 3\Data

If you get this path wrong, it won't detect the Gustav entry that is required for the game to work correctly, and it will be missing from modsettings.lsx. This will make the game unplayable, but you can either delete or rename that file to fix.

The path to this again for default linux steam is

/home/<user>/.local/share/Steam/steamapps/compatdata/1086940/pfx/drive_c/users/steamuser/AppData/Local/Larian Studios/Baldur's Gate 3/PlayerProfiles/Public/modsettings.lsx

If you use a different version you can use find to locate it find ~/ -name 'modsettings.lsx' The steam appid for BG3 is 1086940, so that should be universal.

Game Executable Path - This is easier to figure out, should be almost the same as the first entry:

Z:\home\<user>\.steam\steam\steamapps\common\Baldurs Gate 3\bin

Here is a screenshot of my current config. The Z is what wine uses for your root linux path.

Screenshot from 2023-07-22 14-16-23

BG3 plays pretty well in Linux, I didn't have any issues using the Vulkan version and installing it with Steam Play using Proton Experimental.

FlamenWolf commented 1 year ago

It won't launch at all for me. I have a newer version of dot net installed and when I use wine to run the mod manager nothing happens.

Mershl commented 1 year ago

@FlamenWolf With dotnet472 (using winetricks) installed it should launch. The profile lookup will fail though if you don't start it using BG3's prefix (which I would not recommend).

@LaughingLeader BG3 mod manager already allows to manually set Data and Executeable path, would it be possible to introduce a third setting that controls the lookup of PlayerProfiles and GMCampaigns? It currently defaults to C:\users\[username]\AppData\Local\Larian Studios\Baldur's Gate 3 : https://github.com/LaughingLeader/BG3ModManager/issues/10#issuecomment-1622592927

The same might apply to the Mods folder, which currently defaults to C:\users\[username]\AppData\Local\Larian Studios\Baldur's Gate 3\Mods (this propably inherits the path from the lookup of PlayerProfiles and GMCampaigns).

Yep, it seems all of them are based on: https://github.com/LaughingLeader/BG3ModManager/blob/f63c49cf7dbe7f9a9581d50f6519a8be9f7dcb35/GUI/ViewModels/MainWindowViewModel.cs#L1261

Azurion42 commented 1 year ago

For whatever reason, no matter what I've tried, I just cannot get the BG3 mod manager to launch. I've tried running it through steam, tried from Proton Experimental down to 5.X. I'm on Fedora 38 Wayland KDE Plasma. And like FlamenWolf, I've got a newer version of DotNet installed for BG3, and tried launching the manager from within that prefix with winetricks and protontricks.

zee5679 commented 1 year ago

For whatever reason, no matter what I've tried, I just cannot get the BG3 mod manager to launch. I've tried running it through steam, tried from Proton Experimental down to 5.X. I'm on Fedora 38 Wayland KDE Plasma. And like FlamenWolf, I've got a newer version of DotNet installed for BG3, and tried launching the manager from within that prefix with winetricks and protontricks.

I have the same issue nothing I do can get the modloader to work under linux via wine/proton

vparitskiy commented 1 year ago

What if you just symlink actual path to the path the program expects it to be, looks like a trivial workaround.

Tho in my case it doesn't start at all as well.

Lii-Kun commented 1 year ago

.net is like other redist. and you need older versions to run things. so just cause you have .net 7 installed it wont run the mod manager, you need .net472. I got the mod manager running in bottles and symlinked the C:\users\[username]\AppData\Local\Larian Studios folder

scottz657 commented 1 year ago

In order to get it working I used winetricks to install dotnet472 to ge the application to lauch and the native d3dcomplier_47 to get the UI to work.

The manager detected my game location just fine, but created the mods folder in AppData in the prefix I was running it in, so I had to symlink the real Larian Studios folder to where the mod manager was looking for it. (like Lii-Kun described).

Hope this helps if anyone runs into the same issues I did.

Azurion42 commented 1 year ago

for whatever reason, whenever I try and install dotnet472 via winetricks it tells me I can't because a newer version is installed.

adamisafk commented 1 year ago

@Lii-Kun how did you get it to launch with bottles? I'm made a new bottle and installed dotnet472, d3dcomplier_47, and tried different runners but it crashes with "unhandled exeption: 0xe0434352". I believe this exception code is coming from .NET somewhere. Are you able to share me your bottle configuration?

I can get further if I use Lutris but the program closes soon after it launches when it first loads.

ptkato commented 1 year ago

and the native d3dcomplier_47 to get the UI to work

@scottz657 did you do anything else to get the UI working properly? it opens here, but it's all wonky and glitchy. Which wine version are you using?

scottz657 commented 1 year ago

I'm using wine-8.0.2, and the only thing I did was create a clean 64-bit prefix install dotnet and d3dcompier_47 and that's it. I did it all using wine and winetricks I didn't bother with bottles or anything like that.

EDIT: I'm also using Debian Testing if that matters.

gxtu commented 1 year ago

For me it didn't work (UI flickering, constant crashes) with plain wine and installing dependencies via winetricks. Using bottles with the default soda runner and installing dependencies through the UI worked great though.

I did have to manually set the DocumentsFolderPathOverride value in BG3ModManager's settings.json (because the setting doesn't seem to be exposed in the UI) though. Otherwise it would install the mods to its own wine prefix instead of the game's.

My settings.json now looks like this:

{
  "GameDataPath": "Z:\\home\\<user>\\.steam\\steam\\steamapps\\common\\Baldurs Gate 3\\Data",
  "GameExecutablePath": "Z:\\home\\<user>\\.steam\\steam\\steamapps\\common\\Baldurs Gate 3\\bin\\bg3.exe",
  "DocumentsFolderPathOverride": "Z:\\home\\<user>\\.steam\\steam\\steamapps\\compatdata\\1086940\\pfx\\drive_c\\users\\steamuser\\AppData\\Local\\Larian Studios\\Baldur's Gate 3\\",
  [...]
}
InventorXtreme commented 1 year ago

Thanks, just helped me fix a friends issue

Draxiss314 commented 1 year ago

So, trying to run BG3ModManager.exe from the terminal using both Proton's wine (and wine64) and my computer's built-in wine (with WINEPREFIX=~/.steam/steam/steamapps/compatdata/1086940/pfx) results in the program crashing to desktop with a large error log ending with: Description: The process was terminated due to an internal error in the .NET Runtime at IP 0000000000F84B60 (0000000000EA0000) with exit code 80131506. Alternatively, running BG3ModManager.exe through Bottles causes it to crash with a large error report as well that I'll copy-paste only if someone asks

Yes, I have installed dotnet472 and d3dcompile47 in both my CompatData prefix AND in my wine bottle. Yes, I ran winecfg and ensured that d3dcompile47 is enabled as 'native' in my library.

Additionally, I have symlinked the paths to my steamapps executable BG3 saves/mods/ect. files into the Bottles prefix so they can be easily seen by Bottles.

Edit: Basically, I want to know if anyone else is suddenly having similar issue.

smumriak commented 1 year ago

how did you install dotnet 4.7.2? it depends on dotnet 4.0 which is known to be impossible to install

Draxiss314 commented 1 year ago

how did you install dotnet 4.7.2? it depends on dotnet 4.0 which is know to be impossible to install

Do you mean dotnet 4.5? I used the command `WINEPREFIX=[Blah blah blah] winetricks --force dotnet472. It kicked some errors but still went through, and for a while the BG3 Mod Manager seemed to work alright.

I did find that I couldn't repair the 4.0 installation when I called the program later because I already had a newer version of dotnet, so I don't know what's up with that.

smumriak commented 1 year ago

No, I mean 4.0. Winetricks is trying to install all the downstream versions of dotnet for some reason when I select 4.7.2

Draxiss314 commented 1 year ago

No, I mean 4.0. Winetricks is trying to install all the downstream versions of dotnet for some reason when I select 4.7.2

I think that's expected behavior. As in, it tries to download everything from 4.0 to 4.7.2? I believe that 4.7.2 is dependent on those earlier version.

Draxiss314 commented 1 year ago

Anyways, I appear to have fixed my problem by force-installing dotnet 4.8, of all things. I have no idea why that worked, but it did and I'm so afraid of touching anything in case it breaks again.

smumriak commented 1 year ago

Yes, and that's the problem dotnet 4.0 is not installable without ritual dancing around the computer. that's why i'm asking how people get it to work. there's this giga-guide that i'm really reluctant to invest any time into: https://steamcommunity.com/sharedfiles/filedetails/?id=2386287653

smumriak commented 1 year ago

I have no idea why that worked

thanks

smumriak commented 1 year ago

Got it.

now if you'll try to install dotnet 4.7.2 you'll see 4.5 failing to install. god i hate dotnet

Lii-Kun commented 1 year ago

didn't know dotnet was suck a pain but for me all I did was set up a bottle set to games and then went into its dependency installer and set it to install 472. Which also installed the rest of 4.x. It took a while and you had to hit next on popups a few times but it just worked.

Kuuchuu commented 1 year ago

While I have yet to actually get BG3ModManager working using Bottles or otherwise, I did put this Python script/repo together which I believe should (in-theory) work (on a computer other than mine). Using my Python script has gotten me farther than any other attempt, it appears to launch but then hangs before it can actually display the GUI properly. Every now and then the wine console output continues to spit out fixme-s, but I'm unsure if it's actually still trying to load up or not. (Fixed by adding d3dcompiler_47 to the wine_prefix)

If anyone is brave enough to give it a try the Python script is relatively easy to look through. Just throw it in the same directory as BG3ModManager.exe and call it using the --setup flag. If you run it without arguments it runs BG3ModManager.exe with the wine_prefix it set up. It can also add itself to Steam as a non-Steam game for easy launching using the --steam flag.

I cannot guarantee it will work, and it will take a good few minutes to install all of the dotNET frameworks needed, but I don't believe it can cause any sort of harm to the OS. It creates a new wine_prefix at "/home/{user}/.local/share/wineprefixes/BG3MM/" and uses that for running BG3ModManager.

smumriak commented 1 year ago

Nice. Frankly, I gave up and installed mods by hand. It's actually easier than installing dotnet inside wine :D

DianaNites commented 1 year ago

I believe it also needs d3dcompiler_47 to run correctly

smumriak commented 1 year ago

I believe it also needs d3dcompiler_47 to run correctly

It does. Luckily it installs without any issues for years now

Kuuchuu commented 1 year ago

I believe it also needs d3dcompiler_47 to run correctly

This got it working for me and I updated my Python script. Should be fully working now 🤞 Thanks

BG3ModManager-LinuxLauncher

ptkato commented 1 year ago

It might be useful (as to increase reach, and accessibility) to convert that script to a Lutris installer or something of the sort

Spongie26 commented 12 months ago

@FlamenWolf With dotnet472 (using winetricks) installed it should launch. The profile lookup will fail though if you don't start it using BG3's prefix (which I would not recommend).

@LaughingLeader BG3 mod manager already allows to manually set Data and Executeable path, would it be possible to introduce a third setting that controls the lookup of PlayerProfiles and GMCampaigns? It currently defaults to C:\users\[username]\AppData\Local\Larian Studios\Baldur's Gate 3 : #10 (comment)

The same might apply to the Mods folder, which currently defaults to C:\users\[username]\AppData\Local\Larian Studios\Baldur's Gate 3\Mods (this propably inherits the path from the lookup of PlayerProfiles and GMCampaigns).

Yep, it seems all of them are based on:

https://github.com/LaughingLeader/BG3ModManager/blob/f63c49cf7dbe7f9a9581d50f6519a8be9f7dcb35/GUI/ViewModels/MainWindowViewModel.cs#L1261

Can you tell how to set the path to Mods folder correctly? Because that exactly the error BG3MM is giving me and I did everything from #12 as far as I know, but still this problem remains and prevents froms opening the zips.

Wiubiki commented 11 months ago

I believe it also needs d3dcompiler_47 to run correctly

This got it working for me and I updated my Python script. Should be fully working now 🤞 Thanks

BG3ModManager-LinuxLauncher

After countless times trying I managed to get it to work for me. I run the script with the --setup and --cleanflags but before that I had done the following:

After that running the script (with the --setup and --clean flags) works flawlessly. Now I still have the issue of BG3MM point to the wrong folder for the Profiles and Mods folders but one step at a time I guess

Kuuchuu commented 11 months ago

After that running the script (with the --setup and --clean flags) works flawlessly. Now I still have the issue of BG3MM point to the wrong folder for the Profiles and Mods folders but one step at a time I guess

Oof, the wrong folder issue is probably my bad, that's what I get for making that at 5am after an already taxing day. I'll try to work on fixing that up later today when I have time. @Wiubiki is your steam install/BG3 directory in the default install location (inside your home directory)? Making an issue on my repo will also help me remember to check on this later.

Alekisan commented 11 months ago

Where can one find the steps needed to just manually copy and edit the necessary files without a mod manager?

kyledrew commented 11 months ago

I'm having a similar issue but not on linux

I have .net472 installed in a bottle with crossover on a win10 bottle. I've enabled the compiler and i can't get it to load for me.

note: running latest version of crossover with wine 8.0.2

I get this in the from the log file

[MainWindow.xaml.cs:OnUIException(117)] An exception in the UI occurred. The program will close. System.Runtime.InteropServices.COMException (0x88980406): Exception from HRESULT: 0x88980406 at System.Windows.Media.Composition.DUCE.Channel.SyncFlush() at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet) at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam) at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam) at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

HalJordan commented 11 months ago

How are you starting the game? the launch button from bg3mm doesn't work for me, and due to certain mods not working, I'm starting to think that the script extender doesn't work unless started from the mod manager.

Does anyone know what full command is issued by the launch game button?

virnik0 commented 11 months ago

It won't launch at all for me. I have a newer version of dot net installed and when I use wine to run the mod manager nothing happens.

Me neither. Doesn't run with dotNET 4.8, neither it does with mono 8. I also tried dotNet7 runtime. No dice. In general, dotnet is garbage on Linux. Rarely run correctly, installers aren't able to reinstall or uninstall, should some registry record or file is missing. I tried with WINE 8.1 and fresh prefix, so it is not caused by my stack.

virnik0 commented 11 months ago

How are you starting the game? the launch button from bg3mm doesn't work for me, and due to certain mods not working, I'm starting to think that the script extender doesn't work unless started from the mod manager.

Does anyone know what full command is issued by the launch game button?

Directly from Steam. Manager won't be able to run the game on Linux, as it is executed under WINE, while BG3 itself is started by Proton/Steam

virnik0 commented 11 months ago

--setup

Nice, but it doesn't do anything I didn't tried manually. Even then, with clean prefix, it doesn't work.

HalJordan commented 11 months ago

I'm having a similar issue but not on linux

I have .net472 installed in a bottle with crossover on a win10 bottle. I've enabled the compiler and i can't get it to load for me.

note: running latest version of crossover with wine 8.0.2

I get this in the from the log file

[MainWindow.xaml.cs:OnUIException(117)] An exception in the UI occurred. The program will close. System.Runtime.InteropServices.COMException (0x88980406): Exception from HRESULT: 0x88980406 at System.Windows.Media.Composition.DUCE.Channel.SyncFlush() at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet) at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam) at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam) at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Are you running in a pure X11 environment still, or on Wayland? Also, did you tell it to install 472, or did you confirm that it actually installed? I had a hell of a time getting mine to successfully install.

HalJordan commented 11 months ago

How are you starting the game? the launch button from bg3mm doesn't work for me, and due to certain mods not working, I'm starting to think that the script extender doesn't work unless started from the mod manager. Does anyone know what full command is issued by the launch game button?

Directly from Steam. Manager won't be able to run the game on Linux, as it is executed under WINE, while BG3 itself is started by Proton/Steam

Okay, so the mod manager isn't required to start it with the script extender? Great. That means there's something ELSE keeping only certain mods from working.

virnik0 commented 11 months ago

I solved it!

OK, so dotnet installers works differently in interactive and non-interactive mode. What matters is, that full installers recompile assemblies, updates doesn't.

So for me, I tested this with brand new WINE prefix, and then re-tried with my 'broken' WINE prefix.

Now it works.

1) Download dotNET3.5 2) install with /repair switch, repeat again with /q switch 3) Check the processes - there will be DotNet process running, updating assemblies. can take few minutes, wait till it finishes (mscorsvw.exe) 4) Download dotNet4.5 5) install with /q 6) Install will finish, but again - wait for assemblies to rebuild 7) Download dotNet4.7 8) install with /repair switch, repeat again with /q switch 9) Install will finish, but again - wait for assemblies to rebuild 10) Download dotNet4.8

DotNet4.8 should automatically trigger assembly rebuild. If it refuses to reinstall, repeat again with /repair and /q switch.

DotNet verification now works correctly. BG3 Mod Manager starts also correctly.

virnik0 commented 11 months ago

OK, one problem: Those of you who do have DXVK installed, you probably face black screen.

There is a solution, quite easy one. Just create dxvk.conf file in the same directory your BG3ModManager.exe is, and put bellow to it: [BG3ModManager.exe] d3d9.shaderModel = 1

Then save the file, and start BG3ModManager again. It will render correctly, no black windows.

Pednick commented 10 months ago

BG3ModManager doesn't seem to like anything higher than windows 7, I say this because when I run wine configuration under Lutris and change it to windows 7, then BG3ModManager works fine. Just thought I'd post this if it helps anyone else.

virnik0 commented 10 months ago

Runs fine, but getting WINE to accept all required .Net installs in combined WOW64 environment was a challenge. But it works. Still, I don't get why someone develops in .Net today, it is 2023.

Pednick commented 10 months ago

Runs fine, but getting WINE to accept all required .Net installs in combined WOW64 environment was a challenge. But it works. Still, I don't get why someone develops in .Net today, it is 2023.

Yeah they definitely need to catch up.

virnik0 commented 10 months ago

BG3ModManager doesn't seem to like anything higher than windows 7, I say this because when I run wine configuration under Lutris and change it to windows 7, then BG3ModManager works fine. Just thought I'd post this if it helps anyone else.

I have WINE set to Win11 and it works. If you do use Lutris or Bottles, then check the dependencies each prefix type have. That would be the problem. For Windows 10 and 11, you probably wouldn't install .Net 3.5, but with Wine, you have to.

Pednick commented 10 months ago

BG3ModManager doesn't seem to like anything higher than windows 7, I say this because when I run wine configuration under Lutris and change it to windows 7, then BG3ModManager works fine. Just thought I'd post this if it helps anyone else.

I have WINE set to Win11 and it works. If you do use Lutris or Bottles, then check the dependencies each prefix type have. That would be the problem. For Windows 10 and 11, you probably wouldn't install .Net 3.5, but with Wine, you have to.

Ok will check it out thanks.

Edit: Some update must have fixed it, it now works on the win10 winecfg setting.

ptkato commented 10 months ago

Runs fine, but getting WINE to accept all required .Net installs in combined WOW64 environment was a challenge. But it works. Still, I don't get why someone develops in .Net today, it is 2023.

.NET is alive and well, it supports Linux just fine, the problem is when they use platform specific features.

virnik0 commented 10 months ago

yes, there is platform agnostic development of it starting with .Net 5 I think. That still doesnt chage fact that MM uses archaic version of it.

georgedorn commented 10 months ago

extender

How are you starting the game? the launch button from bg3mm doesn't work for me, and due to certain mods not working, I'm starting to think that the script extender doesn't work unless started from the mod manager. Does anyone know what full command is issued by the launch game button?

Directly from Steam. Manager won't be able to run the game on Linux, as it is executed under WINE, while BG3 itself is started by Proton/Steam

Okay, so the mod manager isn't required to start it with the script extender? Great. That means there's something ELSE keeping only certain mods from working.

The notes on the release page for Linux / Proton apply regardless of whether you are running the game from Steam (Proton) or Wine. Running BG3MM under Wine causes BG3 to run under Wine as well when you launch it from BG3MM, which means the required WINEDLLOVERRIDES setting may not be applied and script extender will not start.

It is better to run BG3MM and BG3 within the same environment, whether that's Proton or Wine.

To run it under Proton, you can do something like:

STEAM_COMPAT_CLIENT_INSTALL_PATH="$HOME/.steam/steam" STEAM_COMPAT_DATA_PATH="$HOME/.steam/steam/steamapps/compatdata/1086940" WINEPREFIX="$HOME/.steam/steam/steamapps/compatdata/1086940/pfx" ~/.steam/root/steamapps/common/Proton\ -\ Experimental/proton run <path to BG3ModManager.exe>

You might be using a different proton, so point to the one you're actually using instead of Experimental. Yeah, it's a mess. Put it in a script file.

For Wine you can do the same, but you don't need any of the variables pertaining to proton or steam. Much simpler:

WINEDLLOVERRIDES="DWrite.dll=n,b" WINEPREFIX=<path to your wine prefix for bg3> wine <path to BG3ModManager.exe>

Edit: fixed quotes, I think. Thanks @HalJordan