Chaosforge Forum

  • March 28, 2024, 01:34
  • Welcome, Guest
Please login or register.



Login with username, password and session length
Pages: [1]

Author Topic: Howto Play DiabloRL with sounds on Linux  (Read 8120 times)

Grolm

  • Private
  • *
  • Offline Offline
  • Posts: 3
  • Lost Soul
    • View Profile
Howto Play DiabloRL with sounds on Linux
« on: July 06, 2013, 05:39 »

Hi,

As said in this topic : http://forum.chaosforge.org/index.php/topic,6528.0.html

I made a script to install DiabloRL from sources on Linux, with some small patches to support sounds from DIABDAT.MPQ.

Tested with rev 770 of fpcvalkyrie and 1178 of diablorl on xubuntu 13.04 64 bits.

Code: [Select]
#!/bin/bash

# diablorl (http://diablo.chaosforge.org/) linux setup from sources with
# DIABDAT.MPQ sound support
#
# http://forum.chaosforge.org/index.php/topic,6528
# tested with ubuntu 13.04 64bits

# Please install the following packages before
#
# build-essential fpc libsdl1.2-dev libsdl1.2-dbg lua 5.1 liblua5.1-0-dev
# subversion p7zip-full wget sed
#
# ubuntu:
# sudo apt-get install -y build-essential fpc libsdl1.2-dev libsdl1.2-dbg lua 5.1 liblua5.1-0-dev subversion p7zip-full wget sed

DRL_DIR=$1
MPQ_PATH=$2

if [ $# -ne 2 ]; then
    echo $0 DRL_INSTALL_DIR PATH_TO_DIABDAT.MPQ
    exit 1
fi

if [ ! -f "${MPQ_PATH}" ]; then
    echo "MPQ not found : $2"
    exit 2
fi

cd $(dirname "${MPQ_PATH}")
MPQ_PATH="$PWD/$(basename "${MPQ_PATH}")"
cd - &>/dev/null

mkdir -p "${DRL_DIR}" || exit 3
cd "${DRL_DIR}" || exit 4
DRL_DIR="$PWD"

# downloads (tested with rev 770 of fpcvalkyrie and 1178 of diablorl)
svn checkout -r 770 http://svn.code.sf.net/p/fpcvalkyrie/code/trunk fpcvalkyrie
svn checkout -r 1178 http://svn.code.sf.net/p/diablorl/code/trunk diablorl
wget http://www.zezula.net/download/stormlib.zip
7z x stormlib.zip

# Build StormLib
cd "${DRL_DIR}"/StormLib
make -f Makefile.linux
cp libStorm.so "${DRL_DIR}"/diablorl/bin/lib
cd "${DRL_DIR}"/diablorl/bin/lib
ln -s libStorm.so StormLib.so


# patch fpcvalkyrie
cd "${DRL_DIR}"/fpcvalkyrie/src
sed -i~  -e 's/\(^[[:space:]]*\)\(FPrev.FNext := FNext;\)/\1if FPrev <> nil then \2/' \
         -e 's/\(^[[:space:]]*\)\(FNext.FPrev := FPrev;\)/\1if FNext <> nil then \2/' vnode.pas

# patch diablorl
cd "${DRL_DIR}"/diablorl/src
sed -i~ -e 's/\(raise EStreamError.CreateFmt.*;\)/{\1}/' rlui.pas

# compile
cd "${DRL_DIR}"/diablorl/src
FPCDIR=/usr/lib/fpc/2.6.0/ fpcmake
make COMPILER_UNITDIR=../../fpcvalkyrie/libs/ FPCOPT="-k-lm" DEBUG=1


# config and run
cd "${DRL_DIR}"/diablorl/bin
./mpq
cp -vf "${MPQ_PATH}" DIABDAT.MPQ
sed -i~ -e 's/sound     = "NONE"/sound     = "SDL"/' \
        -e 's/mpq       = ""/mpq       = "DIABDAT.MPQ"/' config.lua

# create a runner script
cat <<EOF > /tmp/diablorl
#!/bin/sh
cd "${DRL_DIR}/diablorl/bin"
export LD_LIBRARY_PATH="${DRL_DIR}/diablorl/bin/lib"
./rl
EOF
sudo mv /tmp/diablorl /usr/local/bin/diablorl
sudo chmod 755 /usr/local/bin/diablorl

echo Run and Have Fun with: /usr/local/bin/diablorl


Paste this code into diablorl-setup.sh with your favorite text editor and run

bash diablorl-setup.sh your_install_path your_path_to_DIABDAT.MPQ



« Last Edit: July 06, 2013, 05:41 by Grolm »
Logged

Porygon

  • Private FC
  • *
  • Offline Offline
  • Posts: 5
  • Lost Soul
    • View Profile
Re: Howto Play DiabloRL with sounds on Linux
« Reply #1 on: August 18, 2014, 05:43 »

Hi,

Thank you Grolm for the script, I ran it but it didn't work. I tried to figure out why and I found that the link for the StormLib was broken. After some researches and tests I finally managed to find a version of StormLib which works with diabloRL. So I made some modifications to your original script in order to fix the problem. Now it uses the last revision (1194) of the game too. Here is the changelog :

Code: [Select]
[fix] bottom line has enough length with any display resolution
[fix] QuickSkill window size and position
[add] filled in the rest of monster data.
TODO: AI, difficulty levels.
[fix] Guardian quest and spell fixed
[fix] minor PWS quest bug
[fix] double casting time for scrolls
[fix] neither scroll not time is consumed when the spell casted from scroll failed/cancelled
[fix] Horned Demon permacharge fixed
[fix] unpacked sound/music support restored
[fix] murky pool should work now
[fix] text formatting in plot texts
[add] Cow waypoint added. Cow level is imminent.
[fix] 'You cast %spellname%' is shown instead of '%username% casts %spellname%' when you cast the spell.
[fix] Identified item is now shown to player
[mod] UI Stretch implemented
[fix] gold overflow no longer disappears when selling items
[fix] initial Plot Text vertical offset

All these changes were made by a user named harukasan on Sourceforge.

For the script it works the same way. Paste the below code into diablorl-setup.sh. Then open a terminal and run this command: bash diablorl-setup.sh your_install_path your_path_to_DIABDAT.MPQ/DIABDAT.MPQ
Of course you have to replace your_install_path and your_path_to_DIABDAT.MPQ.

Code: [Select]
#!/bin/bash

# diablorl (http://diablo.chaosforge.org/) linux setup from sources with
# DIABDAT.MPQ sound support
#
# http://forum.chaosforge.org/index.php/topic,6528
# tested with ubuntu 14.04 32bits

# Please install the following packages before
#
# build-essential fpc libsdl1.2-dev libsdl1.2-dbg lua 5.1 liblua5.1-0-dev
# subversion p7zip-full wget sed
#
# ubuntu:
# sudo apt-get install -y build-essential fpc libsdl1.2-dev libsdl1.2-dbg lua5.1 liblua5.1-0-dev subversion p7zip-full wget sed

DRL_DIR=$1
MPQ_PATH=$2

if [ $# -ne 2 ]; then
    echo $0 DRL_INSTALL_DIR PATH_TO_DIABDAT.MPQ
    exit 1
fi

if [ ! -f "${MPQ_PATH}" ]; then
    echo "MPQ not found : $2"
    exit 2
fi

cd $(dirname "${MPQ_PATH}")
MPQ_PATH="$PWD/$(basename "${MPQ_PATH}")"
cd - &>/dev/null

mkdir -p "${DRL_DIR}" || exit 3
cd "${DRL_DIR}" || exit 4
DRL_DIR="$PWD"

# downloads (tested with rev 770 of fpcvalkyrie and 1194 of diablorl)
svn checkout -r 770 http://svn.code.sf.net/p/fpcvalkyrie/code/trunk fpcvalkyrie
svn checkout -r 1194 http://svn.code.sf.net/p/diablorl/code/trunk diablorl
wget https://github.com/ladislav-zezula/StormLib/archive/v8.20.zip
7z x v8.20.zip

# Build StormLib
cd "${DRL_DIR}"/StormLib-8.20
make -f Makefile.linux
cp libStorm.so "${DRL_DIR}"/diablorl/bin/lib
cd "${DRL_DIR}"/diablorl/bin/lib
ln -s libStorm.so StormLib.so


# patch fpcvalkyrie
cd "${DRL_DIR}"/fpcvalkyrie/src
sed -i~  -e 's/\(^[[:space:]]*\)\(FPrev.FNext := FNext;\)/\1if FPrev <> nil then \2/' \
         -e 's/\(^[[:space:]]*\)\(FNext.FPrev := FPrev;\)/\1if FNext <> nil then \2/' vnode.pas

# patch diablorl
cd "${DRL_DIR}"/diablorl/src
sed -i~ -e 's/\(raise EStreamError.CreateFmt.*;\)/{\1}/' rlui.pas

# compile
cd "${DRL_DIR}"/diablorl/src
FPCDIR=/usr/lib/fpc/2.6.2/ fpcmake
make COMPILER_UNITDIR=../../fpcvalkyrie/libs/ FPCOPT="-k-lm" DEBUG=1


# config and run
cd "${DRL_DIR}"/diablorl/bin
./mpq
cp -vf "${MPQ_PATH}" DIABDAT.MPQ
sed -i~ -e 's/sound     = "NONE"/sound     = "SDL"/' \
        -e 's/mpq       = ""/mpq       = "DIABDAT.MPQ"/' config.lua

# create a runner script
cat <<EOF > /tmp/diablorl
#!/bin/sh
cd "${DRL_DIR}/diablorl/bin"
export LD_LIBRARY_PATH="${DRL_DIR}/diablorl/bin/lib"
./rl
EOF

sudo mv /tmp/diablorl /usr/local/bin/diablorl
sudo chmod 755 /usr/local/bin/diablorl
sudo mv run_diablo_with_provided_libs.sh diabloRl.sh

echo Run and Have Fun with: /usr/local/bin/diablorl

To be sure that this will work you need some packages, they are precised by Grolm at the beginning of the script. But I don't know maybe some people are not very familiar with Linux. If you are on Ubuntu, open a terminal and paste the code below.
Code: [Select]
sudo apt-get install -y build-essential fpc libsdl1.2-dev libsdl1.2-dbg lua5.1 liblua5.1-0-dev subversion p7zip-full wget sedI just removed a space between lua and 5.1 because there is no space for this package.

Once you have done all this in order to run the game, open a terminal and type diablorl. I tested it on Ubuntu 14.04 32bits.

I have to mention that I just made some minor corrections on the script and give more details on how to the script works. All the credits goes to Grolm the original author.

P.S.: Excuse me if I made some mistakes, english is not my native language.
Logged

Porygon

  • Private FC
  • *
  • Offline Offline
  • Posts: 5
  • Lost Soul
    • View Profile
Re: Howto Play DiabloRL with sounds on Linux
« Reply #2 on: May 17, 2015, 01:22 »

Hello,

I just wanted to say that I tried to re-install diabloRL after a while. And the script needed some modifications. I don't know if people are still interested but anyway here is a new version:

Code: [Select]
#!/bin/bash

# diablorl (http://diablo.chaosforge.org/) linux setup from sources with
# DIABDAT.MPQ sound support
#
# http://forum.chaosforge.org/index.php/topic,6528
# tested with ubuntu 15.04 64bits

# Please install the following packages before
#
# build-essential fpc libsdl1.2-dev libsdl1.2-dbg lua 5.1 liblua5.1-0-dev
# subversion p7zip-full wget sed
#
# ubuntu:
# sudo apt-get install -y build-essential fpc libsdl1.2-dev libsdl1.2-dbg lua5.1 liblua5.1-0-dev subversion p7zip-full wget sed

DRL_DIR=$1
MPQ_PATH=$2

if [ $# -ne 2 ]; then
    echo $0 DRL_INSTALL_DIR PATH_TO_DIABDAT.MPQ
    exit 1
fi

if [ ! -f "${MPQ_PATH}" ]; then
    echo "MPQ not found : $2"
    exit 2
fi

cd $(dirname "${MPQ_PATH}")
MPQ_PATH="$PWD/$(basename "${MPQ_PATH}")"
cd - &>/dev/null

mkdir -p "${DRL_DIR}" || exit 3
cd "${DRL_DIR}" || exit 4
DRL_DIR="$PWD"

# downloads (tested with rev 770 of fpcvalkyrie and 1194 of diablorl)
svn checkout -r 770 http://svn.code.sf.net/p/fpcvalkyrie/code/trunk fpcvalkyrie
svn checkout -r 1194 http://svn.code.sf.net/p/diablorl/code/trunk diablorl
wget https://github.com/ladislav-zezula/StormLib/archive/v8.20.zip
7z x v8.20.zip

# Build StormLib
cd "${DRL_DIR}"/StormLib-8.20
make -f Makefile.linux
cp libStorm.so "${DRL_DIR}"/diablorl/bin/lib
cd "${DRL_DIR}"/diablorl/bin/lib
ln -s libStorm.so StormLib.so


# patch fpcvalkyrie
cd "${DRL_DIR}"/fpcvalkyrie/src
sed -i~  -e 's/\(^[[:space:]]*\)\(FPrev.FNext := FNext;\)/\1if FPrev <> nil then \2/' \
         -e 's/\(^[[:space:]]*\)\(FNext.FPrev := FPrev;\)/\1if FNext <> nil then \2/' vnode.pas

# patch diablorl
cd "${DRL_DIR}"/diablorl/src
sed -i~ -e 's/\(raise EStreamError.CreateFmt.*;\)/{\1}/' rlui.pas

# compile
cd "${DRL_DIR}"/diablorl/src
FPCDIR=/usr/lib/fpc/2.6.4/ fpcmake
make COMPILER_UNITDIR=../../fpcvalkyrie/libs/ FPCOPT="-k-lm" DEBUG=1


# config and run
cd "${DRL_DIR}"/diablorl/bin
./mpq
cp -vf "${MPQ_PATH}" DIABDAT.MPQ
sed -i~ -e 's/sound     = "NONE"/sound     = "SDL"/' \
        -e 's/mpq       = ""/mpq       = "DIABDAT.MPQ"/' config.lua

# create a runner script
cat <<EOF > /tmp/diablorl
#!/bin/sh
cd "${DRL_DIR}/diablorl/bin"
export LD_LIBRARY_PATH="${DRL_DIR}/diablorl/bin/lib"
./rl
EOF

sudo mv /tmp/diablorl /usr/local/bin/diablorl
sudo chmod 755 /usr/local/bin/diablorl
sudo mv run_diablo_with_provided_libs.sh diabloRl.sh

echo Run and Have Fun with: /usr/local/bin/diablorl

I tested it under Ubuntu 15.04 64bits.

Basically there is only one change but it took me some time to find it. It's line 63 "FPCDIR=/usr/lib/fpc/2.6.4/ fpcmake". It's depend of the version of fpc that you have, in order to know the version go into this folder (/usr/bin/fpc) and change the number of the version in the script if necessary. Otherwise you will get an error during the compilation of the game. If you have installed the last version of the different packages, the script should work without change.

The second thing is that you need one more package in order to compile the libstorm: libbz2-dev.
To install all the dependencies run this command before.

Code: [Select]
sudo apt-get install -y build-essential fpc libsdl1.2-dev libsdl1.2-dbg lua5.1 liblua5.1-0-dev subversion p7zip-full wget sed libbz2-dev
Logged
Pages: [1]