Author Topic: SMAC on Linux / Loki version of SMAC  (Read 2041 times)

0 Members and 1 Guest are viewing this topic.

Offline DrazharLn

SMAC on Linux / Loki version of SMAC
« on: August 22, 2019, 03:45:15 AM »
Because I am procrastinating, I got the original Loki port of SMAC to run on my (linux) laptop.

Because it took me a while to work it out and the necessary information was spread out over a wide area, I've put the instructions on github: https://github.com/DrazharLn/smac-loki-linux

Copied below as well:

# Installing Loki's port of Sid Meier's Alpha Centauri and Alien Crossfire

## Why?

There's really no good reason to. Get the windows version from GOG and run it in `wine`. That way you can use unofficial patches, too.

The text is rendered a bit nicer in the linux version.

## How?

1. Get the loki games CD or an iso of it
2. Mount it and run `setup.data/bin/Linux/x86/setup`
3. Try running the binaries `smac` and `smacx`. They're static and it's not impossible they'll *just work*. Can also try `qemu-i386 smac`. Didn't work for me (segfault without qemu; `Unable to initialize SDL: Not enough resources to create thread` with)
3. If it's not working yet or you want allegedly less bugs, get the 6.0a patch http://updates.lokigames.com/smac/ (also on releases page). This fixes some bugs and provides dynamically linked copies of smac and smacx that we can use.
4. Run the patch with `smac-6.0a-x86.run --keep` because it won't find `loki-patch`. Then `cd smac-6.0a-x86; bin/Linux/x86/loki_patch patch.dat /path/to/smac/` to patch
5. Get the Loki compatibility libraries from http://www.improbability.net/loki/ (also on releases page) and extract them somewhere
6. Run with `LD_LIBRARY_PATH=/path/to/Loki_Compat /path/to/Loki_Compat/ld-linux.so.2 /path/to/smac/smacx.dynamic`
7. If you don't want it to steal the whole display use Xephyr (see launch script below)

## Caveats

Music isn't supported. The whining you might get from ALSA isn't about that.

IP multiplayer crashes the game. Hotseat/PBEM is fine.

Check Loki's FAQ: http://faqs.lokigames.com/smacfaq.html

## Launch script

Adapted from a script on the lutris db. You'll probably want to change the paths.

```sh
#!/bin/bash

if [ ! -e /dev/dsp ]; then
    sudo modprobe snd-pcm-oss
fi
Xephyr :1 -screen 1024x768 -extension Composite -fullscreen -name "Alpha Centauri"&
xephyr_pid=$!
sleep 1

DISPLAY=:1 LD_LIBRARY_PATH=~/SMAC/Loki_Compat ~/SMAC/Loki_Compat/ld-linux.so.2 ~/SMAC/smac/smac.dynamic
kill -9 $xephyr_pid
```

Offline SpookyZalost

Re: SMAC on Linux / Loki version of SMAC
« Reply #1 on: July 23, 2021, 06:54:33 PM »
not sure of the bump policy but I wanted to post that sound does indeed work with ALSA - OSS.

but only in 32 bit versions of linux, have tested this using #! linux (a debian variant, very minimal, no graphical transparency nonsense, Openbox Interface), using a 32 bit install on a Thinkpad W500.

aoss /path-to-program/program-executable seemed to work under that and the game ran without issues, even used Xeph to get window mode working.

unfortunately despite my efforts modern 64bit Linux distro's do not support sound though the game runs fine in Pop! OS, it makes a crackling sound at best indicating some sort of sound is being played but not understood.

have not gotten paddsp to work for sound.

Online Buster's Uncle

  • In Buster's Orbit, I
  • Ascend
  • *
  • Posts: 49271
  • €440
  • View Inventory
  • Send /Gift
  • Because there are times when people just need a cute puppy  Soft kitty, warm kitty, little ball of fur  A WONDERFUL concept, Unity - & a 1-way trip that cost 400 trillion & 40 yrs.  
  • AC2 is my instrument, my heart, as I play my song.
  • Planet tales writer Smilie Artist Custom Faction Modder AC2 Wiki contributor Downloads Contributor
    • View Profile
    • My Custom Factions
    • Awards
Re: SMAC on Linux / Loki version of SMAC
« Reply #2 on: July 23, 2021, 07:16:29 PM »
Bump at will.

Thanks for the info.

Offline SpookyZalost

Re: SMAC on Linux / Loki version of SMAC
« Reply #3 on: July 30, 2021, 02:19:47 AM »
So just to give more of an idea what's going on.

in a 64bit linux you can install snd-pcm-oss which in 32bit linux works fine.

the problem is that when you try to run it in a 64bit linux install, since the OSS compatibility libraries are not compatible with 64 bit linux you get an error like this.

# sudo modprobe snd-pcm-oss
FATAL: Module snd_pcm_oss not found.

Similar problems happen with OSSPD and ALSA-OSS.

basically it can't see it.

I've tried to use ialib32 and other 32bit compatibility libraries and changed the startup options for SMACX to point at those libraries but I only end up crashing the game.

the game it's self runs fine if you install with the loki installer from LIFLG which includes compatibility libraries, just no sound.

so what you need if you use Pulseaudio (most do if they don't have ALSA, however it's similar if you use OSS-ALSA)

apt-get install osspd osspd-pulseaudio

you need OSSPD, then you need to do the following.

sudo systemctl enable osspd

then just tell SMACX/SMAC to use OSSPD in it's configuraiton settings and it works flawlessly, at least on 32 bit linux (has tested working on the above listed #! linux, most recent version which is a Debian variant).

the alternative to this is compiling OSS4 from source and using that, from what I hear it just works but again, your mileage may vary.

as a side note, if you chose to go the OSS4 route, a lot of modern linux games are designed with ALSA or Pulse audio in mind so in trying to get the Loki linux games working you might break the sound on more modern linux titles though I haven't tested this to be sure, it might be better to have a second install just for these old games.

Offline SpookyZalost

Re: SMAC on Linux / Loki version of SMAC
« Reply #4 on: August 07, 2022, 11:19:02 PM »
Going to post an update, I got it working with sound in ubuntu 22.04 64bit!!!!

Okay so here's how you do it.

first, use the LIFLG installer for SMACX Planetary pack.  Don't run the game yet, it'll run in window mode with the --window modifier but no sound.

Now to get the sound working here's the real trick.

There's a project by the lutris devs called Asgard
https://github.com/lutris/asgard/

grab this and set it up, make sure you have osspd installed.

then copy your installed directory for SMAC/SMACX to the games folder and run the following command (make sure your docker instances are setup and your user has docker permissions, you can do this with sudo usermod -aG docker $USER)

./asgard-build smac

let it run, it'll probably give you an error letting you know you're running it on a 64bit OS and it needs a 32bit one.

once it finishes then run ./asgard-run smac

Alpha Centauri will open using the old libraries in docker with sound and everything in a 1024x768 window!!!

Just need to figure out how to tell it to open a specific executable so I can play smacx instead of plain smac but this is a major step forward.

« Last Edit: August 07, 2022, 11:59:20 PM by SpookyZalost »

Offline SpookyZalost

Re: SMAC on Linux / Loki version of SMAC
« Reply #5 on: March 20, 2023, 06:48:28 AM »
So after a lot of fiddling I gave up on 64bit for now.  I dug up an old IBM thinkpad T40 and loaded Mandrake 9.2 on it.  Everything worked out of the box as expected.



I now have a working retro system to test against for the asgard workaround.

Offline Misanthrope

Re: SMAC on Linux / Loki version of SMAC
« Reply #6 on: March 20, 2023, 07:50:28 AM »
So after a lot of fiddling I gave up on 64bit for now.  I dug up....
....now have a working retro system to test against for the asgard workaround.

Ugh... I need to do the same thing.
ABSOLUTELY DREADING Having to argue a DEB distro into submission, but with the ole'ye WinXP compy fading into bug-ridden obscurity, I'm a'feared there'll soon be no other option.
About the only consolation I might have is, I have the ORIG CD's and a DL'ed XP patch here. ;wince
- - - - - - - - - - - - - - - - - - - -
...but withall all t3h tyops and mipselled wrods.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

The first living thing to go through the device was a small white rat. I still have him, in fact. As you can see, the damage was not so great as they say.
~Academician Prokhor Zakharov 'See How They Run'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 38.

[Show Queries]