overridex
October 25th, 2009, 08:56 AM
I recently had a craving to play some of my older Loki games, but I quickly found that games made for Linux distributions from 2001 or so don't work so easily on modern distributions. Here's a quick run down on how to get the SimCity 3000 native Linux port working again.
Be sure to check out my howto for Sid Meier's Alpha Centauri and Kohan: Immortal Sovereigns as well:
http://ubuntuforums.org/showthread.php?t=1206578
You'll need to following files before we get started:
http://www.overridex.net/files/loki_compat_libs-1.3.tar.bz2
http://www.overridex.net/files/loki_patch
http://www.overridex.net/files/sc3u-2.0a-x86.run
Step 1: Install the game
Insert your game cd and run the following commands, assuming the game is in your first cdrom:
cd /media/cdrom
linux32 /bin/bash setup.sh
Cancel or press Ctrl-C for the Loki Update and Loki Uninstall setups, then install SimCity 3000 - I installed everything, and I installed to ~/games/SC3U with the symlinks in ~/bin. If you want to install somewhere system wide, you will need to run the install as root with sudo.
If you see messages like these during the install:
Unable to find file 'bin/x86/sc3u'
Unable to find file 'bin/x86/lib'
Then you should run the following commands after install to copy over some files that weren't copied. Assuming you installed to ~/games/SC3U:
cp -r /media/cdrom/bin/x86/glibc-2.1 ~/games/SC3U/.
cd ~/games/SC3U
ln -s glibc-2.1/* .
Step 2: Update the game
Run the following commands in the directory where you downloaded the game patch and loki_patch to:
chmod +x ./sc3u-2.0a-x86.run
_POSIX2_VERSION=199209 ./sc3u-2.0a-x86.run --keep
cd sc3u-2.0a-x86/bin/Linux/x86
cp ../../../../loki_patch .
cd ../../..
PATH=./bin/Linux/x86/:$PATH ./update.sh
Step 3: Install the Loki Compatibility libraries
Extract the loki_compat_libs-1.3.tar.bz2 file somewhere - I put it in ~/games/ since I planned to use them for more than one game, and my games are installed in sub directories there.
tar xvjf /path/to/downloaded/loki_compat_lib-1.3.tar.bz2
Step 4: Running the game
You can now run the game by changing to the game's directory, and running the following command:
LD_LIBRARY_PATH=../Loki_Compat/ SDL_AUDIODRIVER="dsp" SDL_PATH_DSP="/dev/dsp" ../Loki_Compat/ld-linux.so.2 ./sc3u.dynamic
Step 5: Running the game via a script
You can automate starting the game by creating the following script in your game directory. I named mine runsc3u.sh:
#!/bin/sh
# A simple shell script to launch SimCity 3000 on a modern Linux distribution
SCRIPTLOC=$0
DIRNAME=""
# Step through symlinks to find where the script really is
while [ -L $SCRIPTLOC ]; do
SCRIPTLOC=`readlink $SCRIPTLOC`
done
# Get the directory the script is in, then change to it
DIRNAME=`dirname $SCRIPTLOC`
cd $DIRNAME
# Run the game
LD_LIBRARY_PATH=../Loki_Compat/ SDL_AUDIODRIVER="dsp" SDL_PATH_DSP="/dev/dsp" ../Loki_Compat/ld-linux.so.2 ./sc3u.dynamic $*
Remember, if you have Loki_Compat installed somewhere else, you'll need to update the last command of the script.
You should also symlink runsc3u.sh into your PATH somewhere - ~/bin is in my PATH, so I created a symlink there.
Ready to play!
You should now be all set to play by running 'runsc3u.sh'. You may want to create a new entry in your menu to launch this, which you can do under System->Preferences->Menu Editor. You can find an icon to use attached to this post.
Have fun, let me know if you run into any problems following this tutorial.
Be sure to check out my howto for Sid Meier's Alpha Centauri and Kohan: Immortal Sovereigns as well:
http://ubuntuforums.org/showthread.php?t=1206578
You'll need to following files before we get started:
http://www.overridex.net/files/loki_compat_libs-1.3.tar.bz2
http://www.overridex.net/files/loki_patch
http://www.overridex.net/files/sc3u-2.0a-x86.run
Step 1: Install the game
Insert your game cd and run the following commands, assuming the game is in your first cdrom:
cd /media/cdrom
linux32 /bin/bash setup.sh
Cancel or press Ctrl-C for the Loki Update and Loki Uninstall setups, then install SimCity 3000 - I installed everything, and I installed to ~/games/SC3U with the symlinks in ~/bin. If you want to install somewhere system wide, you will need to run the install as root with sudo.
If you see messages like these during the install:
Unable to find file 'bin/x86/sc3u'
Unable to find file 'bin/x86/lib'
Then you should run the following commands after install to copy over some files that weren't copied. Assuming you installed to ~/games/SC3U:
cp -r /media/cdrom/bin/x86/glibc-2.1 ~/games/SC3U/.
cd ~/games/SC3U
ln -s glibc-2.1/* .
Step 2: Update the game
Run the following commands in the directory where you downloaded the game patch and loki_patch to:
chmod +x ./sc3u-2.0a-x86.run
_POSIX2_VERSION=199209 ./sc3u-2.0a-x86.run --keep
cd sc3u-2.0a-x86/bin/Linux/x86
cp ../../../../loki_patch .
cd ../../..
PATH=./bin/Linux/x86/:$PATH ./update.sh
Step 3: Install the Loki Compatibility libraries
Extract the loki_compat_libs-1.3.tar.bz2 file somewhere - I put it in ~/games/ since I planned to use them for more than one game, and my games are installed in sub directories there.
tar xvjf /path/to/downloaded/loki_compat_lib-1.3.tar.bz2
Step 4: Running the game
You can now run the game by changing to the game's directory, and running the following command:
LD_LIBRARY_PATH=../Loki_Compat/ SDL_AUDIODRIVER="dsp" SDL_PATH_DSP="/dev/dsp" ../Loki_Compat/ld-linux.so.2 ./sc3u.dynamic
Step 5: Running the game via a script
You can automate starting the game by creating the following script in your game directory. I named mine runsc3u.sh:
#!/bin/sh
# A simple shell script to launch SimCity 3000 on a modern Linux distribution
SCRIPTLOC=$0
DIRNAME=""
# Step through symlinks to find where the script really is
while [ -L $SCRIPTLOC ]; do
SCRIPTLOC=`readlink $SCRIPTLOC`
done
# Get the directory the script is in, then change to it
DIRNAME=`dirname $SCRIPTLOC`
cd $DIRNAME
# Run the game
LD_LIBRARY_PATH=../Loki_Compat/ SDL_AUDIODRIVER="dsp" SDL_PATH_DSP="/dev/dsp" ../Loki_Compat/ld-linux.so.2 ./sc3u.dynamic $*
Remember, if you have Loki_Compat installed somewhere else, you'll need to update the last command of the script.
You should also symlink runsc3u.sh into your PATH somewhere - ~/bin is in my PATH, so I created a symlink there.
Ready to play!
You should now be all set to play by running 'runsc3u.sh'. You may want to create a new entry in your menu to launch this, which you can do under System->Preferences->Menu Editor. You can find an icon to use attached to this post.
Have fun, let me know if you run into any problems following this tutorial.