Jump to content

Installing the Game Linux: Difference between revisions

From Kingpin Wiki
No edit summary
Line 28: Line 28:
unzip kingpin_v1.20-i386_with_nocd.zip -d "$HOME/games/kingpin"
unzip kingpin_v1.20-i386_with_nocd.zip -d "$HOME/games/kingpin"
rm kingpin_v1.20-i386_with_nocd.zip
rm kingpin_v1.20-i386_with_nocd.zip
cd $HOME/kingpin
cd $HOME/games/kingpin
echo $HOME/games/kingpin > kingpin.conf
echo $HOME/games/kingpin > kingpin.conf
chmod +x main/ccase
chmod +x main/ccase
Line 38: Line 38:
sudo apt install libxext6:i386
sudo apt install libxext6:i386
</syntaxhighlight>
</syntaxhighlight>
===Videocard===
===Videocard===
Make sure you videocard is atleast 128mb and 3D accelation is on.<br>
Make sure you videocard is atleast 128mb and 3D accelation is on.<br>

Revision as of 22:53, 1 August 2025

There wasn't a retail Linux version of this game, instead the developers provided a downloadable tarball with Linux binaries to use with the Windows CD. In the readme that comes with it says:

To install the Kingpin files, you will need to install Kingpin under win32,
and then mount the installation folder under linux, and copy the installed
files across.

Kingpin requires approx 550mb of free hard drive space.

There is also a other you won't need to do that.

Install the game

To install the required utils:

sudo apt-get install unshield

Mount your Kingpin CDROM. Change the CDROM path if nessary my CDROM path is here /media/kingpin/ but it could also be /media/cdrom/ Let's say you want to install the game in $HOME/games/kingpin:

mkdir -p $HOME/games/kingpin
unshield -d "$HOME/games/kingpin" x "/media/kingpin/Kingpin/kingpin/data1.cab"

cd $HOME/games/kingpin
rsync -a Common_Files/ Mature_Files/ Program_Executable_Files/ ./
rm -rf Common_Files/ Low_Violence_Files/ Mature_Files/ Program_Executable_Files/ US_Specific_Files/ *.exe *.dll main/gamex86.dll

Download kingpin_v1.20-i386_with_nocd.zip This file comes already with some hexx patches that makes things easyr.

wget https://downloads.kingpin.info/kingpin/patches/unofficial/linux/kingpin_v1.20-i386_with_nocd.zip
unzip kingpin_v1.20-i386_with_nocd.zip -d "$HOME/games/kingpin"
rm kingpin_v1.20-i386_with_nocd.zip
cd $HOME/games/kingpin
echo $HOME/games/kingpin > kingpin.conf
chmod +x main/ccase
./main/ccase -r *

Needed lib files:

sudo apt install libx11-6:i386
sudo apt install libxext6:i386

Videocard

Make sure you videocard is atleast 128mb and 3D accelation is on.
Check if you Mesa and opengl working:

glxinfo | grep "OpenGL version"
glxgears

Install Mesa drivers:

sudo apt install libglx-mesa0:i386 libgl1-mesa-dri:i386 mesa-utils
sudo apt install libgl1:i386

Use path to link libGL.so for example:

sudo find / -name "libGL.so.1"
sudo ln -s /usr/lib/i386-linux-gnu/libGL.so.1 $HOME/games/kingpin/libGL.so

Sound

Make sound working.
See if snd-pcm-oss is working

lsmod | grep snd_pcm_oss

If doesn't show any info:

sudo modprobe snd-pcm-oss

Optional (Mixer):

sudo modprobe snd_mixer_oss

It should now show info with:

lsmod | grep snd_pcm_oss

Test sound with:

cat /dev/urandom > /dev/dsp1

CTRL+C to cancel test Now to fix sound with kingpin:

echo kingpin 0 0 direct | sudo tee /proc/asound/card0/pcm0p/oss

Start the game

#!/bin/sh
#
# Kingpin: Life of Crime startup script
#

# The user preferences directory
KINGPIN_PREFS="${HOME}/.kingpin"

# KPHack options
export KPHACK_DGAMOUSE=1 KPHACK_FULLSCREEN=1 KPHACK_WHEEL=0

# Function to find the real directory a program resides in.
# Feb. 17, 2000 - Sam Lantinga, Loki Entertainment Software
FindPath()
{
    fullpath="`echo $1 | grep /`"
    if [ "$fullpath" = "" ]; then
        oIFS="$IFS"
        IFS=:
        for path in $PATH
        do if [ -x "$path/$1" ]; then
               if [ "$path" = "" ]; then
                   path="."
               fi
               fullpath="$path/$1"
               break
           fi
        done
        IFS="$oIFS"
    fi
    if [ "$fullpath" = "" ]; then
        fullpath="$1"
    fi
    # Is the awk/ls magic portable?
    if [ -L "$fullpath" ]; then
        fullpath="`ls -l "$fullpath" | awk '{print $11}'`"
    fi
    dirname $fullpath
}

# Set the home if not already set.
if [ "${KINGPIN_DATA_PATH}" = "" ]; then
    KINGPIN_DATA_PATH="`FindPath $0`"
fi

LD_LIBRARY_PATH=.:${KINGPIN_DATA_PATH}:${LD_LIBRARY_PATH}

export LD_LIBRARY_PATH
export KINGPIN_DATA_PATH
export LD_PRELOAD="${KINGPIN_DATA_PATH}/kphack.so:$LD_PRELOAD"

create_prefpath()
{
    path="${KINGPIN_PREFS}"
    if [ ! -d "$path" ]; then
        echo "Creating directory $path"
        mkdir "$path"
    fi
}

copy_if_needed()
{
    dist="${KINGPIN_DATA_PATH}/kingpin.conf"
    file="${KINGPIN_PREFS}/kingpin.conf"
    if [ ! -f "$file" ]; then
        echo "Installing default $file"
        cp "$dist" "$file"
    fi
}

# KPHack doesn't play nicely with $HOME/.kingpin when starting a new game
# when saves already exist in main/save/current/

fix_current_saves()
{
if [ -e ${KINGPIN_PREFS}/main/save/current/game.ssv ]
then
	rm ${KINGPIN_PREFS}/main/save/current/*
fi
}

# Hey, it's fun time!
if [ ! -d ${KINGPIN_PREFS} ]
then
    echo "Creating preferences directory..."
    create_prefpath
    copy_if_needed
fi

# Let's boogie!
if [ -x "${KINGPIN_DATA_PATH}/kingpin.x86" ]
then
	fix_current_saves
	cd "${KINGPIN_DATA_PATH}/"
	exec "./kingpin.x86" +set vid_ref glx \
	+set gl_driver libGL.so.1 "$@" +set _windowed_mouse 1 $*
fi
echo "Couldn't run Kingpin: Life of Crime (kingpin.x86). Is KINGPIN_DATA_PATH set?"
exit 1