Build Instructions
From DungeonHack
These are the current instructions for building DungeonHack from source. Currently it builds on Windows and GNU/Linux. We would like to support Mac OS X as well and it should be fairly simple (i.e.: trivial code changes), but currently lack anyone to maintain compatibility (please contact us if interested).
Unless you are really interested in contributing code, you should probably grab a release binary instead.
If, however, you are interested in aiding development, feel free to report your compiling experiences on the forum also with the configuration of your system (compiler, library versions, and so on).
Contents |
Building DungeonHack in Visual Studio 2008 (Windows)
Required Tools:
- Visual Studio 2008 or Visual C++ 2008 Express, with SP1
- Latest Windows Platform SDK (normally included on latest VC Express editions)
- CMake Utility
- Ogre SDK >= 1.6 (svn, DH 0.10 uses Ogre 1.4)
- MyGUI 2.2.3 or MyGUI r1861 SDK (more user-friendly, though a bit old)
- Bullet Physics >=2.74
- Python =2.6.x run installer, no setup required.
- ALURE >=1.0
- libogg/libvorbis - needed for ALURE
- OpenAL or OpenAL Soft
- Paged Geometry r2698
- yaml-cpp >=0.2.2 (svn only)
- SWIG (svn only)
Installing OGRE
1) Download the latest 1.4 release of OGRE from http://www.ogre3d.org. Download the pre-built SDK for Visual Studio 2008
2) Run the provided installer and select an install directory for the SDK (e.g. C:\Code\OgreSDK)
3) Set the environment variable OGRE_HOME to the directory you installed OGRE to (e.g. C:\Code\OgreSDK)
Note: it is also possible to use the Ogre source, but be careful about the paths which are different (not the same tree). In this case the environment variable is OGRE_SRC. Cases have been noted in which Windows users need to compile OIS.DLL (possibly other DLLs) from the Ogre 1.4.9 even if using the SDK (this may be related to using the VS2008 Express compiler, as Ogre was compiled with VS2005)
Building MyGUI
TODO: We recently updated to MyGUI 2.2.3, detailed instructions forthcoming
1) Check out the source from the repository at the given revision: svn co -r 1861 https://my-gui.svn.sourceforge.net/svnroot/my-gui/trunk mygui
2) MyGUI required Freetype2 (http://sourceforge.net/project/showfiles.php?group_id=3157). Build the project in freetype/builds/win32/visualc. This will create a lib file in the objs directory of freetype. MyGUI is set up to use freetype235.lib or freetype235_D.lib you'll need to rename the lib(s) if not using freetype 2.35. (2.38 works fine.)
3) Open the MyGUI_v8 solution file. You may have build errors if you don't specify locations of Ogre and Freetype. To do this, open Project Properties / Configuration Properties. under C++, General, 'Additional Include Directories', add ;c:\ogresdk\include;c:\freetype\include to the end. Under Linker, General, 'Additional Library Directories' add ;c:\ogresdk\lib;c:\freetype\objs. Substitute your own ogre and freetype paths both times. Now build the solution.
5) Inside the MyGUI directory, copy the include directory under MyGUIEngine/ to your Ogre include directory, e.g.: OgreSDK/include/. Now rename the MyGUI include directory to MYGUI. So, you should have something that looks like this: OgreSDK/include/MYGUI/.
6) Now copy the libs under MyGUIEngine/lib/ to OgreSDK/lib/. This portion should now be ready to compile.
Building Bullet SDK
1) Download latest sources (2.74) from Google code: http://code.google.com/p/bullet/downloads/list
2) Unpack the archive to a dedicated directory (i.e. C:\Runtime\Bullet), then open a command prompt, go into the new directory and run CMake. For Visual C 2009 this is
cmake -G "Visual Studio 9 2008"
3) Open the ALL_BUILD.vcproj file, build the whole project, then copy generated libs (BulletCollision.lib, BulletDynamics.lib, LinearMath.lib) into "lib" folder. By default I use Debug mode but you can also use the Release ones. Both of them are located into "src/module/Debug|Release" subdirectory (where module is the name of the library).
4) Set the BULLET_HOME environment variable to the location where you installed Bullet.
Building OpenAL
1) Install the OpenAL11CoreSDK.exe file, using the defaults should be fine. Just take note of the path you install it to because you will need to create an environment variable called OPENALDIR which points to the install dir. This is usually "C:\Program Files\OpenAL 1.1 SDK". Even though some parts of CMake will detect the OpenAL in the default installation folder, the environment variable is required.
Building ALURE
Note: The win32 bin file that is on the site doesn't actually come with the necessary lib file, you will have to build it from the source.
1) Download and extract the Alure source archive to a folder of your choice.
2) Open a command prompt and navigate to the folder and run CMake. For Visual C 2009 this is
cmake -G "Visual Studio 9 2008"
3) Open the generated ALURE.sln file in Visual Studio and build the release version.
4) The DungeonHack CMake files use the binary release file structure, which is different than the source that you just downloaded. Next I recommend download and extract the binary version of Alure, then copy your built ALURE32.lib into the /lib/WIN32 folder.
5) Create an environment variable pointing to the binary folder that you created called ALUREDIR
Section TODO: libvorbis/libogg instructions.
Building yaml-cpp
1) Download and extract.
2) Open yamlcpp.sln and build.
3) Create an environment variable pointing to your yaml-cpp folder called YAMLCPPDIR
Installing SWIG
1) Download the latest version of swigwin.
2) Extract the contents of the zip somewhere.
3) Add the path to the extracted SWIG directory to your PATH environment variable. You will need to restart any shell (and Visual Studio) that you are using before it becomes available.
Building DungeonHack
1) Download the latest DH source. See http://sourceforge.net/svn/?group_id=224792 for Subversion information.
In most cases you will want to use the following root: https://dungeonhack.svn.sourceforge.net/svnroot/dungeonhack/trunk/dungeonhack
2) Open a Visual Studio Command Prompt and go to the DH location. Invoke CMake with the batch file "build_vc9_projects.bat". If you receive any errors about missing packages, make sure you correctly set the OGRE_HOME, BULLET_HOME, OPENALDIR, and ALUREDIR environment variables.
3) Open the DH.sln generated and rebuild the solution. If you receive any errors about missing headers or libraries, make sure the makefile was correctly generated (you can force by removing CMakeCache.txt and invoking the batch file again). Windows can also be strange with environment variables sometimes, so make sure you've closed and re-opened Visual Studio and/or the Command Prompt. If all else fails, reboot to force a fresh environment to the shell.
Building DungeonHack on Linux
Required Dependencies:
- Ogre >=1.6 (svn, DH 0.10 uses Ogre 1.4)
- CMake >=2.4.7
- OIS 1.2
- Bullet >=2.74
- Python =2.6.x
- MyGUI 2.2.3
- ALURE >=1.0
- OpenAL or OpenAL Soft
- libvorbis
- Paged Geometry r2698
- yaml-cpp >=0.2.2 (svn only)
- SWIG (svn only)
Your distribution should have most of these in its package repository. Some earlier or later versions may work, however the versions listed are the ones known to work. Instructions for compiling and installing some uncommon libraries or plugins are listed below.
Building Alure
1) Download Alure.
2) Extract the alure-1.0-src.tar.bz2 archive.
3) To build, in the root folder cmake . && make
4) To install, in the root folder sudo make install
Building Bullet
1) Download Bullet-2.74.
2) Unpack the file. In a terminal move to the the Bullet-2.74 folder .
3) To build use cmake . -DBUILD_DEMOS=OFF -DBUILD_EXTRAS=OFF && make.
4) To install sudo make install.
Building OIS
1) Download OIS_1.2.0.
2) Extract the ois_1.2.0.tar.gz archive.
3) To build, in the root directory ois && ./bootstrap && ./configure && make
4) To install, in the root directory sudo make install
Building Paged Geometry
1) Check out the source from the repository at the given revision: svn co -r 2698 https://ogreaddons.svn.sourceforge.net/svnroot/ogreaddons/trunk/forests pagedgeometry
2) Run cmake . && make
3) Once the build has finished, as root make the directory /usr/include/OGRE/PagedGeometry and copy the header files from include there, e.g.: cp -rp include/*.h /usr/include/OGRE/PagedGeometry/ Or do this wherever you have your OGRE includes installed.
4) Now copy source/libPagedGeometry.so to /usr/lib/OGRE/. Or copy it to wherever your OGRE plugins are installed.
Building yaml-cpp (svn only)
1) Download yaml-cpp and extract.
2) Run cmake . && make
3) Run make install
Building DungeonHack
1) Download the latest DH source. See http://sourceforge.net/svn/?group_id=224792 for Subversion information. In general, you can use the following command to pull the latest development version of DH:
svn co https://dungeonhack.svn.sourceforge.net/svnroot/dungeonhack/trunk/dungeonhack dungeonhack
2) In the root directory of your checkout, execute: cmake .
3) If all went well, you can now execute: make
4) After the compilation process, run ./dungeon_hack to run the game
Building in Ubuntu
Ubuntu is a Debian based distribution, therefore a lot of the information should be applicable to other Debian based distro's
You may also wish to try some unofficial alternative packages with various improvements over the vanilla packages (including CG support and MyGUI).
(These instructions were most recently tested on Ubuntu 9.10 Karmic Koala)
Repository Dependencies
Start by getting some packages from the repositories. To get them open a terminal and paste
sudo apt-get install \ build-essential libopenal-dev cmake libogremain-1.6.1 \ libogre-dev libvorbis-dev freeglut3-dev libglu1-mesa-dev \ subversion automake checkinstall libtool autoconf2.13 python-dev
If you have conflicting packages you can probably keep the ones you have installed.
Building
Soon we hope to have dependencies packaged for ubuntu, but for now you need to build and install the following
CGProgramManager_Plugin
1) Grab the Debian package from this page. packages can be found in the bottom left hand corner.
2) once downloaded this package should run, all you have to do is push install. Alternatively, open a command prompt and cd to where you downloaded the .deb, and type sudo dpkg -i ogre-plugins-cgprogrammanager*.deb
3) If the install process complains of missing dependencies, make sure you have installed your graphics drivers. If not, go to System->Preferences->Hardware Drivers and install the recommended driver for your system.
Back to Game Development Information

