Developing and Modding

Developing or modding Quetoo requires an understanding of the C programming language (specifically C99). To modify the rendering system, you should have some OpenGL 3.3 knowledge (See also the quick reference card and docs.gl). The following pages should get you started, but should you run into trouble, come find us on Discord.

Source Code and Dependencies

The Quetoo source code is available via Github. Checkout the source code to a directory you you wish to setup as your working copy:

All platforms

mkdir ~/Coding
cd ~/Coding
git clone https://github.com/jdolan/quetoo.git
git clone https://github.com/jdolan/quetoo-data.git --depth 1

Objectively & ObjectivelyMVC

Quetoo's user interface is built using Objectively and ObjectivelyMVC. These are relatively new libraries, and packaging for your operating system is not likely available. Unless otherwise written below, you should install these libraries from source by following the instructions on their respective Github project pages.

Windows

All dependencies, including Objectively and ObjectivelyMVC, are included in the packages or alongside the compiling instructions on the next page.

GNU/Linux

Ensure you have the following dependencies:

gcc, autoconf, automake, glib2, libcurl, libsdl2, libsdl2-image, libsdl2-mixer, libtool, Objectively, ObjectivelyMVC, physfs

Ubuntu 12.04:

sudo apt-get install autoconf automake libtool libcurl4-openssl-dev \
    libphysfs-dev libsdl2-image-dev libsdl2-mixer-dev check

Fedora 18:

sudo yum -y groupinstall development
sudo yum -y install libcurl-devel libjpeg-devel physfs-devel \
    SDL2-devel SDL2_image-devel SDL2_mixer-devel zlib-devel glib2-devel check

Mac OS X

Install MacPorts by downloading the latest .dmg file from the MacPorts site. Prerequisites for MacPorts include XCode and X11, and you should have both before proceeding.

Install Autotools, glib2, libsdl2_image, libsdl2_mixer and physfs through ports:

sudo port -d selfupdate
sudo port install autoconf automake glib2 libtool libsdl2_image libsdl2_mixer physfs pkgconfig check

Compiling

With the dependencies installed, compiling Quetoo is very easy.

Windows

Create a blank folder, and inside that folder, checkout Objectively, ObjectivelyMVC and quetoo (optionally quetoo-data) into their own folders, with their respective names. The following batch file, ran inside an empty folder, will do this (leave the last one out if you don't want the data):

git clone https://github.com/jdolan/Objectively.git
git clone https://github.com/jdolan/ObjectivelyMVC.git
git clone https://github.com/jdolan/quetoo.git
git clone https://github.com/jdolan/quetoo-data.git --depth 1

After that, head to quetoo\Quetoo.vs15 and run SET_ENV.ps1. You will be prompted to enter a folder that you will store your output binaries into, such as C:\quetoo\. This is where binaries will be automatically copied to on builds, and where debuggers will be by default set up to load from.

If you are checking out the data too, you should also run MAKE_DATA_JUNCTION.ps1 which will automatically set up a junction in c:\quetoo\share\default to the quetoo-data\target\ folder.

Open quetoo_all.sln, pick your Configuration/Platform, and build!

Unix/Mac/Mingw

If you've compiled anything that uses Autotools, this will look familiar to you:

autoreconf -i
./configure [--with-tests] [--without-tools]
make -j5
sudo make install

If you also checked out the game data from Git, you may "install" it by simply creating a symlink to it:

ln -s ~/Coding/quetoo-data/target /usr/local/share/quetoo

And finally, you may run the game:

quetoo

Eclipse & Xcode

We recommend using Eclipse or Xcode for hacking on Quetoo. Project files and formatting rules for C source code are maintained in Git.

To import your working copy into Eclipse, select Import Existing Projects into Workspace from the File and Import menus, and browse to the trunk folder. Similarly, you can import the Quetoo data working copy into Eclipse as well for convenient editing of material files and other scripts.

You may also wish to install the EGit team provider for Git integration, and the glshaders plugin for GLSL syntax highlighting.

Running and debugging Quetoo through Eclipse is possible and works quite well.

Debugging

For debugging Quetoo , launch the game in gdb either at the command line, or through Eclipse. Be sure that you start the game in windowed mode so that you can interact with gdb when you reach a break-point.

If developing on OS X, open quetoo.xcworkspace in Xcode, and run the game through Xcode. Xcode's lldb debugger works wonderfully with Quetoo. OS X will correctly make Xcode the active window when breakpoints are hit, so you can debug the game while running it in fullscreen mode.