Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Running Kohan and Sid Meier's Alpha Centauri on 9.04 64-bit

  1. #1
    Join Date
    Nov 2006
    Beans
    16

    Running Kohan and Sid Meier's Alpha Centauri on 9.04 64-bit

    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 these native Linux ports working again. You should be able to apply the basics of this to other Loki games as well.

    For both of these games you will need the following files:

    http://www.overridex.net/files/loki_...bs-1.3.tar.bz2
    http://www.overridex.net/files/loki_patch

    Sid Meier's Alpha Centauri

    In addition to the files above, you will also need this patch:

    http://www.overridex.net/files/smac-6.0b-x86.run

    Step 1: Install the game

    Insert your game cd and run the following commands, assuming the game is in your first cdrom:

    Code:
    cd /media/cdrom
    linux32 /bin/bash setup.sh
    Cancel or press Ctrl-C for the Loki Update and Loki Uninstall setups, then install Alpha Centauri - I installed everything, and I installed to ~/games/smac with the symlinks in ~/bin. If you want to install somewhere system wide, you will need to run the install as root with sudo.

    Step 2: Update the game

    Run the following commands in the directory where you downloaded the game patch and loki_patch to:

    Code:
    chmod +x smac-6.0b-x86.run
    _POSIX2_VERSION=199209 linux32 ./smac-6.0b-x86.run --keep
    cp loki_patch ./smac-6.0b-x86/bin/Linux/x86/loki_patch
    cd smac-6.0b-x86
    mv patchdata data
    linux32 ./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.

    Code:
    tar xvjf /path/to/downloaded/loki_compat_lib-1.3.tar.bz2
    Step 4: Update Compiz settings (Optional)

    If you want to run the game with Compiz, you'll need to make a small change so that the game doesn't play with it's window mostly transparent. Open CompizConfig Settings Manager under System -> Preferences -> CompizConfig Settings Manager. If you don't already have this, you can install the package "compizconfig-settings-manager".

    Find and enable the Window Rules plugin under Window Management. If you do not have this plugin, you may need to install the "compiz-fusion-plugins-extra" package.

    Add the following string to the "No ARGB Visuals" setting:

    Code:
    (title=Sid Meier's Alpha Centauri) | (title=SMAC Planetary Pack)
    Step 5: Running the game

    You can now run the game by changing to the game's directory, and running one of the following commands:

    Alpha Centauri on 64-bit:

    Code:
    LD_PRELOAD=../Loki_Compat/libstdc++-3-libc6.2-2-2.10.0.so:/usr/lib32/libX11.so ./smac.dynamic
    Alien Crossfire on 64-bit:

    Code:
    LD_PRELOAD=../Loki_Compat/libstdc++-3-libc6.2-2-2.10.0.so:/usr/lib32/libX11.so ./smacx.dynamic
    If you're on a 32-bit install, simply switch /usr/lib32/libX11.so for /usr/lib/libX11.so in each command. Also, keep in mind you may need to change the command if you installed Loki_Compat somewhere other than the directory above your game directory.

    Step 6: Running the game from smacpack

    Alpha Centauri came with a neat frontend called 'smacpack' for choosing to launch the original game or the expansion. In order for this to work, we need to make a few changes which will help automate running the game. From the game's directory, run these commands:

    Code:
    mv smac smac.real
    mv smacx smacx.real
    Next, recreate the 'smac' file as a text file with this content:

    Code:
    #!/bin/sh
    # A simple shell script to launch SMAC 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_PRELOAD=../Loki_Compat/libstdc++-3-libc6.2-2-2.10.0.so:/usr/lib32/libX11.so ./smac.dynamic
    Again, keep in mind you may need to change the last command slightly if you're on a 32-bit system, or if you installed the Loki_Compat libraries somewhere different.

    Repeat the above steps recreating the smacx text file with the above script, just change the last line to use "smacx.dynamic" instead of "smac.dynamic".

    Now, make both scripts executable:

    Code:
    chmod +x smac
    chmod +x smacx
    Ready to play!

    You should now be all set to play by running 'smacpack'. 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.

    Kohan: Immortal Sovereigns

    In addition to the files above, you will also need this patch:

    http://www.overridex.net/files/kohan-1.2.0-x86.run
    http://www.overridex.net/files/kohan-1.3.1-x86.run

    Step 1: Install the game

    Insert your game cd and run the following commands, assuming the game is in your first cdrom:

    Code:
    cd /media/cdrom
    linux32 /bin/bash setup.sh
    Cancel or press Ctrl-C for the Loki Update and Loki Uninstall setups, then install Kohan - I installed everything, and I installed to ~/games/smac with the symlinks in ~/bin. If you want to install somewhere system wide, you will need to run the install as root with sudo.

    Step 2: Update the game

    Run the following commands in the directory where you downloaded the game patches and loki_patch to:

    Code:
    chmod +x kohan-1.2.0-x86.run
    _POSIX2_VERSION=199209 ./kohan-1.2.0-x86.run --keep
    cp loki_patch ./kohan-1.2.0-x86/bin/Linux/x86/loki_patch
    cd kohan-1.2.0-x86
    linux32 ./update.sh
    cd ..
    chmod +x kohan-1.3.1-x86.run
    _POSIX2_VERSION=199209 ./kohan-1.3.1-x86.run --keep
    cp loki_patch ./kohan-1.3.1-x86/bin/Linux/x86/loki_patch
    cd kohan-1.3.1-x86
    linux32 ./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.

    Code:
    tar xvjf /path/to/downloaded/loki_compat_lib-1.3.tar.bz2
    Step 4: Running the game

    Change to the game's directory and run the following command:

    Code:
    LD_PRELOAD=../Loki_Compat/libstdc++-3-libc6.2-2-2.10.0.so ./kohan.dynamic
    Keep in mind you may need to change the command if you installed Loki_Compat somewhere other than the directory above your game directory.

    I also found that sound got distorted and crackled sometimes right at the main menu, sometimes after playing for a bit. This is fixed by using the following command to run the game instead:

    Code:
    LD_PRELOAD=../Loki_Compat/libstdc++-3-libc6.2-2-2.10.0.so:../Loki_Compat/libSDL-1.2.so.0 SDL_AUDIODRIVER="dsp" SDL_PATH_DSP="/dev/dsp" ./kohan.dynamic
    Of course, this requires either OSS sound drivers or ALSA's OSS emulation. Change /dev/dsp to your actual sound card.

    Step 5: Scripting running the game

    You can automate starting the game by creating the following script in your game directory. I named mine runkohan.sh:

    Code:
    #!/bin/sh
    # A simple shell script to launch Kohan 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_PRELOAD=../Loki_Compat/libstdc++-3-libc6.2-2-2.10.0.so:../Loki_Compat/libSDL-1.2.so.0 SDL_AUDIODRIVER="dsp" SDL_PATH_DSP="/dev/dsp" ./kohan.dynamic
    Remember, if you don't want the sound fix or have Loki_Compat installed somewhere else, you'll need to update the last command of the script.

    You should also symlink runkohan.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 'runkohan.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.
    Attached Images Attached Images   

  2. #2
    Join Date
    Apr 2006
    Location
    Seattle
    Beans
    2,893
    Distro
    Ubuntu Development Release

    Re: Running Kohan and Sid Meier's Alpha Centauri on 9.04 64-bit

    Excellent tutorial. Approved, and thank you for contributing to Tutorials & Tips!

  3. #3
    Join Date
    Dec 2007
    Location
    New York
    Beans
    323

    Re: Running Kohan and Sid Meier's Alpha Centauri on 9.04 64-bit

    after running
    chmod +x smac-6.0b-x86.run
    _POSIX2_VERSION=199209 linux32 ./smac-6.0b-x86.run --keep
    cp loki_patch ./smac-6.0b-x86/bin/Linux/x86/loki_patch
    cd smac-6.0b-x86
    mv patchdata data
    linux32 ./update.sh
    update.sh gives the error:
    Performing update:
    ERROR: No matching delta for /home/j/games/data/tutor.txt
    edit: tried a different iso, same error

    i cant figure this one out, any ideas?
    Last edited by Johnny B; July 13th, 2009 at 02:20 AM.

  4. #4
    Join Date
    Nov 2006
    Beans
    16

    Re: Running Kohan and Sid Meier's Alpha Centauri on 9.04 64-bit

    Quote Originally Posted by Johnny B View Post
    after running

    update.sh gives the error:

    edit: tried a different iso, same error

    i cant figure this one out, any ideas?
    Where is the game installed? Did it get installed to /home/j/games/ and get moved or was it originally installed to /home/j/games/smac ?

    If the game is really installed in /home/j/games/smac but it's looking in the directory above it, try editing ~/.loki/installed/smac.xml and change the root attribute of the product tag to the correct directory.

    By the way, sorry for taking a bit to reply to you on this - I hadn't subscribed to the thread when I first submitted it and didn't see that it had been approved yet. I should be much quicker to respond now.
    Last edited by overridex; July 18th, 2009 at 02:32 PM. Reason: added note

  5. #5
    Join Date
    Sep 2008
    Beans
    57

    Re: Running Kohan and Sid Meier's Alpha Centauri on 9.04 64-bit

    I have followed the steps using planetary pack, but after starting a game, the game crashes after acepting the first city name:

    X Error: BadMatch
    Request Major code 66 ()
    Error Serial #677
    Current Serial #680

    Any help?

  6. #6
    Join Date
    Nov 2006
    Beans
    16

    Re: Running Kohan and Sid Meier's Alpha Centauri on 9.04 64-bit

    Quote Originally Posted by slamelov View Post
    I have followed the steps using planetary pack, but after starting a game, the game crashes after acepting the first city name:




    Any help?
    This is caused by not preloading libX11.so and using the dynamic executable. Make sure that you're preloading /usr/lib/libX11.so if you're on a 32-bit system as described in the tutorial, or if you're on a 64-bit system preload /usr/lib32/libX11.so -- you should make sure that file exists, if it doesn't, install the ia32-libs package to get it.

    Hope this helps,

  7. #7
    Join Date
    Sep 2008
    Beans
    57

    Re: Running Kohan and Sid Meier's Alpha Centauri on 9.04 64-bit

    Finally, it works adding this:

    Code:
    Section "Extensions"
    Option "Composite" "Disable"
    EndSection
    To Xorg file and restarting X.

    Thanks for the help

  8. #8
    Join Date
    Nov 2006
    Beans
    16

    Re: Running Kohan and Sid Meier's Alpha Centauri on 9.04 64-bit

    Quote Originally Posted by slamelov View Post
    Finally, it works adding this:

    Code:
    Section "Extensions"
    Option "Composite" "Disable"
    EndSection
    To Xorg file and restarting X.

    Thanks for the help
    Interesting, what video card and driver are you using? On my Nvidia card with the proprietary drivers I play with composite enabled and compiz.

  9. #9
    Join Date
    Sep 2008
    Beans
    57

    Re: Running Kohan and Sid Meier's Alpha Centauri on 9.04 64-bit

    nVidia 7900 Ultra, drivers 180.44.

    also, I had the same problem about tutor.txt, but still works with these options in xorg.

    I don't use compiz.

    do you know is there is any way to change game resolution?.

  10. #10
    Join Date
    Nov 2006
    Beans
    16

    Re: Running Kohan and Sid Meier's Alpha Centauri on 9.04 64-bit

    Quote Originally Posted by slamelov View Post
    do you know is there is any way to change game resolution?.
    I'm pretty sure those games only supported 1 resolution.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •