Difference between revisions of "Linux"

From Path of Diablo Wiki
Jump to: navigation, search
(Requirements)
(How to install and run PoD with lutris on linux)
Line 122: Line 122:
 
== Requirements ==
 
== Requirements ==
  
* Diablo II: Lord of Destruction [https://lutris.net/games/diablo-ii-lord-of-destruction/] must be installed first using lutris and in the default lutris game folder (<code>diablo-ii-lord-of-destruction</code>)
+
* Diablo II: Lord of Destruction [https://lutris.net/games/diablo-ii-lord-of-destruction/] must be installed first
  
 
* Install ''lib32-gnutls'' package from your distro repositories to allow the Launcher to update.
 
* Install ''lib32-gnutls'' package from your distro repositories to allow the Launcher to update.
Line 130: Line 130:
 
== Lutris installer technical notes ==
 
== Lutris installer technical notes ==
  
This will install Path of Diablo on top of Diablo II: Lord of Destruction. It requires the original game to be already installed by lutris but it will install in a new prefix and it will NOT touch original game files - PoD will live in its own folder.
+
This will install Path of Diablo on top of Diablo II: Lord of Destruction. It requires the original game to be already installed but it will install in a new prefix and it will NOT touch original game files - PoD will live in its own folder but it will read game files (*.mpq, Game.exe, D2.LNG) from your Diablo II: LoD installation.
  
* 1. Diablo II: Lord of Destruction installation must be present. Symbolic links that point to original game files will be created inside a new wine prefix created for Path of Diablo.
+
* 1. Diablo II: Lord of Destruction installation must be present and you will be asked to select the folder which contains the installed game files. Relative path symbolic links that point to original game files will be created inside a new wine prefix created for Path of Diablo.
 
* 2. Path of Diablo installer will require you to manually select path of the original game, just point it to "C:\Program Files\Diablo II" (it will look like an empty folder, that's ok).
 
* 2. Path of Diablo installer will require you to manually select path of the original game, just point it to "C:\Program Files\Diablo II" (it will look like an empty folder, that's ok).
* 3. When installation completes, launcher will download additional files and update the modded game to latest version
+
* 3. When installation completes, installer will offer to start the launcher. Uncheck that, do not start yet, and just click "Finish" to complete the installation script.
 +
 
 +
When you first start the game from lutris, PoD launcher will download its game files. When it completes, select either -3dfx or -ddraw option and click "Launch" to start the game.
  
 
Installer is automating installation steps described here: https://pathofdiablo.com/wiki/index.php?title=Linux
 
Installer is automating installation steps described here: https://pathofdiablo.com/wiki/index.php?title=Linux
Note: PoD ships with a custom glide3x.dll (upstream source: https://www.svenswrapper.de/english/whatis.html) and with a specific version cnc-ddraw's ddraw.dll (upstream source: https://github.com/FunkyFr3sh/cnc-ddraw) and the modded game has been tailored to work with those. The modded game is NOT compatible with lutris direct3d or dgvoodo2 and attempting to remove ddraw.dll override and use system's ddraw.dll will result in game crashes.
+
Note: PoD ships with a custom glide3x.dll (upstream source: https://www.svenswrapper.de/english/whatis.html) and with a specific version of cnc-ddraw (upstream source: https://github.com/FunkyFr3sh/cnc-ddraw). The modded game has been tailored to work with those. The modded game is NOT compatible with lutris direct3d or dgvoodo2 and attempting to remove ddraw.dll override and use system's ddraw.dll will result in game crashes.
  
 
== Installation ==
 
== Installation ==
  
Open your console and run the command: <code>exo-open lutris:path-of-diablo?revision=92793</code>. Lutris should then automatically start, fetch the installer from lutris server and run the installer.
+
Open your console and run the command: <code>exo-open lutris:path-of-diablo-online-installer</code>. Lutris should then automatically start, fetch the installer from lutris server and run the installer.
  
Alternatively, manually download the lutris script from [https://lutris.net/api/installers/games/path-of-diablo/revisions/92793] and open it using lutris GUI.
+
Alternatively, manually download the lutris script from [https://lutris.net/api/installers/path-of-diablo-online-installer] and open it using lutris GUI.
  
 
For information, the installer yaml script is replicated below:
 
For information, the installer yaml script is replicated below:
  
  files:
+
    files:
  - podinstaller: https://pathofdiablo.com/pathofdiablolauncher.msi
+
    - podinstaller: https://pathofdiablo.com/pathofdiablolauncher.msi
  game:
+
    game:
    arch: win32
 
    exe: $GAMEDIR/$podpath/Path of Diablo/Path of Diablo Launcher.exe
 
    prefix: $GAMEDIR
 
  installer:
 
  - merge:
 
      dst: $CACHE/podinstaller
 
      src: podinstaller
 
  - execute:
 
      command: echo "[INFO] Verifying pathofdiablolauncher.msi sha256 checksum...";
 
        afunc() { [ $(sha256sum "$podinstaller" | cut -c 1-64) = $podinstaller_sha256
 
        ]; }; afunc;
 
  - execute:
 
      command: echo "[INFO] pathofdiablolauncher.msi checksum OK"
 
  - execute:
 
      command: mkdir -p "$GAMEDIR/$podpath"
 
  - execute:
 
      command: 'echo "[INFO] Looking for Diablo II: Lord of Destruction installation
 
        in "$(cd "$GAMEDIR/.." && pwd)/diablo-ii-lord-of-destruction ...'
 
  - execute:
 
      command: echo "[INFO] Found $GAMEDIR/$d2path, proceeding with Path of Diablo installation..."
 
  - execute:
 
      command: if [ -d "$GAMEDIR/$d2path32" ]; then d2path="$d2path32"; fi; if [ -d
 
        "$GAMEDIR/$d2path64" ]; then d2path="$d2path64"; fi; if [ -z "$d2path" ]; then
 
        false; else ln -sr -t "$GAMEDIR/$podpath/" "$GAMEDIR/$d2path"/{*.mpq,Game.exe,D2.LNG};
 
        fi;
 
  - task:
 
      arch: win32
 
      install_gecko: false
 
      install_mono: false
 
      name: create_prefix
 
      prefix: $GAMEDIR
 
  - task:
 
      app: dotnet40
 
      name: winetricks
 
      silent: true
 
  - task:
 
 
       arch: win32
 
       arch: win32
       executable: podinstaller
+
       exe: $GAMEDIR/$podpath/Path of Diablo/Path of Diablo Launcher.exe
      name: wineexec
 
 
       prefix: $GAMEDIR
 
       prefix: $GAMEDIR
  - task:
+
    installer:
      key: capturedmouse
+
    - write_file:
      name: set_regedit
+
        content: '#!/bin/bash
      path: HKEY_CURRENT_USER\Software\GLIDE3toOpenGL
+
   
      type: REG_DWORD
+
          file="$1"; hash="$2"; echo "[INFO] Verifying $(basename "$file") sha256 checksum...";
      value: '00000001'
+
          if [ $(sha256sum "$file" | cut -c 1-64) = "$hash" ]; then echo "[INFO] ...checksum
  - task:
+
          OK!"; else echo "[ERROR] ...checksum FAILED!"; exit 1; fi
      key: desktopresolution
+
   
      name: set_regedit
+
          '
      path: HKEY_CURRENT_USER\Software\GLIDE3toOpenGL
+
        file: $CACHE/checkhash.sh
      type: REG_DWORD
+
    - execute:
      value: '00000001'
+
        args: +x $CACHE/checkhash.sh
  - task:
+
        file: chmod
      key: english
+
    - execute:
      name: set_regedit
+
        args: podinstaller $podinstaller_sha256
      path: HKEY_CURRENT_USER\Software\GLIDE3toOpenGL
+
        file: $CACHE/checkhash.sh
      type: REG_DWORD
+
    - execute:
      value: '00000001'
+
        command: mkdir -p "$GAMEDIR/$podpath"
  variables:
+
    - insert-disc:
    d2path32: ../diablo-ii-lord-of-destruction/drive_c/Program Files/Diablo II
+
        message: 'Please select a folder where you have Diablo II: Lord of Distruction
    d2path64: ../diablo-ii-lord-of-destruction/drive_c/Program Files (x86)/Diablo II
+
          installed (e.g. "~Games/diablo-ii-lord-of-destruction/drive_c/Program Files
    podinstaller_sha256: 5ae13a26dea0507c8aff7da53992e86bd76956f8983d0bc71198d9eb98ea475a
+
          (x86)/Diablo II/"). The installer script will then make symbolic links to game
    podpath: drive_c/Program Files/Diablo II
+
          files there, using relative paths, so that they may be read by Path of Diablo.'
  wine:
+
        requires: d2exp.mpq
    overrides:
+
    - execute:
      ddraw.dll: n
+
        command: ln -sr -t "$GAMEDIR/$podpath/" "$DISC"/{*.mpq,Game.exe,D2.LNG};
 +
    - task:
 +
        arch: win32
 +
        install_gecko: false
 +
        install_mono: false
 +
        name: create_prefix
 +
        prefix: $GAMEDIR
 +
    - task:
 +
        app: dotnet40
 +
        name: winetricks
 +
        silent: true
 +
    - task:
 +
        arch: win32
 +
        executable: podinstaller
 +
        name: wineexec
 +
        prefix: $GAMEDIR
 +
    - task:
 +
        key: capturedmouse
 +
        name: set_regedit
 +
        path: HKEY_CURRENT_USER\Software\GLIDE3toOpenGL
 +
        type: REG_DWORD
 +
        value: '00000001'
 +
    - task:
 +
        key: desktopresolution
 +
        name: set_regedit
 +
        path: HKEY_CURRENT_USER\Software\GLIDE3toOpenGL
 +
        type: REG_DWORD
 +
        value: '00000001'
 +
    - task:
 +
        key: english
 +
        name: set_regedit
 +
        path: HKEY_CURRENT_USER\Software\GLIDE3toOpenGL
 +
        type: REG_DWORD
 +
        value: '00000001'
 +
    variables:
 +
      podinstaller_sha256: 5ae13a26dea0507c8aff7da53992e86bd76956f8983d0bc71198d9eb98ea475a
 +
      podpath: drive_c/Program Files/Diablo II
 +
    wine:
 +
      overrides:
 +
        ddraw.dll: n

Revision as of 21:48, 22 October 2022

How to run PoD under linux

Requirements

"Path of Diablo" mod works perfectly under Wine (just as vanilla D2:LoD does), but its launcher requires some additional configuration.
All you'll need is a 32-bit Wine prefix with dotnet 4.0 on it, and the lib32-gnutls library

  • Install lib32-gnutls package from your distro repositories to allow the Launcher from updating.


Preparing prefix

Make sure you're using Xorg, not Wayland - there were issues with the latter.

  • Install Wine and winetricks packages from your distro repositories:
Archlinux: pacman -S wine winetricks
Debian: sudo apt install wine winetricks
  • Create new win32 prefix with winecfg:

WINEPREFIX="$HOME/prefix32" WINEARCH=win32 winecfg

Throughfully work out all wine errors it throws at you at this point

For example, ntlm_auth was not found error means you should install Samba package (in Archlinux, it may vary for other distos)


If the winecfg window pops up, that means it's already configured the "prefix32" prefix folder in your user home directory as a x86 (32-bit) Windows.
Ensure you have Windows 7 or higher selected in the drop-down window, as the Path of Diablo installer won't run on Windows XP, and close the window.

  • Install dotnet4.0 with winetricks there:

WINEPREFIX="$HOME/prefix32" WINEARCH=win32 winetricks

Select "Choose default wine prefix" on the first screen

Select "install DLL or Windows components" on the second screen, choose "dotnet40" option and press OK

Installing the game

To run windows app with wine - always change directory (cd) to those containing exe-file!
  • Fire up terminal, cd to directory with exe, run
WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine Downloader_Diablo2_enUS.exe
  • same again but for expansion, run
WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine Downloader_Diablo2_Lord_of_Destruction_enUS.exe
  • go to directory where you downloaded the classic game from the first downloader, run
WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine Installer.exe
  • go to directory where you downloaded the expansion game from the second downloader, run
WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine installer.exe
  • Install PoD launcher. As .msi files aren't executables, MAKE SURE TO USE "wine start"
WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine start pathofdiablolauncher.msi

Running Path of Diablo

  • In terminal, enter Diablo II directory and then enter Path of Diablo directory which should be inside the Diablo II directory. If this isn't the case you must reinstall pod or you will get an error like "Some or more files are missing from your parent D2 installation". Inside Path of Diablo directory, run PoD launcher
WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine Path\ of\ Diablo\ Launcher.exe
  • The launcher may download some updates and restart itself. You can download updates from whichever download server when prompted.
  • Press "Play" to start playing POD mod!

Configuring Glide API wrapper

  • Install lib32-libxinerama and lib32-libxcomposite packages from your distro repositories to allow the game to be played with Glide mode.

D2 in Glide mode works better and looks fancier. So, go inside Path of Diablo (not vanilla!) directory, run

WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine D2VidTst.exe

and select Glide. Next, run Glide configuration app

WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine glide-init.exe

0. Press "test" - and do that after any settings change, to verify nothing is broken!

1. Press "English/Deutsch" button to switch language

2. Press "Query..." on OpenGL-infos tab and wait until you get you graphics subsystem capabilities

3. Check all boxes at Extensions tab (WGL_ARB_render_texture" should appear after OpenGL query)

4. On settings tab, uncheck vsync and select fps-limit 100 - game can go up to THOUSAND on modern systems! Remaining boxes on that tab is up to you.

5. On renderer tab, select maximum values for texture-memory and buffer-texture-size, 32-bit rendering, texture for videos, bilinear filtering, SUPERSAMPLING, and I personally keep shader-gamma/no gamma unchecked. You can also check keep desktop resolution - but it hits performance hard on old weak laptops (together with supersampling)

6. On wrapper-statistics tab, check "framerate" and select corner to show your game FPS

7. Press test for a last time, then Quit.

  • Check -3dfx box in PoD launcher!

Loot Filter and QoL settings

If you find your game crashing when interacting with the Settings button and its content, check this Reddit thread at: https://www.reddit.com/r/pathofdiablo/comments/6h2hju/linux_getting_qol_to_work/


Running the game itself (vanilla D2)

  • In terminal, enter Diablo II directory and run
WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine D2VidTst.exe

Select any graphics API you want. Run the game

WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine Diablo\ II.exe

Game SHOULD work. If wine throws errors - in most cases you missing some packages. Google those errors, find the packages you need and install them. article on Archwiki can be helpful too.

How to install and run PoD with lutris on linux

Requirements

  • Diablo II: Lord of Destruction [1] must be installed first
  • Install lib32-gnutls package from your distro repositories to allow the Launcher to update.
  • Install lib32-gstreamer package from your distro repositories to enable use of 3dfx OpenGL wrapper.

Lutris installer technical notes

This will install Path of Diablo on top of Diablo II: Lord of Destruction. It requires the original game to be already installed but it will install in a new prefix and it will NOT touch original game files - PoD will live in its own folder but it will read game files (*.mpq, Game.exe, D2.LNG) from your Diablo II: LoD installation.

  • 1. Diablo II: Lord of Destruction installation must be present and you will be asked to select the folder which contains the installed game files. Relative path symbolic links that point to original game files will be created inside a new wine prefix created for Path of Diablo.
  • 2. Path of Diablo installer will require you to manually select path of the original game, just point it to "C:\Program Files\Diablo II" (it will look like an empty folder, that's ok).
  • 3. When installation completes, installer will offer to start the launcher. Uncheck that, do not start yet, and just click "Finish" to complete the installation script.

When you first start the game from lutris, PoD launcher will download its game files. When it completes, select either -3dfx or -ddraw option and click "Launch" to start the game.

Installer is automating installation steps described here: https://pathofdiablo.com/wiki/index.php?title=Linux Note: PoD ships with a custom glide3x.dll (upstream source: https://www.svenswrapper.de/english/whatis.html) and with a specific version of cnc-ddraw (upstream source: https://github.com/FunkyFr3sh/cnc-ddraw). The modded game has been tailored to work with those. The modded game is NOT compatible with lutris direct3d or dgvoodo2 and attempting to remove ddraw.dll override and use system's ddraw.dll will result in game crashes.

Installation

Open your console and run the command: exo-open lutris:path-of-diablo-online-installer. Lutris should then automatically start, fetch the installer from lutris server and run the installer.

Alternatively, manually download the lutris script from [2] and open it using lutris GUI.

For information, the installer yaml script is replicated below:

   files:
   - podinstaller: https://pathofdiablo.com/pathofdiablolauncher.msi
   game:
     arch: win32
     exe: $GAMEDIR/$podpath/Path of Diablo/Path of Diablo Launcher.exe
     prefix: $GAMEDIR
   installer:
   - write_file:
       content: '#!/bin/bash
   
         file="$1"; hash="$2"; echo "[INFO] Verifying $(basename "$file") sha256 checksum...";
         if [ $(sha256sum "$file" | cut -c 1-64) = "$hash" ]; then echo "[INFO] ...checksum
         OK!"; else echo "[ERROR] ...checksum FAILED!"; exit 1; fi
   
         '
       file: $CACHE/checkhash.sh
   - execute:
       args: +x $CACHE/checkhash.sh
       file: chmod
   - execute:
       args: podinstaller $podinstaller_sha256
       file: $CACHE/checkhash.sh
   - execute:
       command: mkdir -p "$GAMEDIR/$podpath"
   - insert-disc:
       message: 'Please select a folder where you have Diablo II: Lord of Distruction
         installed (e.g. "~Games/diablo-ii-lord-of-destruction/drive_c/Program Files
         (x86)/Diablo II/"). The installer script will then make symbolic links to game
         files there, using relative paths, so that they may be read by Path of Diablo.'
       requires: d2exp.mpq
   - execute:
       command: ln -sr -t "$GAMEDIR/$podpath/" "$DISC"/{*.mpq,Game.exe,D2.LNG};
   - task:
       arch: win32
       install_gecko: false
       install_mono: false
       name: create_prefix
       prefix: $GAMEDIR
   - task:
       app: dotnet40
       name: winetricks
       silent: true
   - task:
       arch: win32
       executable: podinstaller
       name: wineexec
       prefix: $GAMEDIR
   - task:
       key: capturedmouse
       name: set_regedit
       path: HKEY_CURRENT_USER\Software\GLIDE3toOpenGL
       type: REG_DWORD
       value: '00000001'
   - task:
       key: desktopresolution
       name: set_regedit
       path: HKEY_CURRENT_USER\Software\GLIDE3toOpenGL
       type: REG_DWORD
       value: '00000001'
   - task:
       key: english
       name: set_regedit
       path: HKEY_CURRENT_USER\Software\GLIDE3toOpenGL
       type: REG_DWORD
       value: '00000001'
   variables:
     podinstaller_sha256: 5ae13a26dea0507c8aff7da53992e86bd76956f8983d0bc71198d9eb98ea475a
     podpath: drive_c/Program Files/Diablo II
   wine:
     overrides:
       ddraw.dll: n