Linux Support

From AssaultWiki
Jump to: navigation, search
The Linux mascot.
Tux Fragger

openSUSE, Fedora

http://software.opensuse.org/package/assaultcube offers pre-built RPMs

Ubuntu, Kubuntu, Xubuntu, Debian

With pre-made .deb

Unfortunately, the current packages for AC are badly out of date. Download AssaultCube instead and extract to where you want, keeping in mind the required libraries (see link).

Graphics drivers

Since the other components of the installation might not be too difficult, graphics drivers do tend to trip people up whilst trying to get the game installed. If you already have another FPS game running on your computer at high speed, you probably don't need to do anything and it should work by default. To verify whether or not you have hardware acceleration (which implies your graphics drivers work successfully), you can run AssaultCube from a terminal, and look for a line that starts with Renderer:. If it gives MESA as your driver, you shall need to sort it out in order to play the game with the full capabilities of your computer.

There are numerous ways to install the graphics drivers on Ubuntu, but most likely, you will get away with these tutorials (depending on your graphics card): NVIDIA binary driver installation, ATI binary driver installation and more general driver installation.

Troubleshooting

If AssaultCube is not running properly or you have issues getting the game to run in ubuntu ensure that:

  • Compiz or any other fancy compositing is not enabled on your computer while you are playing AssaultCube.
  • You have the proper graphics drivers (see above).
  • Your computer meets the Minimum Requirements to play AssautCube.

Other Distributions

Compiling AssaultCube

If you find you need to compile a special binary for your operating system, follow these steps.

  • Open a console
  • Make sure all needed libraries are installed - you can do this by running the following command:
sudo apt-get install build-essential libsdl1.2debian libsdl1.2debian-pulseaudio libsdl1.2-dev libsdl-image1.2 libsdl-image1.2-dev libopenal1 libopenal-dev libvorbis-dev libcurl3 libcurl4-openssl-dev

Make sure to select yes if it asks you to install additional packages

cd ~/AssaultCube/source/src
make install
make clean

Congrats, AssaultCube should now be compiled and you can execute the new binary simply by starting the shell file.

Compiling OpenAL 1.0

If your distribution does not provide you with the package libopenal1 by itself, you will need to compile it yourself. First grab the latest sources from http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx Then install cmake (sudo apt-get install cmake) and if you haven't already build-essential too. Unpack the openal-archive, change into it's top directory and run

cmake .

Then you will need to edit the text file CMakeCache.txt and find these two lines

//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local

Change the /usr/local to /usr then run

make
sudo make install

You can proceed to check the installation went okay by doing

ls -l /usr/lib/libopenal.so.1*

and getting a couple of files listed.

The Libraries

AssaultCube is a C++ based game which has been programmed in the languages OpenGL, FMOD and SDL with some additional libraries. In fact, Linux and many other UNIX-like Operating Systems use several packages, which are installed on your hard drive(s); these ones are constantly used by your computer to make a lot of applications work. That's exactly what we will do. First of all, install the SDL (and every library said person's favorite game uses, however, in this case, we will only need SDL).

Terminal Method

There are a few ways to install the packages, we will first see the 'Terminal Method'.First use the update command,then write the following code line to install the associated package. Assuming you're using a Debian-based distribution, the following commands will work, your distribution may use emerge(Gentoo/Like), yast(2)(SuSE/Like), yum(RHEL/Like) or some other set of commands:

Update command
sudo apt-get update
Library Command
SDL sudo apt-get install libsdl1.2debian libsdl-image1.2 libsdl-mixer1.2
SDL-dev (only needed for compiling) sudo apt-get install libsdl1.2debian-dev libsdl-image1.2-dev libsdl-mixer1.2-dev

You may need to activate several other repositories, see here to do so: Ubuntu Man.

Ubuntu

Ubuntu Man

Fedora/Debian/RedHat

The repositories are enabled by default

SuSE

OpenSuSE Build Service

Package Manager Method

The other way to install SDL is to use (If your distribution offers it) the distributions own Package Manager (ie Ubuntu uses Synaptic, Fedora uses PackageKit, etc). Installing packages with this tool is likely easier; you simply have to search the packages you want, and the tool, if the package is found, will automatically generate the dependencies with the GUI interface. To launch Synaptic on Ubuntu or Debian-like distributions running GNOME, browse the menu 'System->Administration', and click Synaptic Package Manager.The application will ask you the root password(Or at the least administrators one, however this seems to have changed as of recent), and the package will be installed. In order the install the packages one needs, click the search button, and launch the search with sdl. The application will search and display every package which in contain SDL. Select the following packages.


Library Packages to select
SDL libsdl-image1.2, libsdl-mixer1.2, libsdl1.2debian
SDL-dev (needed for compiling only) libsdl1.2debian-dev libsdl-image1.2-dev libsdl-mixer1.2-dev

After checking the little boxes next to the lib names, click 'Apply'. Synaptic will tell you all of the necessary packages you will be needing to install on your computer in order to meet the requirements Click Apply again, and let the process work. So you can choose the method you prefer, you just have to know that both have the same point: install the needed packages (Synaptic only provides a graphical interface, but Apt-Get or Apitude is faster to use with only one or two strings to input).

Now we have installed the packages, let's see the known issues we noticed.

Troubleshooting

If AssaultCube is not running properly or you have issues getting the game to run on your distribution try installing ALL the sdl packages and the required dlevel ones. You may already have some of the packages installed but you should install the other ones to make it more complete, which in-turn helps AssaultCube run. First, navigate in the the src folder located inside of the AssaultCube folder. Then do the following (for the first command use what ever package manager your distribution uses to install packages)

$ yum install gcc-c++ SDL* zlib zlib-devel openal openal-devel
$ ln -s ../include/AL AL
$ ln -s ../include/GL GL
$ make install

Additional Linux installation woes

Obviously, the game should work with the only packages we installed, but some Linux users noticed that there are a lot of other additionnal things to do to make AssaultCube work.

The lag issue

OK so I'll assume in this section that SDL's been installed successfully, and that you've launched it from a Terminal ( '$sh assaultcube.sh' ). The issue I will talk about in this section is the 'lag': first time I tried Assault Cube on Hardy Heron, I installed the libs, I launched the game, but instead of hardcore gaming with my 4 Go RAM, I only have 126 Mo performs... Those problems come from the drivers installed by default under Ubuntu: the MESA driver. This last one is installed under Gutsy Gibbons, even in the earlier versions of Ubuntu, and provides gamers a lot of game launching issues: MESA DRI (Direct Rendering Infrastructure) is not so much appropriated for gaming (and I even don't know if this driver is good to launch any OpenGL application as well). How do I know if the render I use is provided by the MESA driver ?

Terminal command
glxgears -info

This command will display two gears on a little window, but the main and the you use. You will clearly see if the render you use is the MESA's or not. You can see a screenshot here. If you've the confirmation that your computer use MESA, you will be required to update your drivers (or, alternatively, at least change them).

ATI and nVidia GPU

To change the drivers of the ATI and nVidia graphic cards, we'll use a tool coded in Python by an Italian, Alberto Milone. His tool, called Envy, is very useful, for it permits us to change drivers of any ATI/nVidia graphic card with a graphical interface. To install it, enter in a Terminal the following commands:

Terminal command
sudo apt-get remove envyng
sudo rm -R /usr/share/envy
sudo apt-get install envyng-gtk

The first two commands will make you ensure that no other version of Envy is already installed ( you can skip this steps if you're really sure that you've never tried out any version of this tool ). Now EnvyNG is installed on your Ubuntu installation, now let's install those drivers! In fact, only one is needed to make Assault Cube work: the only one proposed for ATI, and the latest from nVidia. So now, launch EnvyNG by browsing the 'Applications->System tools' menus, and click on EnvyNG (then enter admin/root password). Click on the left menu the graphical card you use (ATI or nVidia), and then install MANUALLY the driver (on nVidia, it may not work if you install all of the extra drivers, only the latest is needed. Note that if you are experiencing lag using this driver for nVidia, it would be wise to use the official nVidia installer. If your kernel is too new for the nVidia driver that it is attempting to install, it will either lag or just not work). You can see a screenshot here.


After installing the driver, your keyboard will be set as default mode: the US model. If you want to use AZERTY mode instead of QWERTY mode, you have to edit the xorg.conf file with the command:

Terminal Command
gksudo gedit /etc/X11/xorg.conf

When xorg.conf is open, modify the "InputDevice" Section as following: Before:

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"

After: (fr)

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
Option "XkbLayout" "fr" # fr ==> FRENCH

For a german keyboard layout that part of the file should look something like this: After: (de)

Section "InputDevice"
    Identifier     "Generic Keyboard"
    Driver         "kbd"
    Option         "XkbRules" "xorg"
    Option         "XkbModel" "pc105"
    Option         "XkbLayout" "de"
    Option         "XkbOptions" "lv3:ralt_switch"
EndSection

Then reboot your computer: you will see the nVidia start screen just before Ubuntu login prompt.

Desktop effects

You've installed the libraries, and updated your driver, however the game is still reluctant; when you launch AssaultCube, it always switches between fullscreen and windowed mode. This issue is caused by hooks that Compiz uses. Even if everything should be good to run properly AssaultCube, the Desktop Effects uses a portion of the GPU and desktop hooks which is also used by the game, and would cause it to lag and do other things, therefore, the only solution for it is to disable fancy Desktop Effects like Compiz and Beryl, if you are having these problems.

Desktop VS Game

While using your desktop you generally want to have mouse acceleration and the screensaver set to your desktop needs, while playing you'll want them both disabled. To make life easier you'll want some form of script to manage this. Not everyone will really need the screensaver bit, but it's been an issue for some, so it's included here too; the mouse acceleration is a really important bit though, often undererstimated by novices (either gaming or linux novice that is!).

The following script could be placed into /usr/local/bin/ as ac and assumes your game is installed into /opt/AC_v1.01 and if you symlink (ln -s) it as svnac will run the game from /usr/local/src/AC/trunk/ac .. you should adapt those strings to match your system, of course.

#!/bin/sh
# symlink svnac will call SVN-AC instead of AC
APPDIR=/opt/AC_v1.01
GUI=$(echo $0 | grep -c svnac)
if [ "$GUI" -eq "1" ]
then
	APPDIR=/usr/local/src/AC/trunk/ac/
fi
cd $APPDIR
xset m 0 0
xset s off
./assaultcube.sh $*
xset m default
xset s default

The really interesting bits are the lines with xset in them; the first line (respectively) handles the mouse part, the second line is responsible for the screensaver toggling.