How to compile: Difference between revisions

From The Cataclysm: Dark Days Ahead Wiki
Jump to navigation Jump to search
(→‎Ubuntu: put in more logical order)
(→‎Mac: added piece about how to get how to get prebuilt and whats up-to-date)
 
(41 intermediate revisions by 16 users not shown)
Line 1: Line 1:
{{tocr}}
'''Guide created using an unknown version of Cataclysm DDA.'''
== Windows ==
The information present here might not apply to the current version of CDDA.
There are a few ways to run Cataclysm-DDA in Windows. The '''recommended''' way to compile cataclysm on windows is MinGW, as the Makefile is more likely to be updated than the CodeBlocks and VisualStudio project files. (Note: You can set up CodeBlocks to use the Makefile, instructions to do this may follow later)
{{ver|unknown}}


{{delete|Wiki may not be the best place for installation details}}


=== MinGW with MSYS ===
For experimental version compilation instructions, see [https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/COMPILING/COMPILING.md /doc/COMPILING/COMPILING.md].


First you need to [http://www.mingw.org/download/installer download and install MinGW and MSYS].
{{tocr}}
 
== Windows ==
In the installer, choose your preferred location (a path without spaces is recommended both for MinGW and CDDA).
<br />All the other options can be left at their default.
 
Once installed, <code>mingw-get-gui</code> will open, which will allow you to install and uninstall programs and libraries.
<br />In ''"Basic Setup"'', mark <code>mingw-developer-toolkit</code>, <code>mingw32-base</code> and <code>mingw32-gcc-g++</code> for installation by left-click the checkboxes.
<br />Then install these components using ''"Installation -> Apply Changes"''.
 
http://i.imgur.com/XmuWAMA.png
 
Furthermore, we will need gettext and libintl. In "All Packages -> MinGW -> MinGW Autotools" ensure that mingw32-gettext and mingw32-libintl are installed.
 
Optionally, when compiling with TILES or LUA support, Cataclysm DDA will also need these libraries:
* [http://www.libsdl.org/ SDL 2.0]
* [https://www.libsdl.org/projects/SDL_ttf/ SDL_ttf]
* [https://www.libsdl.org/projects/SDL_image/ SDL_image]
* libfreetype, libjpeg, libpng(included in the above SDL downloads)
* [http://www.lua.org/download.html lua 5.1]
 
You can find a prepackaged version of these libraries here: http://46.102.243.119/public/CDDA-deps.zip Simply unzip this archive into your MinGW root directory.
 
==== Fixing the Makefile ====
 
The Makefile currently tries to produce a static build. This means that no .dll's are required to run the game. However, this doesn't work with the MinGW release of SDL_ttf and SDL_image, which ship with .dll's.
 
Open CDDA/Makefile in a text editor(e.g. notepad++) and look for the line "LDFLAGS += -static". Replace this line with the following and save the file: "LDFLAGS += -static-libgcc -static-libstdc++"
 
==== Compile ====
Once you have MinGW and all Cataclysm dependencies properly installed:
 
# Ensure you have downloaded the Cataclysm DDA source code.
# Navigate to <code>MinGW/msys/1.0/</code> and start <code>msys.bat</code>.
# Add the MinGW toolchain to your <code>PATH</code> with <code>export PATH=$PATH:/c/MinGW/bin</code>. Replace <code>/c/MinGW/</code> with the directory into which you installed MinGW (<code>/c/</code> stands for drive <code>C:</code>, so if it's in <code>F:/foo/bar</code>, you'd use <code>/f/foo/bar</code>).
# Navigate to the CDDA source code directory using <code>cd /c/Users/blub/CDDA</code>, again, replace <code>/c/Users/blub/CDDA</code> with the path where you extracted it.
# Compile using <code>make TILES=1 NATIVE=win32</code> and unless there are problems, it should produce a CDDA binary for you.
# Copy the .dll's in the "bin" directory in CDDA-deps.zip into your CDDA directory.
 
=== Cygwin ===
'''Cygwin is not currently compatible with SDL 1.2 and therefore is unable to do TILES builds.'''


Start off by downloading cygwin from the [http://www.cygwin.com/ official site].
=== Getting the game sources ===
Follow the download instructions on the site, and select all of the following packages when prompted to:
* make
* G++
* libncurses-dev
* libncursesw-dev
* libiconv
* libintl
* gettext
* git


==== Compile ====
* Get Git for Windows from [https://git-for-windows.github.io git-for-windows.github.io] and install it.
Once it's finished installing, run the program which should open a terminal window, from there, type:
* Run "Git Bash" from Start Menu
* Go to directory where you want the copy of the game with ''cd'', for example ''cd d:/games/dda''
* Run ''git clone https://github.com/CleverRaven/Cataclysm-DDA.git''


# clone the repository
=== CodeBlocks + MinGW ===
git clone <nowiki>git://github.com/CleverRaven/Cataclysm-DDA.git</nowiki>
* [http://www.codeblocks.org/downloads/binaries Download and install Code::Blocks, get the version with MinGW].
* Get the current git code using the steps discussed in the section above
# once downloaded, get into the source directory
cd cataclysm-dda
# start compiling
make
# run the fresh executable
./cataclysm
 
==== Update ====
To update to the latest repository version, open the source directory and type:
 
# get into the source directory
cd cataclysm-dda
# update the source code to the lastest version
git pull
# purge unnecessary files
make clean
# recompile
make
# run the fresh executable
./cataclysm
 
===Code::Blocks===
* [http://www.codeblocks.org/downloads/26 Download and install Code::Blocks].
* Get the current git code using the steps discussed in the MinGW section above
* Load the codeblocks project.
* Load the codeblocks project.
* Press "build and run the active project" in the Code::blocks program.
* Press "build and run the active project" in the Code::blocks program.
Line 99: Line 25:
Note: Sometimes Code::Blocks project file may be outdated, so check if all .cpp and .h files from the source folder are listed in your project.
Note: Sometimes Code::Blocks project file may be outdated, so check if all .cpp and .h files from the source folder are listed in your project.


For help building the tiles/SDL version, see these comments:
For help building the tiles/SDL version, see these forum topics:
* [http://smf.cataclysmdda.com/index.php?topic=3725.msg54019#msg54019 Forum Post in Topic "Compiling SDL version"]
* [https://discourse.cataclysmdda.org/t/compiling-sdl-version/1747 Forum Post in Topic "Compiling SDL version"]
* [http://smf.cataclysmdda.com/index.php?topic=1807.msg22249#msg22249 Forum Post in Topic "How do I Compile DDA with the Tilesets Working?"]
* [https://discourse.cataclysmdda.org/t/how-do-i-compile-dda-with-the-tilesets-working/3508 Forum Post in Topic "How do I Compile DDA with the Tilesets Working?"]
 
===Fighting with libintl_gettext errors===
General advices include:
*go to [http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/ http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/]
*get the [http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip gettext-runtime] and [http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-dev_0.18.1.1-2_win32.zip gettext-runtime-dev] (the latest versions). Extract them to a folder somewhere.
*Point you library path to the \lib folder and your include path to the \include folder. For Code::Blocks right click on your project in the project tree and choose "Build options". Open "Linker" tab and add path to libintl.lib (with the file!) from gettext-runtime-dev.
*Place the .dll files into the same directory you create your Cataclysm.exe file in. You'll need intl.dll (not found in gettext-runtime-dev, download separately) and libintl.dll (found in gettext-runtime-dev).
 
===Visual C++ 2010===
* If you don't already have Visual C++ 2010, download and install the [http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express Express] edition.
* Get the current git code using the steps discussed in the MinGW section above.
* Browse to the "msvc100" directory and open Cataclysm.sln.
* Select the "Release" configuration and choose your architecture ("Win32" or "x64").
* Press the "Build Solution" toolbar button (or press F7).
* Browse to the appropriate output directory and copy Cataclysm.exe into the base directory.


== Linux ==
== Linux ==
 
For further information, please see [https://github.com/CleverRaven/Cataclysm-DDA/blob/master/COMPILING.md COMPILING.md] for up to date instructions.
Compilation instructions differ by distribution.
Compilation instructions may differ by distribution.


Get your friendly command-line terminal pumped and ready, grab some curdled popcorn, and pull up a mouldering chair.
Get your friendly command-line terminal pumped and ready, grab some curdled popcorn, and pull up a mouldering chair.
Line 140: Line 51:
<li>Unmask <tt>cataclysm-dda</tt> by adding the following line to <tt>/etc/portage/package.accept_keywords</tt>.</li>
<li>Unmask <tt>cataclysm-dda</tt> by adding the following line to <tt>/etc/portage/package.accept_keywords</tt>.</li>
<pre>>=games-roguelike/cataclysm-dda-0.4</pre>
<pre>>=games-roguelike/cataclysm-dda-0.4</pre>
<li>Enable USE flags "<tt>ncurses</tt>" (installing an ncurses-based terminal interface) <i>and/or</i> "<tt>sdl</tt>" (installing an SDL-based tiles interface) by adding a line like the following to <tt>/etc/portage/package.use</tt>. (You probably want both as well as a Lua interpreter, so we default to that.)</li>
<li>Enable USE flags "<tt>ncurses</tt>" (installing an ncurses-based terminal interface) <i>and/or</i> "<tt>sdl</tt>" (installing an SDL-based tiles interface) by adding a line like the following to <tt>/etc/portage/package.use</tt>. (You probably want both as well as a Lua interpreter, so we default to that. NOTE: Lua appeared in 0.D Danny and disappeared in 0.E Ellison)</li>
<pre>games-roguelike/cataclysm-dda lua ncurses sdl</pre>
<pre>games-roguelike/cataclysm-dda lua ncurses sdl</pre>
<li>Emerge <tt>cataclysm-dda</tt>.</li>
<li>Emerge <tt>cataclysm-dda</tt>.</li>
Line 155: Line 66:
(A <tt>rehash</tt> may be required.)
(A <tt>rehash</tt> may be required.)


[https://github.com/leycec/raiagent raiagent] also offers a live ebuild installing the most recent ''Cataclysm: DDA'' commit. Since such commits tend to be of "dubious stability," this ebuild is currently hard-masked. To unmask it, add the following line to <tt>/etc/portage/package.unmask</tt>:
[https://github.com/leycec/raiagent raiagent] also offers a live ebuild installing the most recent ''Cataclysm: DDA'' commit. Since such commits tend to be of "dubious stability," this ebuild is currently hard-masked with empty <tt>KEYWORDS</tt>. To unmask it, add the following line to <tt>/etc/portage/package.accept_keywords</tt>:
<pre>~games-roguelike/cataclysm-dda-9999</pre>
<pre>~games-roguelike/cataclysm-dda-9999 **</pre>


''"Give 'em hell, kid."''
''"Give 'em hell, kid."''
Line 178: Line 89:
=== Ubuntu ===
=== Ubuntu ===


First, open the terminal. On Ubuntu, it is accessible under Applications / Accessories. First we'll need to install git. You'll probably need to type in your password and maybe Y to confirm.
(NOTE: these instructions should work for ''all'' Debian based distributions too, inlc. RaspberryPiOS - 2022)
 
First, open the terminal. On Ubuntu, you can find it by typing 'Terminal' into the dash and.


sudo apt-get install git-core
In order to download the latest version of Cataclysm:DDA, we will need to install ''git''. You'll probably need to type in your password.


Now to pull the source. You're likely in your "home" or "root" directory in the terminal. You can use ''ls'' to list the directories and ''cd'' to move into them.
sudo apt-get install git
Once you are where you want the source to be, type:
 
Now to pull the source. You're likely in your "home" or "root" directory in the terminal. You can use ''ls'' to list the directories and ''cd'' to move into them. Move onto the directory where you want your game to be installed then proceed:
  git clone <nowiki>git://github.com/CleverRaven/Cataclysm-DDA.git</nowiki>
  git clone <nowiki>git://github.com/CleverRaven/Cataclysm-DDA.git</nowiki>
This'll make a directory called Cataclysm-DDA and pull the source into it. It might take a while.
This'll make a directory called Cataclysm-DDA and pull the source into it. It might take a while.


Type ''cd Cataclysm-DDA'' to move into the directory.
To move into the directory, type:
 
cd Cataclysm-DDA
 
 
==== ncurses (terminal) ====


To compile the terminal version you'll need to install some dependencies:
To compile the terminal version you'll need to install some dependencies:


  sudo apt-get install libncurses5-dev libncursesw5-dev g++
sudo apt-get install build-essential
  sudo apt-get install libncurses5-dev libncursesw5-dev
 
To compile it, now type:
 
make
 
If it fails, try:
 
make clean && make
 
If no errors appear, try running the game with:
 
./cataclysm
 
If that also works, you're ready to mod.
 
==== Localization (languages) ====
 
To compile for your local language into Cataclysm:DDA, you need ''gettext``:
 
sudo apt-get install gettext-dev
 
To compile without localization (its ''on'' by default):
 
make LOCALIZE=0
 
To compile with a specific localization:
 
make LANGUAGES="zh_CN zh_TW"
 
If no errors appear, try running the game with:
 
./cataclysm
 
==== Tiles (graphical) ====
 
To compile the graphical SDL version (for Ubuntu 14.04):
 
sudo apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev
 
(Ubuntu 12.04 "Precise Pangolin" uses libsdl-ttf-2.0-dev)
 
Compile with:


Now type ''make'' to compile it. If it fails, try ''make clean'' and retry ''make''.
make TILES=1


If it works, try running the game with ''./cataclysm''. If that also works, you're ready to mod.
To compile with improved performance, compile with:


To compile the graphical SDL version:
make TILES=1 RELEASE=1


sudo apt-get install libsdl1.2-dev libsdl-ttf2.0-dev:i386
To test that it is working correctly, type:


Fixme: Update, 20 Nov 2013 (0.9 Ma last named-release): You'll need a total of: sdl, sdl-ttf, sdl-image, (all in -dev versions); libsdl-image1.2-dev, and optionally lua5.1-dev. (Ubuntu Precise uses libsdl-ttf-2.0-dev)
./cataclysm-tiles


compile with ''make TILES=1''
If the ''tileset'' in the main window is missing, but everthing else seems to be working, there may be an issue with your SDL2 installation. You can check the game is still functioning correctly by turning on the ''ScentMap'', walking around in a square, or into walls and seeing what comes up on the ''minimap'' (the ''Overview Map'' will still work too).
 
You can use ''catalysm-tiles'' in ASCII mode by changeing the ''tileset'' in the ''Graphics Options'', where the ''minimap'' is still pixel based.
 
==== Sound (requires Tiles) ====
 
To compile with sound you need the Tiles graphical SDL version (for Ubuntu 14.04):
 
sudo apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev
 
Compile with:
 
make TILES=1 SOUND=1
 
To compile with improved performance, compile with:
 
make TILES=1 SOUND=1 RELEASE=1
 
To test that it is working correctly, type:
 
./cataclysm-tiles
 
Moving with the cursor keys on the menus, you should hear a ''chime-like click'' sound. If you dont hear anything, there maybe an issue with your SDL2 installation.
 
==== Fast Compile (English only) ====
 
You can speed up the compile time by not running the developer tests (needed to verify data when you are modding). By using ''RELEASE=1'' the default build with debug symbols is turned off, which also offers a perfomance boost at runtime.
You also may want to install your new build along side your (older) OS distributions version of Cataclysm:DDA, in which case it needs to be in a different location.
 
With graphics, sound, and no localization, compile with:
 
make RELEASE=1 USE_HOME_DIR=1 TILES=1 SOUND=1 LOCALIZE=0 ASTYLE=0 LINTJSON=0 RUNTESTS=0 PREFIX=/usr/local
 
After that completes you can install it with:
 
make install RELEASE=1 USE_HOME_DIR=1 TILES=1 SOUND=1 LOCALIZE=0 ASTYLE=0 LINTJSON=0 RUNTESTS=0 PREFIX=/usr/local
 
To find out which ''cataclysm'' is install and where, type:
 
which -a cataclysm-tiles
 
==== Further activities ====
 
From version 0.D ''Danny'', Lua scripting can be enabled by installing the dependency ''lua5.1-dev'' and adding ''LUA=1'' to the make arguments. Note that Lua scripting was removed with the release of 0.E ''Ellison''.


Run the game with ''./cataclysm-tiles''. It should be mentioned that SDL version sometimes runs smoother and faster.
Run the game with ''./cataclysm-tiles''. It should be mentioned that SDL version sometimes runs smoother and faster.


To update the game, move into the game directory and type "git pull". Afterwards, type ''make clean'' (which clears all object files and such) and ''make''. There, updated!
To update the game, move into the ''Cataclysm-DDA'' directory (where you did the ''git clone'') and type "git pull". Afterwards, type ''make clean'' (which clears all object files and such) and ''make'' to build again. There, updated! eg:
 
make clean && make (replace this with any options you used last time)


== Mac ==
== Mac ==
Mac is the least supported platform, due to almost nobody owning one. Still, it seems it's pretty much solid, some errors notwithstanding.
Mac is the least supported platform, due to almost nobody owning one. Still, it seems it's pretty much solid, some errors notwithstanding.
Note: some of this may no longer be applicable, 0.G is about to be released, and [https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/COMPILING/COMPILING.md#mac-os-x compiling CDDA on OSX] is well documented and well tested. Catalysm-DDA is available  from ''HomeBrew'', and there are ''dmg'' packages available on the repository [https://github.com/CleverRaven/Cataclysm-DDA/releases/tag/0.F releases] page (also for [https://github.com/CleverRaven/Cataclysm-DDA/tags experimental] biulds).


=== Fixing errors ===
=== Fixing errors ===
Line 237: Line 246:
Now, let's install the dependencies we'll need. It may ask you to type in your password or Y to confirm. Do it and continue.
Now, let's install the dependencies we'll need. It may ask you to type in your password or Y to confirm. Do it and continue.


  sudo port install ncurses git-core gettext
  sudo port install ncurses git gettext


Download and install https://code.google.com/p/rudix/downloads/detail?name=libintl-0.18.1.1-4.pkg
Download and install https://code.google.com/p/rudix/downloads/detail?name=libintl-0.18.1.1-4.pkg
Line 250: Line 259:
to move into the directory. Now type:
to move into the directory. Now type:
  make NATIVE=osx
  make NATIVE=osx
to compile it. OS 10.10, Yosemite, seems to require
make NATIVE=osx OSX_MIN=10.7 CLANG=1
or
make NATIVE=osx OSX_MIN=10.7 CLANG=1 MACPORTS=1
if you're using Macports
to compile it. If it fails, try:
to compile it. If it fails, try:
  make clean
  make clean

Latest revision as of 03:54, 26 January 2022

Guide created using an unknown version of Cataclysm DDA.
The information present here might not apply to the current version of CDDA.




For experimental version compilation instructions, see /doc/COMPILING/COMPILING.md.

Windows

Getting the game sources

CodeBlocks + MinGW

Note: Sometimes Code::Blocks project file may be outdated, so check if all .cpp and .h files from the source folder are listed in your project.

For help building the tiles/SDL version, see these forum topics:

Linux

For further information, please see COMPILING.md for up to date instructions. Compilation instructions may differ by distribution.

Get your friendly command-line terminal pumped and ready, grab some curdled popcorn, and pull up a mouldering chair.

Gentoo

Gentoo offers built-in support for installing Cataclysm: DDA straight from GitHub sources. Which is rather nice, really.

Installation

Run the following commands at your favorite command-line terminal as the superuser (i.e., root):

  1. Install layman, if not already.
  2. emerge layman
  3. Add overlay raiagent.
  4. layman -a raiagent
  5. Unmask cataclysm-dda by adding the following line to /etc/portage/package.accept_keywords.
  6. >=games-roguelike/cataclysm-dda-0.4
  7. Enable USE flags "ncurses" (installing an ncurses-based terminal interface) and/or "sdl" (installing an SDL-based tiles interface) by adding a line like the following to /etc/portage/package.use. (You probably want both as well as a Lua interpreter, so we default to that. NOTE: Lua appeared in 0.D Danny and disappeared in 0.E Ellison)
  8. games-roguelike/cataclysm-dda lua ncurses sdl
  9. Emerge cataclysm-dda.
  10. emerge cataclysm-dda

Assuming /usr/games/bin to be in your current ${PATH}, Cataclysm: DDA should now be runnable as either:

  • cataclysm-dda-ncurses, assuming you enabled USE flag "ncurses" above.
  • cataclysm-dda-sdl, assuming you enabled USE flag "sdl" above.

(A rehash may be required.)

raiagent also offers a live ebuild installing the most recent Cataclysm: DDA commit. Since such commits tend to be of "dubious stability," this ebuild is currently hard-masked with empty KEYWORDS. To unmask it, add the following line to /etc/portage/package.accept_keywords:

~games-roguelike/cataclysm-dda-9999 **

"Give 'em hell, kid."

Upgrading

  1. Move aside your old save/ subdirectory.
  2. mv /usr/games/cataclysm-dda/save /tmp/
  3. Upgrade cataclysm-dda.
  4. emerge cataclysm-dda

Since Cataclysm: DDA guarantees no backward compatibility with content saved by a prior version (e.g., characters, worlds, configuration files), failure to move aside your old save/ subdirectory often results in an STL exception on game startup resembling:

terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr

Ubuntu

(NOTE: these instructions should work for all Debian based distributions too, inlc. RaspberryPiOS - 2022)

First, open the terminal. On Ubuntu, you can find it by typing 'Terminal' into the dash and.

In order to download the latest version of Cataclysm:DDA, we will need to install git. You'll probably need to type in your password.

sudo apt-get install git

Now to pull the source. You're likely in your "home" or "root" directory in the terminal. You can use ls to list the directories and cd to move into them. Move onto the directory where you want your game to be installed then proceed:

git clone git://github.com/CleverRaven/Cataclysm-DDA.git

This'll make a directory called Cataclysm-DDA and pull the source into it. It might take a while.

To move into the directory, type:

cd Cataclysm-DDA


ncurses (terminal)

To compile the terminal version you'll need to install some dependencies:

sudo apt-get install build-essential
sudo apt-get install libncurses5-dev libncursesw5-dev

To compile it, now type:

make 

If it fails, try:

make clean && make

If no errors appear, try running the game with:

./cataclysm

If that also works, you're ready to mod.

Localization (languages)

To compile for your local language into Cataclysm:DDA, you need gettext``:

sudo apt-get install gettext-dev

To compile without localization (its on by default):

make LOCALIZE=0

To compile with a specific localization:

make LANGUAGES="zh_CN zh_TW"

If no errors appear, try running the game with:

./cataclysm

Tiles (graphical)

To compile the graphical SDL version (for Ubuntu 14.04):

sudo apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev

(Ubuntu 12.04 "Precise Pangolin" uses libsdl-ttf-2.0-dev)

Compile with:

make TILES=1

To compile with improved performance, compile with:

make TILES=1 RELEASE=1

To test that it is working correctly, type:

./cataclysm-tiles

If the tileset in the main window is missing, but everthing else seems to be working, there may be an issue with your SDL2 installation. You can check the game is still functioning correctly by turning on the ScentMap, walking around in a square, or into walls and seeing what comes up on the minimap (the Overview Map will still work too).

You can use catalysm-tiles in ASCII mode by changeing the tileset in the Graphics Options, where the minimap is still pixel based.

Sound (requires Tiles)

To compile with sound you need the Tiles graphical SDL version (for Ubuntu 14.04):

sudo apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev

Compile with:

make TILES=1 SOUND=1

To compile with improved performance, compile with:

make TILES=1 SOUND=1 RELEASE=1

To test that it is working correctly, type:

./cataclysm-tiles

Moving with the cursor keys on the menus, you should hear a chime-like click sound. If you dont hear anything, there maybe an issue with your SDL2 installation.

Fast Compile (English only)

You can speed up the compile time by not running the developer tests (needed to verify data when you are modding). By using RELEASE=1 the default build with debug symbols is turned off, which also offers a perfomance boost at runtime. You also may want to install your new build along side your (older) OS distributions version of Cataclysm:DDA, in which case it needs to be in a different location.

With graphics, sound, and no localization, compile with:

make RELEASE=1 USE_HOME_DIR=1 TILES=1 SOUND=1 LOCALIZE=0 ASTYLE=0 LINTJSON=0 RUNTESTS=0 PREFIX=/usr/local

After that completes you can install it with:

make install RELEASE=1 USE_HOME_DIR=1 TILES=1 SOUND=1 LOCALIZE=0 ASTYLE=0 LINTJSON=0 RUNTESTS=0 PREFIX=/usr/local

To find out which cataclysm is install and where, type:

which -a cataclysm-tiles

Further activities

From version 0.D Danny, Lua scripting can be enabled by installing the dependency lua5.1-dev and adding LUA=1 to the make arguments. Note that Lua scripting was removed with the release of 0.E Ellison.

Run the game with ./cataclysm-tiles. It should be mentioned that SDL version sometimes runs smoother and faster.

To update the game, move into the Cataclysm-DDA directory (where you did the git clone) and type "git pull". Afterwards, type make clean (which clears all object files and such) and make to build again. There, updated! eg:

make clean && make (replace this with any options you used last time)

Mac

Mac is the least supported platform, due to almost nobody owning one. Still, it seems it's pretty much solid, some errors notwithstanding.

Note: some of this may no longer be applicable, 0.G is about to be released, and compiling CDDA on OSX is well documented and well tested. Catalysm-DDA is available from HomeBrew, and there are dmg packages available on the repository releases page (also for experimental biulds).

Fixing errors

You might get these errors when compiling:

error: no matching function for call to `player_activity::player_activity(player_activity)'
note: candidates are: player_activity::player_activity(player_activity&)

This is due to non-const copy constructors (see this), which some C++ compilers just kludge for you with auto pointer magic... and others don't (like recent XCode GCC).

To fix this change:

pldata.h:113 player_activity(player_activity &copy)

to:

pldata.h:113 player_activity(player_activity const &copy)

You'll also need to change:

npc.h:197 npc_opinion(npc_opinion &copy)

to:

npc.h:197 npc_opinion(npc_opinion const &copy)

And, finally, force a 32-bit executable:

Makefile:8  OTHERS = -O3 -m32

Compile

Mac OS doesn't have apt-get, so you'll need Fink or MacPorts to install libraries (This guide will be using MacPorts). Other than that, the setup is pretty much the same as with Linux. Note: that this guide currently only supports non-SDL, non-tiles builds.

Now, let's install the dependencies we'll need. It may ask you to type in your password or Y to confirm. Do it and continue.

sudo port install ncurses git gettext

Download and install https://code.google.com/p/rudix/downloads/detail?name=libintl-0.18.1.1-4.pkg

This is it. Now to pull the source. You're likely in your "home" or "root" directory in the terminal. You can use "ls" to list the directories and "cd" to move into them. Once you are where you want the source to be, type:

git clone git://github.com/CleverRaven/Cataclysm-DDA.git

This'll make a directory called Cataclysm-DDA and pull the source into it. It might take a while.

Type:

cd Cataclysm-DDA

to move into the directory. Now type:

make NATIVE=osx

to compile it. OS 10.10, Yosemite, seems to require

make NATIVE=osx OSX_MIN=10.7 CLANG=1

or

make NATIVE=osx OSX_MIN=10.7 CLANG=1 MACPORTS=1

if you're using Macports to compile it. If it fails, try:

make clean

If it works, try running the game with:

./cataclysm

If that also works, you're ready to mod.

Note: Mac OS's terminal is normally set to 8-bit colors. Set it to 16-bit colors to get the colors needed for Cataclysm. An alternative may be to check the "display bright colours for bold text" on in terminal preferences / text tab.

To update the game, move into the game directory and write:

git pull

Afterwards, type:

make clean

Then:

make NATIVE=osx

There, updated!

Monospace fonts

While you can use fonts of any proportion to play the game, non-monospace fonts tend to distort the visual representation of the game world by stretching buildings, vehicles, creatures, etc vertically.

To avoid that you should use fonts specified as monospace instead. Here are some of them:

Changing the font

Windows

To change the font used by the game you'll need to edit the FONTDATA file, located in the Data directory. You can edit that file by using any text editor (Windows Notepad, Notepad++, etc). Or you could rename it and give it a .txt extension or open it a build in text editor. Don't forget to remove the .txt extension after editing it.

It'll display something like this:

Topaz-8
16
16

Change the first line to the name of the font you want to use. The other two lines are the size of the font. Cataclysm will stretch some fonts to make them bigger, where as with other fonts it will just increase the spacing between tiles. The numbers represent the size of the font in pixels, they do not have to be equal.

You'll have to experiment with different font and viewport sizes, by accessing the game's options menu (from the main menu scree or through ?, 2 while playing), until you get the game properly displayed at the size you want.

You may be able to try using fixedsys as it ships with cataclysm. If it does not work you will have to put the fixedsys.ttf font from your cataclysm\data\font folder into your windows font folder.

One more thing to mention, in order to use a font from your windows font folder with cataclysm you have to type the "name" of the font into FONTDATA. In order to find the font name you have to open the font, and look at the very top line of the file. Write down the name exactly as it appears except leave out any bits in ()'s. For example with the fixedsys font. You would type "Fixedsys TTF V5.00c" and NOT "Fixedsys TTF V5.00c (True Type)"

Linux and Mac

You can change the font and size in most terminals. Depending on the terminal you can do that by right clicking and selecting Options or a similar option, or by editing its config files.

If your terminal allows creating several profiles it'd be a good idea creating one for the only purpose of playing.