Assault Cube server on Raspberry Pi
Today I have a really funny thing! An Open Source First Person Shooter for all Counter Strike Fans. I will show you how to install and configure an Assault Cube Server on your Raspberry Pi. Assault Cube? Yes, this is an Open Source Counter Strike that is really funny to play and it works on your Raspberry Pi. It runs very smoothly and fast, so it is possible to host a multiplayer game for a LAN party on Raspberry Pi (or use it in your local network for example school or so…)
Installation
For the installation you should create a new directory at the home folder on your Raspberry Pi (/home/pi):
mkdir assault; cd assault
Now we need to get the code. For this we will install the Linux version of the game (for all assets) and the source code. The source code is needed, because we need to recompile the server for the ARM architecture of your Raspberry Pi. For this tutorial I use version 1.1.0.4 of the game (there is already version 1.2 available, but the older version is more common at the moment). So first we need to get the Linux code:
wget http://http://sourceforge.net/projects/actiongame/files/AssaultCube%20Version%201.1.0.4/AssaultCube_v1.1.0.4.tar.bz2
and then the source code:
wget http://http://sourceforge.net/projects/actiongame/files/AssaultCube%20Version%201.1.0.4/AssaultCube_v1.1.0.4_source.tar.bz2
You will find two packed files in your assault directory. We need to unpack them. This code will be unpacked into a directory calles 1.1.0.4. I will separate the two packages into directories called ‚ac‘ and for the source code ’source‘:
tar -xvf AssaultCube_v1.1.0.4.tar.bz2 mv 1.1.0.4 ac tar -xvf AssaultCube_v1.1.0.4_source.tar.bz2 mv 1.1.0.4 source
compile the server
Everything is ready now to compile the server for the ARM architecture. Don’t panic, that is not that complicated! You only have to type in some commands and to be patient. First thing is to change the current directory:
cd /home/pi/assault/source/source/enet
The following things need to be done to compile the server:
sudo sh ./configure -build=x86-linux -host=arm-unknown-linux-gnueabi sudo make clean && sudo make && sudo make install
After some time, you get back the command prompt, compilation has finished (hopefully without errors). The last thing is to create the server programm:
cd /home/pi/assault/source/ mkdir bin_unix cd bin_unix mkdir native_server cd /home/pi/assault/source/source/src sudo make server_install
The server is ready! You can’t execute it, because we need to copy the program file to the Linux program data of the Assault Cube game. For this we copy the server file:
cp -R /home/pi/assault/source/bin_unix/native_server/ac_server /home/pi/assault/ac/bin_unix/native_server
We will also need a library file to run the server, so we create a link to it:
sudo ln -s /usr/local/lib/libenet.so.1.0.0 /use/lib/libenet.so.1
That’s it! We change the current directory to the game directory and start the Assault Cube server with the following command:
sh server.sh
You can watch the debug output. My server tried to connect to a meta server, which failed. That was no problem, it was possible to play a LAN game.
Hi Werner. How many people do you think it would be able to handle?
Unforuntaely this line
cp -R /home/pi/assault/source/bin_unix/native_server/ac_server /home/pi/assault/ac/bin_unix/native_server
And this line
sudo ln -s /usr/local/lib/libenet.so.1.0.0 /use/lib/libenet.so.1
… Both bring up „No such file or directory“
Are they correct?
Hi, check if compilation fails, because first file is created during compilation. The lib may not be installed or in a different version. For both lines, also check the directory, if you may installed it into a different one. On linux you can also use the find -name command to search for those files.
sudo ln -s /usr/local/lib/libenet.so.1.0.0 /usr/lib/libenet.so.1
can you post the sd card image you make with the server for assault cube? i`m very novice into making this my own
I get the following when I try to compile, can you please help me with this
$ sudo sh ./configure -build=x86-linux -host=arm-unknown-linux-gnueabi
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for arm-unknown-linux-gnueabi-strip… no
checking for strip… strip
configure: WARNING: using cross tools not prefixed with host triplet
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… no
checking for mawk… mawk
checking whether make sets $(MAKE)… yes
checking whether to disable maintainer-specific portions of Makefiles… yes
checking for arm-unknown-linux-gnueabi-gcc… no
checking for gcc… gcc
checking whether the C compiler works… no
configure: error: in `/home/pi/assault/source/source/enet‘:
configure: error: C compiler cannot create executables
See `config.log‘ for more details.
I am using a raspberry pi 2 if that might be the problem.
My current gcc version is 4.6.3 in case that could be an issue
Everything works fantastic EXCEPT for the server.sh script. For some reason, it can’t connect to assault.cubers.net. It’s definitely connected to the internet (headless SSH) and I can open the AC webpage on Chromium. What did I do wrong?
Using a RPi3 with the latest version of Raspbian Jessie. Pretty much vanilla.