By following these instructions, I was able to frankenstein together the Loki Software Linux Railroad Tycoon 2 binaries with the data from a Windows Railroad Tycoon 2 Platinum disc.
WARNING: The installation produced by this will be missing the music and video cutscenes.
- Music (It doesn’t even seem to be trying to load it, so I have no idea where to start diagnosing.)
- Video cutscenes (I didn’t care enough to spend the effort. See this blog post for instructions on converting Smacker video to the type of MPEG Loki games expect and read further for how to identify what filenames it’s looking for.)
unshieldor Wine to unpack the Windows installer
unzipto bypass the “Please insert ‘Railroad Tycoon 2 Loki disc'” message in the Linux installer
- Perl and the
/usr/bin/renamesymlink to Perl’s
- A Railroad Tycoon 2 CD (you may also be able to use the version sold on Steam, but I’ve only tested the TakeAdvantage UK CD-ROM release of Railroad Tycoon 2 Platinum)
- rt.2_1.54c-multilingual_x86.mojo.run from lilfg.org
- loki_compat_libs-1.3.tar.bz2 from this archived Gentoo Wiki page (optional if you don’t want audio)
Instructions (all approaches):
rt.2_1.54c-multilingual_x86.mojo.runinto your target directory
- Insert the Railroad Tycoon 2 CD into your CD drive
- Type or copy-paste the following commands, adjusting paths as appropriate:
# Unpack the Linux binaries unzip rt.2_1.54c-multilingual_x86.mojo.run cd data tar xvf patch-1.54c.tar # Unpack the data files from the CD into the expected layout unshield /media/*/RT2_PLAT/_setup/data1.cab unshield /media/*/RT2_PLAT/_setup/data2.cab mv Root_Files/* . rmdir Root_Files # Fix issues caused by Windows being case-insensitive and Linux # being case-sensitive mv Data data (cd data; rename 'y/A-Z/a-z/' *) (cd maps; rename 's/.MP2/.mp2/' *; rename 's/.MAP/.map/' *; rename 'y/A-Z/a-z/' \#*)
That will get the statically-built binary (./rt2) playable but you won’t get any sound because the static linking prevents PulseAudio from faking ALSA’s API. (It may play audio if run via pasuspender but I don’t like how pasuspender mucks with things, so I didn’t test it.)
Additional Instructions for working audio:
The simplest way to get working audio is to use the dynamic version. For that, you need some old library dependencies and a wrapper script capable of providing a 32-bit version of padsp’s functionality on 64-bit Linux:
tar xvaf loki_compat_libs-1.3.tar.bz2 --wildcards 'Loki_Compat/libsmjpeg-0.2.*' 'Loki_Compat/libSDL-1.*' cat > run-dynamic.sh << EOF export LD_PRELOAD='/usr/lib/i386-linux-gnu/pulseaudio/libpulsedsp.so' export SDL_AUDIODRIVER=alsa export LD_LIBRARY_PATH=Loki_Compat if [ "$1" = '--strace' ]; then strace ./rt2.dynamic 2>&1 | egrep -v '/(var|etc|lib)/|.loki/rt2|[./]pulse|Loki_Compat' | grep -i 'No such file' else ./rt2.dynamic fi EOF chmod +x run-dynamic.sh
Now, you can use
run-dynamic.sh to launch it and your sound effects will work too.
Additional Instructions if you want to try to get videos or music working:
First, the most important trick I used to figure out which files to rename and how was running the game via this command:
strace ./rt2 2>&1 | grep -v '.loki/rt2' | grep -i 'No such file'
I’ve incorporated a more polished version into run-dynamic.sh which can be triggered by running it as
(Don’t worry about the
LD_PRELOAD errors. That’s just
strace complaining that it can’t use the 32-bit PulseAudio library that we’re requesting for the game itself.)
Second, be aware that, if you break the audio on the dynamic version, don’t click the Quit button. It’ll freeze the game without releasing your pointer. Instead, if audio isn’t working, hit Alt+F4 to ungrab the mouse and keyboard and switch to windowed mode, then use
xkill to kill the window.
In case you forget, I also advise running these so you can recover from a freeze while fullscreened by using Ctrl+Alt+F1 to switch to a console, logging in, running
./rt2_release_gui.sh, and then using Ctrl+Alt+F7 to return to your desktop.
echo "DISPLAY=:0.0 xkill -id $(DISPLAY=:0.0 wmctrl -l | grep Railroad | cut -d' ' -f1)" > ~/rt2_release_gui.sh chmod +x ~/rt2_release_gui.sh