Thursday, March 18, 2021

Case study: Diablo II on Raspberry Pi with mod and network support

[Updated May 06, 2021: Working with Box86 and Wine-x86]

Hello,

Are you a geek? Are you born in the 70's, 80's or maybe 90's? Do you like brutish hack'n'slash? Do you like buying a new mouse every 2 months? If this is the case, there is a major chance that you have played Diablo II back in your young days.
And also that you still remember and like that game.

Guess what? Diablo II has been ported to arm. This guy made it.  

If you want to save yourself the trouble, the best way to install Diablo II on wine-arm is to install and use PiKISS.

If you ever want to do the manual route, this excellent guide on reddit will make you able to run it. Note that the link to mesa libraries is in a embedded video which can be annoying while you can just use PiKISS to install them.

So is there more to know?

Wine-arm

This can be a pitfall if you are a Box86 user: Diablo II will run with arm version of Wine, as in the one you will install with:
 
sudo apt-get install wine

If you plan to use Wine-arm and Wine-x86 on the same system, be careful not to destroy your wineprefixes by running with the wrong Wine.

Performance

Gaming performance is awesome. However loading delays can be quite long especially if you are playing with a mod. Don't lose patience if you start a new game or change act.
 
Avoid freezes by keeping a decent voltage supply. This can make you die and will make you lose your character in hardcore mode. 

Recommended purchase

You might want to buy more than one... Get a wireless mouse if you don't already have one: 
US
UK 
Italy 
Spain 

Playing mods

libd2game_sa_arm.exe.so doesn't give a launcher like D2SE.EXE. 
However, you can start the mod if you unpack the whole file in the main directory and start the game typing:
 
LD_LIBRARY_PATH=/home/pi/mesa/lib/arm-linux-gnueabihf LIBGL_DRIVERS_PATH=/home/pi/mesa/lib/arm-linux-gnueabihf/dri/ GBM_DRIVERS_PATH=/home/pi/mesa/lib setarch linux32 -L wine libd2game_sa_arm.exe.so -direct -txt
 
You can also download my helper script and run it from Diablo II directory. 

This has proven to be working with Diablo II Content Update and works in local network multiplayer games as well!  
 

Network play 

 
In order to play multiplayer games you will need both versions to be compatible:
  • If you play stock Diablo II, just run libd2game_sa_arm.exe.so from Pi with the same Diablo II directory content (D2Patch.mpq ...) as on the other computer. You can run Diablo II.exe from the x86 computers.
  • If you play mod, Raspberry will use -direct -txt while x86 computers will use D2SE.exe
  • Anyone can host the game (Raspberry Pi or x86). Be sure to decrease voltage issue risk because it will make you freeze and you might die in hardcore.
Will your love like Diablo II and play it with you in network multiplayer games? Well mine did!
 
 
diablo 2 raspberry pi mod content update
Diablo II content update on Raspberry Pi
with cold plains demon (dead).


 

x86 and Box86

As an update on May 6, 2021, Diablo II works with Wine-x86 and Box86 and provides a good performance. The guide hereafter assumes you have D2SE available on your system.

There are a lot of goodies on this method:
  • You can now play with a clean Diablo II directory and a mod selector like D2SE.exe.
  • You can play Diablo II easier from RetroPie like it was a classic Wine/Box86 launcher app
  • You can also play Diablo II from RetroArch with bash script core and a startx/xserver configuration
There are two downsides, the first being that the network play is slower (but it still works) and the second is that the configuration is a bit tricky.

Configuration
You will first have to fool D2VidTst by editing your registry

    WINEPREFIX=/path/to/X86/wineprefix /home/pi/path/to/X86/wine regedit

Set all the keys hereafter
diablo 2 regedit raspberry pi box86
You will have to set all these manually but you will only have to do it once.


Once all those keys are set in your registry, start D2VidTst.exe
 
    LD_LIBRARY_PATH=/home/pi/path/to/gl4es/lib/WINEPREFIX=/path/to/X86/wineprefix /home/pi/path/to/X86/wine /path/to/D2VidTst.exe

Fool D2VidTst.exe by skipping the test.

Run D2SE.exe

    LD_LIBRARY_PATH=/home/pi/path/to/gl4es/lib/WINEPREFIX=/path/to/X86/wineprefix /home/pi/path/to/X86/wine /path/to/D2SE.exe

At the first time you started D2SE.exe, untick window mode and click "Configure Glide".
On the Configure Glide screen set the options:
  • Settings
    • window mode: unticked
    • captured mouse: ticked
    • keep aspect ratio: ticked (although you might want to untick it to stretch to screen)
    • vertical synchronization (VSYNC): ticked
    • fps limit: no
    • static size: no
    • window extras: unticked
    • refresh rate: auto
    • desktop resolution: ticked
  • Renderer
    • texture memory: 16MB
    • buffer-texture-size: 1024x1024
    • 32-bit rendering: ticked
    • texture for videos: ticked
    • bilinear filtering: unticked
    • shader-gamma: ticked
    • no gamma: unticked
    • keep desktop composition: unticked
  • Wrapper-statistics
    • corner for infos: upper left
    • framerate: unticked
    • clock: no
    • texturemass: unticked
  • Extensions
    • tick everything except WGL_ARB_render_texture
  • Do a test to make sure it works then quit
You can then start Diablo II by clicking "Start Plugin" (avoid clicking "Start D2").
Before Diablo II launches make sure to minimize your console window because this method will not bring Diablo II as front task. If you are having trouble with this point you can always configure Diablo II as windowed application.

Conclusion

The arm version of Diablo II is awesome! It works better than some plain linux x86 Wine installations. You can play mods and in local network. 
A recent update made Diablo II playable in Box86. Raspberry Pi users now have the choice, both solutions having their own pros and cons. I personally stick with Wine-arm version because I play in network. However the Box86 version is more than playable and looks much more like the original.

The pi gamer

No comments:

Post a Comment

Making XWindow, Wine and Box86 work under RetroArch [Raspberry Pi OS 32 bits lite + RetroArch as an app]

Very similar to my other article (" Making Wine and Box86 work under RetroPie [RetroPie as an OS] "), it will nevertheless show mu...