This page explains the steps required if you wish to compile the game and/or editor from the source code. This page assumes that you already have the appropriate source downloaded and does not describe that process. Refer to either Mercurial Repository for how to grab the absolute latest source, or Download Instructions to download the latest source release package. Both the allacrost game and map editor are built using the Cmake build system. If you wish to use an alternative system, such as VisualStudio, you will need to create those build configurations yourself. If you run into issues and can't get the compilation to succeed, head over to the Technical Issues forum. There is a thread stickied there to report compilation issues, and you may find your answers already posted.
|Note: Eventually we desire cmake to be the build system of choice for each major platform (Linux, OS X, Windows). For now, cmake is only tested and working on Linux.|
Each major operating system (Linux, OS X, Windows) uses a different procedure to compile the game.
CMake Build Instructions
Before you begin, refer to the Library Dependencies page and make sure that your system has all of the necessary libraries installed (the build process will warn you if you're missing a required library). Install the latest version of cmake available for your system (hopefully 3.5 or later). You will need both the run-time libraries and the development libraries for each dependency. For example, in Ubuntu there is a libsdl2 package as well as a libsdl2-dev package for the SDL2 library. Note that you do not need to install the Luabind library, as that library is included and compiled automatically along with the Allacrost source code.
1) In your terminal, change the current directory to the location where you downloaded the source code to. 2) Run ./build.sh. Compilation will begin as long as all library dependencies were found and will take several minutes 3) Run ./allacrost to start the game, or ./allacrost-editor to start the map editor
Here are some additional tips:
- To see all build options, run ./build.sh help
- To disabling building the map editor, which otherwise requires the QT5 library on your system, run the build script with the -DEDITOR=false option
- After building is complete, you can run ./build.sh install to install the application on your system. This is not advised if you retrieved the source via the code repository. Instal from an official packaged release instead.
- When running allacrost, you can add a debug option so that the game will print various warnings and other information to the screen as it runs. <t>-d all</tt> is most common and prints out all debugging information, but you can also enable debugging for only specific components, such as -d audio or --debug battle. -d and --debug are equivalent.
- When running allacrost, you can start the game directly in the developer's test menu. Use the -t or --test option. The test menu allows you to quickly jump between different maps, battles, and other modes found in the game.
You will need the Code::Blocks IDE set up with a working MinGW installation. The version of MinGW that comes bundled with the IDE may or may not work, but anything version 4.4 or later should work fine. Follow the steps below to get a working build.
- Download and install the latest Code::Blocks IDE
- If not using the MinGW bundled with the IDE, you must install MinGW on your system. Make sure to select all the standard C++ libraries in the installer.
- Grab a copy of the game's source code, either through the Mercurial repository or a release package.
- Go to the location on your system where you downloaded or unpackaged the code. In the "lib/" directory you should see a win32.zip file. Extract the contents of that file to the current directory (which will make paths like lib/win32/include, lib/win32/lib, etc)
- Open the "Allacrost.cbp" file to open the Hero of Allacrost project in Code::Blocks. Select your build target (release or debug) and then select the Build command. For clean builds, this will take several minutes to complete.
- If all went well and there were no errors, you should now have a allacrost.exe or allacrost-debug.exe file depending on the build target that you selected
- Copy all DLL files from lib/win32/lib/ to the directory containing the .exe. Otherwise the application will not be able to find the DLL when you execute it.
OS X Instructions
Allacrost uses XCode for building on OS X, and the official XCode project file is in the mercurial repository. In order to properly use it you will need the OS X Allacrost dependency package, which can be found here. Take the folder allacrost-dep/ in this archive and put it in the same directory that contains the directory of your working copy of the Allacrost code. For example, if your working copy of the Allacrost code is in a directory called demo/, then put allacrost-dep/ at the same level of hierarchy as demo/.
All libraries found in allacrost-dep/lib are universal.
All binaries found in allacrost-dep/bin are universal.
No initial modifications on your part should be necessary. Building and running the Allacrost executable from within the XCode project file should work right away. If not, double-check the Build Settings. There are some variables in the project file that may depend on your OS version (i.e. 10.7, etc). Depending on what you have, you may need to modify these appropriately. Select the Allacrost target, and select the Build Settings tab. Double-check the following variables: