Host your own QuakeJS server on ArchLinux
Recently I discovered a very old project on Github which is somehow still actively maintained. It is a Javascript/WebGL port of the good old game Quake 3 Arena, called QuakeJS. This port in turn is based on the open-source, community game engine ioQuake.
Even though there is a nice and working demo instance hosted on Quakejs.com, it is still relatively difficult to host everything on your own since the setup requires different components to be configured. Therefore a wrote a small package on the AUR for Archlinux simplify the process. Instead of following the more or less incomplete instructions on the project repository, simply run following commands to install and run the dedicated-, content- and game-server:
pacman -S quakejs-git
cd /usr/share/webapps/quakejs
chown -R quakejs:quakejs .
sudo -u quakejs node build/ioq3ded.js +set fs_game baseq3 +set dedicated 2
After the last command, you’ll have to accept the EULA (keep pressing return and press Y (yes)) and the program will start to download demo game fiels from the default content server. After that, you can quit the dedicated server agin.
Dedicated server
If you want to start your own dedicated server, just run the provided service:
systemctl start quakejs-ds
Modify the file /etc/conf.d/quakejs
to change the default start parameters, for example if you want to announce your server to the master server (making it public visible) or which game mod you want to run. To change ingame specific settings, for example map cycle, timelimit, etc., adapt /usr/share/webapps/quakejs/base/baseq3/server.cfg
to your needs.
The dedicated server will listen on the port HOSTIP:27960
and you can already join the game with this URL: http://www.quakejs.com/play?connect%20HOSTIP:27960
.
Game server
The game server will host QuakeJS itself and could also run without any modifications with the default content server of QuakeJS.com. My package also provides a service file for this one, so you just have to run:
systemctl start quakejs
Go ahead and visit http://HOSTIP:8080
on your browser to see it in action. Change the content server (for example if you planning to host your own) and default listening port in the following file:
{
"content": "content.quakejs.com",
"port": 8080
}
Content server
The content server will provide the game files (maps, models, etc.) and will serve them on-demand to the game instance. Just run following command and the content server will start listening on http://HOSTIP:9000
:
systemctl start quakejs-cdn
Also provide a reference to your new content server into the configuration of your dedicated server:
QUAKEJS_DS_PARAMS="+set fs_cdn cdn.quake.turbotux.de +set fs_game baseq3 +set dedicated 1 +exec server.cfg"
I still got a copy of the full game on my home server, so I could use these game files to get more maps and game models:
cp -r /PATH/TO/QUAKE3/base/baseq3/. /usr/share/webapps/quakejs/base/baseq3/
cp -r /PATH/TO/QUAKE3/base/baseq3/. /usr/share/webapps/quakejs/assets/
systemctl restart quakejs-ds quakejs-cdn
I still have to solve some packaging and usage issues with this. For example it still seems to be tricky to run everything with SSL enabled, the repackaging script seems to be broken and I’m unable to symlink the game files to /var/lib/quakejs
which would be more UNIX-conform. Nevertheless happy fragging :)