====== Information ======
* Battle.net App ((http://us.battle.net/en/app))
* Diablo III ((https://us.diablo3.blizzard.com/en-us/))
* 32-bit
===== Prerequisites =====
* [[distros:fedora_workstation_gnome|Fedora Workstation]]
* [[notes:wine|Wine]]
===== Notes =====
* 32-bit is D3D9 and better for Gallium Nine
* See [[games;linux;wine;diablo_3_x64|Diablo III 64-bit]] notes for D3D11 and DXVK
* 2023/09/15: 32-bit + Gallium Nine performs better than 64-bit + DXVK with Intel UHD 630 graphics
====== Install ======
===== Battle.net App =====
* Install to default directory when prompted ((C:/Program Files/Battle.net))
* Log-in
* Change Battle.net App settings ((don't auto-start, exit on game launch))
* Close
mkdir -p ~/'.wine' && wget 'https://us.battle.net/download/getInstaller?os=win&installer=Battle.net-Setup.exe&id=undefined' -O ~/'Downloads/Battle.net-Setup.exe' && WINEPREFIX=~/'.wine/Diablo III' WINEARCH='win32' wine ~/'Downloads/Battle.net-Setup.exe'
===== Restore Data =====
****
mv ~/'Downloads/Diablo III' ~/'.wine/Diablo III/drive_c/Program Files' && sync
===== Diablo III =====
* Install or Locate Game -> Diablo III
cd ~/'.wine/Diablo III/drive_c/Program Files/Battle.net' && WINEPREFIX=~/'.wine/Diablo III' wine ~/'.wine/Diablo III/drive_c/Program Files/Battle.net/Battle.net Launcher.exe'
===== Clean Up =====
****
rm -f ~/'Downloads/Battle.net-Setup.exe' ~/'Desktop/Battle.net.desktop' ~/'Desktop/Diablo III.desktop' && cd ~ && sync
====== Libraries ======
===== DXVK =====
* https://github.com/doitsujin/dxvk/actions ((need to be signed into GitHub, and select the latest ''master'' artifacts package))
ls ~/'Downloads/dxvk-master-'*'.zip' && rm -Rf '/tmp/dxvk-master' && mkdir -p '/tmp/dxvk-master' && unzip ~/'Downloads/dxvk-master-'*'.zip' -d '/tmp/dxvk-master/' && cp --backup '/tmp/dxvk-master/x32/'*'.dll' ~/'.wine/Diablo III/drive_c/windows/system32/' && WINEPREFIX=~/'.wine/Diablo III' winetricks 'd3d9=native' 'd3d10core=native' 'd3d11=native' 'dxgi=native' && mkdir -p ~/'.wine/Diablo III/dxvk_shader_cache' && sync
===== Gallium Nine Standalone =====
* https://github.com/iXit/wine-nine-standalone/releases
ls ~/'Downloads/gallium-nine-standalone-'*'.tar.gz' && rm -rf '/tmp/gallium-nine-standalone' && cd '/tmp' && tar -xvzf ~/'Downloads/gallium-nine-standalone-'*'.tar.gz' && cd ~ && cp --force '/tmp/gallium-nine-standalone/lib32/d3d9-nine.dll.so' ~/'.wine/Diablo III/drive_c/windows/system32/d3d9.dll' && rm -rf '/tmp/gallium-nine-standalone' ~/'Downloads/gallium-nine-standalone-'*'.tar.gz' && sync
==== Uninstall ====
****
rm -f ~/'.wine/Diablo III/drive_c/windows/system32/d3d9.dll' && WINEPREFIX=~/'.wine/Diablo III' wineboot --update
====== Desktop Launcher ======
===== Initial =====
****
rm -Rf ~/'.local/share/applications/wine/Programs/Battle.net' ~/'.local/share/applications/wine/Programs/Diablo III' && mkdir -p ~/'.local/share/applications/wine/Programs/Diablo III'
===== Diablo III (Battle.net App) =====
nano ~/'.local/share/applications/wine/Programs/Diablo III/Diablo III.desktop'
[Desktop Entry]
Name=Diablo III
Categories=Game;AdventureGame;RolePlaying
Exec='/bin/bash' -c "cd ~/'.wine/Diablo III/drive_c/Program Files/Diablo III' && PULSE_LATENCY_MSEC='400' MESA_SHADER_CACHE_DIR=~/'.wine/Diablo III' DXVK_STATE_CACHE_PATH=~/'.wine/Diablo III/dxvk_shader_cache' WINEPREFIX=~/'.wine/Diablo III' wine ~/'.wine/Diablo III/drive_c/Program Files/Diablo III/Diablo III Launcher.exe'"
Type=Application
StartupNotify=true
Icon=B9E6_Diablo III Launcher.0
StartupWMClass=diablo iii.exe
Actions=Cache;Kill;Notes;
[Desktop Action Cache]
Exec='/bin/bash' -c "rm -Rf ~/'.wine/Diablo III/mesa_shader_cache/'* ~/'.wine/Diablo III/dxvk_shader_cache/'* && sync && notify-send 'The Diablo III cache has been cleaned.'"
Name=Cache Cleanup
[Desktop Action Kill]
Exec='/bin/bash' -c "WINEPREFIX=~/'.wine/Diablo III' wineserver --kill"
Name=Force-close
[Desktop Action Notes]
StartupNotify=false
Exec='/bin/bash' -c "gio open 'https://wiki.realmofespionage.xyz/games:wine:diablo_3'"
Name=Installation Notes
# End
====== Quick Commands ======
===== Winecfg =====
****
WINEPREFIX=~/'.wine/Diablo III' winecfg
===== Winetricks =====
****
WINEPREFIX=~/'.wine/Diablo III' winetricks
===== Registry Editor =====
****
WINEPREFIX=~/'.wine/Diablo III' regedit
===== Kill =====
****
WINEPREFIX=~/'.wine/Diablo III' wineserver --kill
===== Execute =====
==== Battle.net App ====
* ''Battle.net Launcher.exe''
cd ~/'.wine/Diablo III/drive_c/Program Files/Battle.net' && PULSE_LATENCY_MSEC='400' MESA_SHADER_CACHE_DIR=~/'.wine/Diablo III' DXVK_STATE_CACHE_PATH=~/'.wine/Diablo III/dxvk_shader_cache' WINEPREFIX=~/'.wine/Diablo III' WINEDEBUG='' wine ~/'.wine/Diablo III/drive_c/Program Files/Battle.net/Battle.net Launcher.exe'
==== Diablo III (Battle.net App) ====
* ''Diablo III Launcher.exe''
cd ~/'.wine/Diablo III/drive_c/Program Files/Diablo III' && PULSE_LATENCY_MSEC='400' MESA_SHADER_CACHE_DIR=~/'.wine/Diablo III' DXVK_STATE_CACHE_PATH=~/'.wine/Diablo III/dxvk_shader_cache' WINEPREFIX=~/'.wine/Diablo III' WINEDEBUG='' wine ~/'.wine/Diablo III/drive_c/Program Files/Diablo III/Diablo III Launcher.exe'
==== Diablo III ====
* Useful for quick graphical testing as this bypasses Battle.net launcher and boots D3 directly
* ''Diablo III.exe''
cd ~/'.wine/Diablo III/drive_c/Program Files/Diablo III' && PULSE_LATENCY_MSEC='400' MESA_SHADER_CACHE_DIR=~/'.wine/Diablo III' DXVK_STATE_CACHE_PATH=~/'.wine/Diablo III/dxvk_shader_cache' WINEPREFIX=~/'.wine/Diablo III' WINEDEBUG='' wine ~/'.wine/Diablo III/drive_c/Program Files/Diablo III/Diablo III.exe' -launch
===== File Manager =====
==== Root ====
****
gio open ~/'.wine/Diablo III/drive_c/Program Files/Diablo III'