sudo apt-get install libsvga1-dev x11proto-xf86dga-dev x11proto-xext-dev libxext-dev libxxf86dga-dev libxxf86vm-devDownload the latest source file here, and unpack it with this command:
tar xvfz quake2ai*.tar.gzTo compile it, do:
pushd quake2ai makeThis will create a sub-directory called release[ARCH] in your quake2ai directory, where [ARCH]i386 or x86_64. (Hopefully you are using i386 since graphics don't work in x86_64; if you are using 64-bit linux then you must make a 32-bit chroot environment to compile it. Once it is compiled you can use the 32-bit binary in a 64 bit environment.)
Inside that directory there will file named quake2ai.so, which is the AI interface library that allows running the game in Quake2AI mode. There is also a quake2 executable program.
Make the directory on your system:
mkdir ~/qtestNow copy the baseq2 directory from the Quake II media into ~/qtest:
cp -r baseq2 ~/qtestNow, from the quake2ai directory where you compiled the program and library, do:
./install ~/qtestThis will copy all the essential Quake2AI files to ~/qtest.
To test your installation, do:
pushd ~/qtest ./quake2and you should get a running program. However, you have not created the actual AI for your bot yet.
Make a file called testbot.c with this C code:
#include "quake2ai.h" void AImain() { AIself_yawmove(1.0); return; } int main () { quake2ai_setargs("+set name Bill"); quake2ai_launch (); return 0; }Compile testbot:
gcc -o testbot testbot.c ./libquake2ai.so -lmRun the testbot:
./testbotIf you go to the single-player game (in Quake II) your bot will be visible, spinning slowly to the left due to the AIself_yawmove(1.0) line in the program.