<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.thedarkmod.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Orbweaver</id>
	<title>The DarkMod Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.thedarkmod.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Orbweaver"/>
	<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Special:Contributions/Orbweaver"/>
	<updated>2026-04-18T02:00:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=26866</id>
		<title>DarkRadiant - Compiling in Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=26866"/>
		<updated>2020-12-16T13:25:50Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: No need to install libtool any more&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Install Required Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 20.04 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install git g++ gettext cmake pkg-config zlib1g-dev libjpeg62-dev libxml2-dev libsigc++-2.0-dev libgtest-dev&lt;br /&gt;
 sudo apt-get install libwxgtk3.0-gtk3-dev libpng-dev libftgl-dev libglew-dev libalut-dev libvorbis-dev python3-dev pybind11-dev&lt;br /&gt;
&lt;br /&gt;
=== openSUSE Tumbleweed ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo zypper install git libtool automake gcc-c++ gettext-tools zlib-devel libjpeg62-devel libxml2-devel libsigc++2-devel gtest&lt;br /&gt;
 sudo zypper install wxWidgets-3_0-devel ftgl-devel glew-devel libvorbis-devel freealut-devel python38-devel python3-pybind11-devel&lt;br /&gt;
&lt;br /&gt;
=== Mageia 8 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal, run as user who has the required permissions to install the packages:&lt;br /&gt;
&lt;br /&gt;
 sudo urpmi git make automake libtool gcc-c++ libzlib-devel libjpeg-devel libwxgtku3.0-devel libsigc++2.0-devel &lt;br /&gt;
 sudo urpmi libftgl-devel libglew-devel libpython3-devel libopenal-devel libfreealut-devel libvorbis-devel lib64gtest-devel&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 19 / 18 / 17 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install git g++ gettext automake libtool pkg-config zlib1g-dev libjpeg62-dev libwxgtk3.0-dev libxml2-dev &lt;br /&gt;
 sudo apt-get install libsigc++-2.0-dev libpng-dev libftgl-dev libglew-dev python3-dev libalut-dev libvorbis-dev pybind11-dev&lt;br /&gt;
&lt;br /&gt;
=== Debian 9 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install git automake libtool pkg-config gettext zlib1g-dev libjpeg62-turbo-dev libwxgtk3.0-dev &lt;br /&gt;
 sudo apt-get install libxml2-dev libsigc++-2.0-dev libpng-dev libftgl-dev libglew-dev libalut-dev libvorbis-dev python-dev pybind11-dev&lt;br /&gt;
&lt;br /&gt;
=== Fedora 26 / 25 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install git automake libtool gcc-c++ zlib-devel libjpeg-turbo-devel wxGTK3-devel libxml2-devel libsigc++20-devel &lt;br /&gt;
 sudo dnf install libpng12-devel ftgl-devel glew-devel libvorbis-devel freealut-devel python-devel pybind11-devel&lt;br /&gt;
&lt;br /&gt;
Note that the wxGTK package does not yet support Wayland environments, which is the default since Fedora 25 (DarkRadiant will just segfault during startup). You&#039;ll need to [https://fedoraproject.org/wiki/Changes/WaylandByDefault deactivate it] for the moment being.&lt;br /&gt;
&lt;br /&gt;
=== Arch Linux ===&lt;br /&gt;
The following packages are requred after starting from an Anarchy installation using Gnome as Window Manager. &lt;br /&gt;
&lt;br /&gt;
 sudo pacman -S automake libtool wxgtk ftgl glew freealut pybind11&lt;br /&gt;
&lt;br /&gt;
=== CentOS 7 x64 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal, run as user who has the required permissions to install the packages:&lt;br /&gt;
&lt;br /&gt;
 sudo yum -y install gcc gcc-c++ git automake libtool zlib-devel libjpeg-turbo-devel wxGTK3-devel libxml2-devel &lt;br /&gt;
 sudo yum -y install libsigc++20-devel ftgl-devel glew-devel boost-devel openal-soft-devel freealut-devel libvorbis-devel python-devel&lt;br /&gt;
&lt;br /&gt;
CentOS 7 ships with an older compiler, so you&#039;ll need to install a more recent GCC first (following the directions on [https://stackoverflow.com/questions/36327805/how-to-install-gcc-5-3-with-yum-on-centos-7-2 stackoverflow]):&lt;br /&gt;
&lt;br /&gt;
 sudo yum install centos-release-scl &lt;br /&gt;
 sudo yum install devtoolset-4-gcc*&lt;br /&gt;
 scl enable devtoolset-4 bash&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;tt&amp;gt;wxGTK3-devel&amp;lt;/tt&amp;gt; package doesn&#039;t create a &amp;lt;tt&amp;gt;wx-config&amp;lt;/tt&amp;gt; symlink in the &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt; directory, that&#039;s why you need to pass an additional &amp;lt;tt&amp;gt;--with-wx-config=/usr/bin/wx-config-3.0&amp;lt;/tt&amp;gt; argument to the ./configure script below, like this:&lt;br /&gt;
&lt;br /&gt;
 ./configure --enable-darkmod-plugins --with-wx-config=/usr/bin/wx-config-3.0&lt;br /&gt;
&lt;br /&gt;
=== Slackware 14.2 ===&lt;br /&gt;
&lt;br /&gt;
Slackware doesn&#039;t provide precompiled packages on the one hand (unlike Debian or Arch), but already ships with a lot of libraries on the other. Stuff like git, automake, libtools and development libraries like zlib and boost are already present, but wxWidgets, openAL, ALut and FTGL need to be installed by means of a SlackBuild script. The following has been done in Slackware 14.2, so your mileage may vary.&lt;br /&gt;
&lt;br /&gt;
Download the Source tarballs and the SlackBuild packages from these URLs:&lt;br /&gt;
&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/wxGTK3/&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/ftgl/&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/OpenAL/&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/freealut/&lt;br /&gt;
&lt;br /&gt;
Download and extract the SlackBuild &amp;lt;tt&amp;gt;.tar.gz&amp;lt;/tt&amp;gt; files in your &amp;lt;tt&amp;gt;~/Downloads&amp;lt;/tt&amp;gt; folder (or anywhere else where you want to have them). For instance, the wxGTK3 package can be untar&#039;d like this:&lt;br /&gt;
&lt;br /&gt;
 tar xzf wxGTK3.tar.gz&lt;br /&gt;
 cd wxGTK3&lt;br /&gt;
 chmod +x wxGTK3.SlackBuild&lt;br /&gt;
&lt;br /&gt;
Do this for all of the above libraries, that should give you the directories &amp;lt;tt&amp;gt;ftgl/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;OpenAL/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;wxGTK3/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;freealut/&amp;lt;/tt&amp;gt;. Next, download the Source Tarballs (the &amp;lt;tt&amp;gt;.tar.bz2&amp;lt;/tt&amp;gt;) files from the links above and place them next to the corresponding SlackBuild script. Then run the scripts for each of them and install the build output in your system in a second step:&lt;br /&gt;
&lt;br /&gt;
 ./wxGTK3.SlackBuild&lt;br /&gt;
&lt;br /&gt;
This produced (on my end at least) the package &amp;lt;tt&amp;gt;/tmp/wxGTK3-3.0.2-i486-2_SBo.tgz&amp;lt;/tt&amp;gt; which can be installed by the &amp;lt;tt&amp;gt;installpkg&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 installpkg /tmp/wxGTK3-3.0.2-i486-2_SBo.tgz&lt;br /&gt;
&lt;br /&gt;
Do the same for the rest of the libraries (ftgl, OpenAL, freealut). Be aware that the freealut package depends on the OpenAL package, so you need to do the OpenAL one first. Once you have these installed, you can proceed to the build section (&amp;lt;tt&amp;gt;git clone&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== Gentoo ===&lt;br /&gt;
&lt;br /&gt;
DarkRadiant can be built and installed from an unofficial ebuild repository (overlay). The easiest way to do this is with [https://packages.gentoo.org/packages/app-portage/layman app-portage/layman], which must be installed with the &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; use flag.&lt;br /&gt;
&lt;br /&gt;
In the &#039;overlays&#039; section in &amp;lt;tt&amp;gt;/etc/layman/layman.cfg&amp;lt;/tt&amp;gt;, add:&lt;br /&gt;
&lt;br /&gt;
 https://raw.githubusercontent.com/varingst/varingst-overlay/master/overlay.xml&lt;br /&gt;
&lt;br /&gt;
Then fetch and add the overlay:&lt;br /&gt;
&lt;br /&gt;
 # layman -f -a varingst&lt;br /&gt;
&lt;br /&gt;
Now that the overlay is added, you can build and install DarkRadiant with Portage:&lt;br /&gt;
&lt;br /&gt;
 # emerge darkradiant&lt;br /&gt;
&lt;br /&gt;
To sync the overlay, either do it manually with layman:&lt;br /&gt;
&lt;br /&gt;
 # layman -s varingst&lt;br /&gt;
&lt;br /&gt;
Or look into the [https://wiki.gentoo.org/wiki/Project:Portage/Sync various ways to hook into the portage sync system].&lt;br /&gt;
&lt;br /&gt;
=== Distributions with GCC 4.8 or earlier ===&lt;br /&gt;
DarkRadiant&#039;s codebase makes heavy use of C++11 features, in particular std::regex which has been supported from GCC 4.9 on. Not all distributions ship with g++ 4.9 by default (for example Ubuntu 14.04 does not), but it&#039;s possible to install a more recent compiler suite. Get the GCC 4.9 package and ensure that the makefiles are called with the correct setup, e.g.&lt;br /&gt;
 CXX=&amp;quot;g++-4.9&amp;quot; ./configure --enable-darkmod-plugins &amp;amp;&amp;amp; make -j3 &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
=== Older Distributions / Compiling DarkRadiant 1.8 and older ===&lt;br /&gt;
The instructions about how to compile DR 1.8 (based on GTK) in distributions published in 2012 and older have been removed. They should still be in the [http://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;amp;oldid=18927 history] of this page, should they ever be needed.&lt;br /&gt;
&lt;br /&gt;
== Obtain the source ==&lt;br /&gt;
&lt;br /&gt;
Make sure you have the git client installed, this is covered in the package installation commands above. &lt;br /&gt;
Next, change to the directory where you want the source code to be in and then clone the Git repository with:&lt;br /&gt;
&lt;br /&gt;
 git clone git://github.com/codereader/DarkRadiant.git&lt;br /&gt;
&lt;br /&gt;
Once the initial clone is done, the source can be updated to the latest version from inside the working directory with:&lt;br /&gt;
&lt;br /&gt;
 git pull&lt;br /&gt;
&lt;br /&gt;
== Configure and Compile ==&lt;br /&gt;
DarkRadiant employs the CMake build system under Linux as used in many open-source projects. Make sure you have the CMake toolchain downloaded, this is covered in the package installation commands above.&lt;br /&gt;
&lt;br /&gt;
To build DarkRadiant, run the typical chain of CMake and make commands:&lt;br /&gt;
&lt;br /&gt;
 cmake .&lt;br /&gt;
 make&lt;br /&gt;
 [sudo] make install&lt;br /&gt;
&lt;br /&gt;
By the above, a release build will be created; if a debug build is required pass the &amp;lt;tt&amp;gt;-DCMAKE_BUILD_TYPE=Debug&amp;lt;/tt&amp;gt; option to the cmake command script.&lt;br /&gt;
&lt;br /&gt;
Other points to note about the configure process:&lt;br /&gt;
&lt;br /&gt;
* The DarkMod-specific plugins are built by default, the &amp;lt;tt&amp;gt;-DENABLE_DM_PLUGINS=OFF&amp;lt;/tt&amp;gt; argument will disable them.&lt;br /&gt;
* The CMake script autodetects required dependencies, and will conditionally enable optional components of DarkRadiant (such as the sound plugin) based on what it finds.&lt;br /&gt;
* For quick testing of a DarkRadiant build, it is desirable to install it into a temporary location rather than the default of &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt;; for this, simply pass a prefix option such as &amp;lt;tt&amp;gt;-DCMAKE_INSTALL_PREFIX=/tmp/dr&amp;lt;/tt&amp;gt; to cmake, after which DarkRadiant will be installed in &amp;lt;tt&amp;gt;/tmp/dr/bin/darkradiant&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Multiprocessor Systems ===&lt;br /&gt;
&lt;br /&gt;
You can pass the &amp;lt;tt&amp;gt;--jobs=N&amp;lt;/tt&amp;gt; parameter to make:&lt;br /&gt;
 make --jobs=2&lt;br /&gt;
to use more than one processor for the compilation. This will eat lots of RAM, so don&#039;t do this on machines with little available memory.&lt;br /&gt;
&lt;br /&gt;
=== Building a .deb package ===&lt;br /&gt;
&lt;br /&gt;
To build a Debian/Ubuntu package, simply run&lt;br /&gt;
&lt;br /&gt;
 dpkg-buildpackage -rfakeroot&lt;br /&gt;
&lt;br /&gt;
in the main &amp;lt;tt&amp;gt;darkradiant&amp;lt;/tt&amp;gt; directory. The .deb will be created in the parent directory.&lt;br /&gt;
&lt;br /&gt;
{{coding}}&lt;br /&gt;
{{darkradiant|sort=Compilation}}&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=26865</id>
		<title>DarkRadiant - Compiling in Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=26865"/>
		<updated>2020-12-16T13:25:24Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: Install CMake rather than Automake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Install Required Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 20.04 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install git g++ gettext cmake libtool pkg-config zlib1g-dev libjpeg62-dev libxml2-dev libsigc++-2.0-dev libgtest-dev&lt;br /&gt;
 sudo apt-get install libwxgtk3.0-gtk3-dev libpng-dev libftgl-dev libglew-dev libalut-dev libvorbis-dev python3-dev pybind11-dev&lt;br /&gt;
&lt;br /&gt;
=== openSUSE Tumbleweed ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo zypper install git libtool automake gcc-c++ gettext-tools zlib-devel libjpeg62-devel libxml2-devel libsigc++2-devel gtest&lt;br /&gt;
 sudo zypper install wxWidgets-3_0-devel ftgl-devel glew-devel libvorbis-devel freealut-devel python38-devel python3-pybind11-devel&lt;br /&gt;
&lt;br /&gt;
=== Mageia 8 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal, run as user who has the required permissions to install the packages:&lt;br /&gt;
&lt;br /&gt;
 sudo urpmi git make automake libtool gcc-c++ libzlib-devel libjpeg-devel libwxgtku3.0-devel libsigc++2.0-devel &lt;br /&gt;
 sudo urpmi libftgl-devel libglew-devel libpython3-devel libopenal-devel libfreealut-devel libvorbis-devel lib64gtest-devel&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 19 / 18 / 17 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install git g++ gettext automake libtool pkg-config zlib1g-dev libjpeg62-dev libwxgtk3.0-dev libxml2-dev &lt;br /&gt;
 sudo apt-get install libsigc++-2.0-dev libpng-dev libftgl-dev libglew-dev python3-dev libalut-dev libvorbis-dev pybind11-dev&lt;br /&gt;
&lt;br /&gt;
=== Debian 9 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install git automake libtool pkg-config gettext zlib1g-dev libjpeg62-turbo-dev libwxgtk3.0-dev &lt;br /&gt;
 sudo apt-get install libxml2-dev libsigc++-2.0-dev libpng-dev libftgl-dev libglew-dev libalut-dev libvorbis-dev python-dev pybind11-dev&lt;br /&gt;
&lt;br /&gt;
=== Fedora 26 / 25 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install git automake libtool gcc-c++ zlib-devel libjpeg-turbo-devel wxGTK3-devel libxml2-devel libsigc++20-devel &lt;br /&gt;
 sudo dnf install libpng12-devel ftgl-devel glew-devel libvorbis-devel freealut-devel python-devel pybind11-devel&lt;br /&gt;
&lt;br /&gt;
Note that the wxGTK package does not yet support Wayland environments, which is the default since Fedora 25 (DarkRadiant will just segfault during startup). You&#039;ll need to [https://fedoraproject.org/wiki/Changes/WaylandByDefault deactivate it] for the moment being.&lt;br /&gt;
&lt;br /&gt;
=== Arch Linux ===&lt;br /&gt;
The following packages are requred after starting from an Anarchy installation using Gnome as Window Manager. &lt;br /&gt;
&lt;br /&gt;
 sudo pacman -S automake libtool wxgtk ftgl glew freealut pybind11&lt;br /&gt;
&lt;br /&gt;
=== CentOS 7 x64 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal, run as user who has the required permissions to install the packages:&lt;br /&gt;
&lt;br /&gt;
 sudo yum -y install gcc gcc-c++ git automake libtool zlib-devel libjpeg-turbo-devel wxGTK3-devel libxml2-devel &lt;br /&gt;
 sudo yum -y install libsigc++20-devel ftgl-devel glew-devel boost-devel openal-soft-devel freealut-devel libvorbis-devel python-devel&lt;br /&gt;
&lt;br /&gt;
CentOS 7 ships with an older compiler, so you&#039;ll need to install a more recent GCC first (following the directions on [https://stackoverflow.com/questions/36327805/how-to-install-gcc-5-3-with-yum-on-centos-7-2 stackoverflow]):&lt;br /&gt;
&lt;br /&gt;
 sudo yum install centos-release-scl &lt;br /&gt;
 sudo yum install devtoolset-4-gcc*&lt;br /&gt;
 scl enable devtoolset-4 bash&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;tt&amp;gt;wxGTK3-devel&amp;lt;/tt&amp;gt; package doesn&#039;t create a &amp;lt;tt&amp;gt;wx-config&amp;lt;/tt&amp;gt; symlink in the &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt; directory, that&#039;s why you need to pass an additional &amp;lt;tt&amp;gt;--with-wx-config=/usr/bin/wx-config-3.0&amp;lt;/tt&amp;gt; argument to the ./configure script below, like this:&lt;br /&gt;
&lt;br /&gt;
 ./configure --enable-darkmod-plugins --with-wx-config=/usr/bin/wx-config-3.0&lt;br /&gt;
&lt;br /&gt;
=== Slackware 14.2 ===&lt;br /&gt;
&lt;br /&gt;
Slackware doesn&#039;t provide precompiled packages on the one hand (unlike Debian or Arch), but already ships with a lot of libraries on the other. Stuff like git, automake, libtools and development libraries like zlib and boost are already present, but wxWidgets, openAL, ALut and FTGL need to be installed by means of a SlackBuild script. The following has been done in Slackware 14.2, so your mileage may vary.&lt;br /&gt;
&lt;br /&gt;
Download the Source tarballs and the SlackBuild packages from these URLs:&lt;br /&gt;
&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/wxGTK3/&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/ftgl/&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/OpenAL/&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/freealut/&lt;br /&gt;
&lt;br /&gt;
Download and extract the SlackBuild &amp;lt;tt&amp;gt;.tar.gz&amp;lt;/tt&amp;gt; files in your &amp;lt;tt&amp;gt;~/Downloads&amp;lt;/tt&amp;gt; folder (or anywhere else where you want to have them). For instance, the wxGTK3 package can be untar&#039;d like this:&lt;br /&gt;
&lt;br /&gt;
 tar xzf wxGTK3.tar.gz&lt;br /&gt;
 cd wxGTK3&lt;br /&gt;
 chmod +x wxGTK3.SlackBuild&lt;br /&gt;
&lt;br /&gt;
Do this for all of the above libraries, that should give you the directories &amp;lt;tt&amp;gt;ftgl/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;OpenAL/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;wxGTK3/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;freealut/&amp;lt;/tt&amp;gt;. Next, download the Source Tarballs (the &amp;lt;tt&amp;gt;.tar.bz2&amp;lt;/tt&amp;gt;) files from the links above and place them next to the corresponding SlackBuild script. Then run the scripts for each of them and install the build output in your system in a second step:&lt;br /&gt;
&lt;br /&gt;
 ./wxGTK3.SlackBuild&lt;br /&gt;
&lt;br /&gt;
This produced (on my end at least) the package &amp;lt;tt&amp;gt;/tmp/wxGTK3-3.0.2-i486-2_SBo.tgz&amp;lt;/tt&amp;gt; which can be installed by the &amp;lt;tt&amp;gt;installpkg&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 installpkg /tmp/wxGTK3-3.0.2-i486-2_SBo.tgz&lt;br /&gt;
&lt;br /&gt;
Do the same for the rest of the libraries (ftgl, OpenAL, freealut). Be aware that the freealut package depends on the OpenAL package, so you need to do the OpenAL one first. Once you have these installed, you can proceed to the build section (&amp;lt;tt&amp;gt;git clone&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== Gentoo ===&lt;br /&gt;
&lt;br /&gt;
DarkRadiant can be built and installed from an unofficial ebuild repository (overlay). The easiest way to do this is with [https://packages.gentoo.org/packages/app-portage/layman app-portage/layman], which must be installed with the &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; use flag.&lt;br /&gt;
&lt;br /&gt;
In the &#039;overlays&#039; section in &amp;lt;tt&amp;gt;/etc/layman/layman.cfg&amp;lt;/tt&amp;gt;, add:&lt;br /&gt;
&lt;br /&gt;
 https://raw.githubusercontent.com/varingst/varingst-overlay/master/overlay.xml&lt;br /&gt;
&lt;br /&gt;
Then fetch and add the overlay:&lt;br /&gt;
&lt;br /&gt;
 # layman -f -a varingst&lt;br /&gt;
&lt;br /&gt;
Now that the overlay is added, you can build and install DarkRadiant with Portage:&lt;br /&gt;
&lt;br /&gt;
 # emerge darkradiant&lt;br /&gt;
&lt;br /&gt;
To sync the overlay, either do it manually with layman:&lt;br /&gt;
&lt;br /&gt;
 # layman -s varingst&lt;br /&gt;
&lt;br /&gt;
Or look into the [https://wiki.gentoo.org/wiki/Project:Portage/Sync various ways to hook into the portage sync system].&lt;br /&gt;
&lt;br /&gt;
=== Distributions with GCC 4.8 or earlier ===&lt;br /&gt;
DarkRadiant&#039;s codebase makes heavy use of C++11 features, in particular std::regex which has been supported from GCC 4.9 on. Not all distributions ship with g++ 4.9 by default (for example Ubuntu 14.04 does not), but it&#039;s possible to install a more recent compiler suite. Get the GCC 4.9 package and ensure that the makefiles are called with the correct setup, e.g.&lt;br /&gt;
 CXX=&amp;quot;g++-4.9&amp;quot; ./configure --enable-darkmod-plugins &amp;amp;&amp;amp; make -j3 &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
=== Older Distributions / Compiling DarkRadiant 1.8 and older ===&lt;br /&gt;
The instructions about how to compile DR 1.8 (based on GTK) in distributions published in 2012 and older have been removed. They should still be in the [http://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;amp;oldid=18927 history] of this page, should they ever be needed.&lt;br /&gt;
&lt;br /&gt;
== Obtain the source ==&lt;br /&gt;
&lt;br /&gt;
Make sure you have the git client installed, this is covered in the package installation commands above. &lt;br /&gt;
Next, change to the directory where you want the source code to be in and then clone the Git repository with:&lt;br /&gt;
&lt;br /&gt;
 git clone git://github.com/codereader/DarkRadiant.git&lt;br /&gt;
&lt;br /&gt;
Once the initial clone is done, the source can be updated to the latest version from inside the working directory with:&lt;br /&gt;
&lt;br /&gt;
 git pull&lt;br /&gt;
&lt;br /&gt;
== Configure and Compile ==&lt;br /&gt;
DarkRadiant employs the CMake build system under Linux as used in many open-source projects. Make sure you have the CMake toolchain downloaded, this is covered in the package installation commands above.&lt;br /&gt;
&lt;br /&gt;
To build DarkRadiant, run the typical chain of CMake and make commands:&lt;br /&gt;
&lt;br /&gt;
 cmake .&lt;br /&gt;
 make&lt;br /&gt;
 [sudo] make install&lt;br /&gt;
&lt;br /&gt;
By the above, a release build will be created; if a debug build is required pass the &amp;lt;tt&amp;gt;-DCMAKE_BUILD_TYPE=Debug&amp;lt;/tt&amp;gt; option to the cmake command script.&lt;br /&gt;
&lt;br /&gt;
Other points to note about the configure process:&lt;br /&gt;
&lt;br /&gt;
* The DarkMod-specific plugins are built by default, the &amp;lt;tt&amp;gt;-DENABLE_DM_PLUGINS=OFF&amp;lt;/tt&amp;gt; argument will disable them.&lt;br /&gt;
* The CMake script autodetects required dependencies, and will conditionally enable optional components of DarkRadiant (such as the sound plugin) based on what it finds.&lt;br /&gt;
* For quick testing of a DarkRadiant build, it is desirable to install it into a temporary location rather than the default of &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt;; for this, simply pass a prefix option such as &amp;lt;tt&amp;gt;-DCMAKE_INSTALL_PREFIX=/tmp/dr&amp;lt;/tt&amp;gt; to cmake, after which DarkRadiant will be installed in &amp;lt;tt&amp;gt;/tmp/dr/bin/darkradiant&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Multiprocessor Systems ===&lt;br /&gt;
&lt;br /&gt;
You can pass the &amp;lt;tt&amp;gt;--jobs=N&amp;lt;/tt&amp;gt; parameter to make:&lt;br /&gt;
 make --jobs=2&lt;br /&gt;
to use more than one processor for the compilation. This will eat lots of RAM, so don&#039;t do this on machines with little available memory.&lt;br /&gt;
&lt;br /&gt;
=== Building a .deb package ===&lt;br /&gt;
&lt;br /&gt;
To build a Debian/Ubuntu package, simply run&lt;br /&gt;
&lt;br /&gt;
 dpkg-buildpackage -rfakeroot&lt;br /&gt;
&lt;br /&gt;
in the main &amp;lt;tt&amp;gt;darkradiant&amp;lt;/tt&amp;gt; directory. The .deb will be created in the parent directory.&lt;br /&gt;
&lt;br /&gt;
{{coding}}&lt;br /&gt;
{{darkradiant|sort=Compilation}}&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=26864</id>
		<title>DarkRadiant - Compiling in Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=26864"/>
		<updated>2020-12-16T13:21:13Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: Update Linux compilation steps to match the new CMake build&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Install Required Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 20.04 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install git g++ gettext automake libtool pkg-config zlib1g-dev libjpeg62-dev libxml2-dev libsigc++-2.0-dev libgtest-dev&lt;br /&gt;
 sudo apt-get install libwxgtk3.0-gtk3-dev libpng-dev libftgl-dev libglew-dev libalut-dev libvorbis-dev python3-dev pybind11-dev&lt;br /&gt;
&lt;br /&gt;
=== openSUSE Tumbleweed ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo zypper install git libtool automake gcc-c++ gettext-tools zlib-devel libjpeg62-devel libxml2-devel libsigc++2-devel gtest&lt;br /&gt;
 sudo zypper install wxWidgets-3_0-devel ftgl-devel glew-devel libvorbis-devel freealut-devel python38-devel python3-pybind11-devel&lt;br /&gt;
&lt;br /&gt;
=== Mageia 8 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal, run as user who has the required permissions to install the packages:&lt;br /&gt;
&lt;br /&gt;
 sudo urpmi git make automake libtool gcc-c++ libzlib-devel libjpeg-devel libwxgtku3.0-devel libsigc++2.0-devel &lt;br /&gt;
 sudo urpmi libftgl-devel libglew-devel libpython3-devel libopenal-devel libfreealut-devel libvorbis-devel lib64gtest-devel&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 19 / 18 / 17 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install git g++ gettext automake libtool pkg-config zlib1g-dev libjpeg62-dev libwxgtk3.0-dev libxml2-dev &lt;br /&gt;
 sudo apt-get install libsigc++-2.0-dev libpng-dev libftgl-dev libglew-dev python3-dev libalut-dev libvorbis-dev pybind11-dev&lt;br /&gt;
&lt;br /&gt;
=== Debian 9 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install git automake libtool pkg-config gettext zlib1g-dev libjpeg62-turbo-dev libwxgtk3.0-dev &lt;br /&gt;
 sudo apt-get install libxml2-dev libsigc++-2.0-dev libpng-dev libftgl-dev libglew-dev libalut-dev libvorbis-dev python-dev pybind11-dev&lt;br /&gt;
&lt;br /&gt;
=== Fedora 26 / 25 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
 sudo dnf install git automake libtool gcc-c++ zlib-devel libjpeg-turbo-devel wxGTK3-devel libxml2-devel libsigc++20-devel &lt;br /&gt;
 sudo dnf install libpng12-devel ftgl-devel glew-devel libvorbis-devel freealut-devel python-devel pybind11-devel&lt;br /&gt;
&lt;br /&gt;
Note that the wxGTK package does not yet support Wayland environments, which is the default since Fedora 25 (DarkRadiant will just segfault during startup). You&#039;ll need to [https://fedoraproject.org/wiki/Changes/WaylandByDefault deactivate it] for the moment being.&lt;br /&gt;
&lt;br /&gt;
=== Arch Linux ===&lt;br /&gt;
The following packages are requred after starting from an Anarchy installation using Gnome as Window Manager. &lt;br /&gt;
&lt;br /&gt;
 sudo pacman -S automake libtool wxgtk ftgl glew freealut pybind11&lt;br /&gt;
&lt;br /&gt;
=== CentOS 7 x64 ===&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a terminal, run as user who has the required permissions to install the packages:&lt;br /&gt;
&lt;br /&gt;
 sudo yum -y install gcc gcc-c++ git automake libtool zlib-devel libjpeg-turbo-devel wxGTK3-devel libxml2-devel &lt;br /&gt;
 sudo yum -y install libsigc++20-devel ftgl-devel glew-devel boost-devel openal-soft-devel freealut-devel libvorbis-devel python-devel&lt;br /&gt;
&lt;br /&gt;
CentOS 7 ships with an older compiler, so you&#039;ll need to install a more recent GCC first (following the directions on [https://stackoverflow.com/questions/36327805/how-to-install-gcc-5-3-with-yum-on-centos-7-2 stackoverflow]):&lt;br /&gt;
&lt;br /&gt;
 sudo yum install centos-release-scl &lt;br /&gt;
 sudo yum install devtoolset-4-gcc*&lt;br /&gt;
 scl enable devtoolset-4 bash&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;tt&amp;gt;wxGTK3-devel&amp;lt;/tt&amp;gt; package doesn&#039;t create a &amp;lt;tt&amp;gt;wx-config&amp;lt;/tt&amp;gt; symlink in the &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt; directory, that&#039;s why you need to pass an additional &amp;lt;tt&amp;gt;--with-wx-config=/usr/bin/wx-config-3.0&amp;lt;/tt&amp;gt; argument to the ./configure script below, like this:&lt;br /&gt;
&lt;br /&gt;
 ./configure --enable-darkmod-plugins --with-wx-config=/usr/bin/wx-config-3.0&lt;br /&gt;
&lt;br /&gt;
=== Slackware 14.2 ===&lt;br /&gt;
&lt;br /&gt;
Slackware doesn&#039;t provide precompiled packages on the one hand (unlike Debian or Arch), but already ships with a lot of libraries on the other. Stuff like git, automake, libtools and development libraries like zlib and boost are already present, but wxWidgets, openAL, ALut and FTGL need to be installed by means of a SlackBuild script. The following has been done in Slackware 14.2, so your mileage may vary.&lt;br /&gt;
&lt;br /&gt;
Download the Source tarballs and the SlackBuild packages from these URLs:&lt;br /&gt;
&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/wxGTK3/&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/ftgl/&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/OpenAL/&lt;br /&gt;
* https://slackbuilds.org/repository/14.2/libraries/freealut/&lt;br /&gt;
&lt;br /&gt;
Download and extract the SlackBuild &amp;lt;tt&amp;gt;.tar.gz&amp;lt;/tt&amp;gt; files in your &amp;lt;tt&amp;gt;~/Downloads&amp;lt;/tt&amp;gt; folder (or anywhere else where you want to have them). For instance, the wxGTK3 package can be untar&#039;d like this:&lt;br /&gt;
&lt;br /&gt;
 tar xzf wxGTK3.tar.gz&lt;br /&gt;
 cd wxGTK3&lt;br /&gt;
 chmod +x wxGTK3.SlackBuild&lt;br /&gt;
&lt;br /&gt;
Do this for all of the above libraries, that should give you the directories &amp;lt;tt&amp;gt;ftgl/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;OpenAL/&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;wxGTK3/&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;freealut/&amp;lt;/tt&amp;gt;. Next, download the Source Tarballs (the &amp;lt;tt&amp;gt;.tar.bz2&amp;lt;/tt&amp;gt;) files from the links above and place them next to the corresponding SlackBuild script. Then run the scripts for each of them and install the build output in your system in a second step:&lt;br /&gt;
&lt;br /&gt;
 ./wxGTK3.SlackBuild&lt;br /&gt;
&lt;br /&gt;
This produced (on my end at least) the package &amp;lt;tt&amp;gt;/tmp/wxGTK3-3.0.2-i486-2_SBo.tgz&amp;lt;/tt&amp;gt; which can be installed by the &amp;lt;tt&amp;gt;installpkg&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 installpkg /tmp/wxGTK3-3.0.2-i486-2_SBo.tgz&lt;br /&gt;
&lt;br /&gt;
Do the same for the rest of the libraries (ftgl, OpenAL, freealut). Be aware that the freealut package depends on the OpenAL package, so you need to do the OpenAL one first. Once you have these installed, you can proceed to the build section (&amp;lt;tt&amp;gt;git clone&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== Gentoo ===&lt;br /&gt;
&lt;br /&gt;
DarkRadiant can be built and installed from an unofficial ebuild repository (overlay). The easiest way to do this is with [https://packages.gentoo.org/packages/app-portage/layman app-portage/layman], which must be installed with the &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; use flag.&lt;br /&gt;
&lt;br /&gt;
In the &#039;overlays&#039; section in &amp;lt;tt&amp;gt;/etc/layman/layman.cfg&amp;lt;/tt&amp;gt;, add:&lt;br /&gt;
&lt;br /&gt;
 https://raw.githubusercontent.com/varingst/varingst-overlay/master/overlay.xml&lt;br /&gt;
&lt;br /&gt;
Then fetch and add the overlay:&lt;br /&gt;
&lt;br /&gt;
 # layman -f -a varingst&lt;br /&gt;
&lt;br /&gt;
Now that the overlay is added, you can build and install DarkRadiant with Portage:&lt;br /&gt;
&lt;br /&gt;
 # emerge darkradiant&lt;br /&gt;
&lt;br /&gt;
To sync the overlay, either do it manually with layman:&lt;br /&gt;
&lt;br /&gt;
 # layman -s varingst&lt;br /&gt;
&lt;br /&gt;
Or look into the [https://wiki.gentoo.org/wiki/Project:Portage/Sync various ways to hook into the portage sync system].&lt;br /&gt;
&lt;br /&gt;
=== Distributions with GCC 4.8 or earlier ===&lt;br /&gt;
DarkRadiant&#039;s codebase makes heavy use of C++11 features, in particular std::regex which has been supported from GCC 4.9 on. Not all distributions ship with g++ 4.9 by default (for example Ubuntu 14.04 does not), but it&#039;s possible to install a more recent compiler suite. Get the GCC 4.9 package and ensure that the makefiles are called with the correct setup, e.g.&lt;br /&gt;
 CXX=&amp;quot;g++-4.9&amp;quot; ./configure --enable-darkmod-plugins &amp;amp;&amp;amp; make -j3 &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
=== Older Distributions / Compiling DarkRadiant 1.8 and older ===&lt;br /&gt;
The instructions about how to compile DR 1.8 (based on GTK) in distributions published in 2012 and older have been removed. They should still be in the [http://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;amp;oldid=18927 history] of this page, should they ever be needed.&lt;br /&gt;
&lt;br /&gt;
== Obtain the source ==&lt;br /&gt;
&lt;br /&gt;
Make sure you have the git client installed, this is covered in the package installation commands above. &lt;br /&gt;
Next, change to the directory where you want the source code to be in and then clone the Git repository with:&lt;br /&gt;
&lt;br /&gt;
 git clone git://github.com/codereader/DarkRadiant.git&lt;br /&gt;
&lt;br /&gt;
Once the initial clone is done, the source can be updated to the latest version from inside the working directory with:&lt;br /&gt;
&lt;br /&gt;
 git pull&lt;br /&gt;
&lt;br /&gt;
== Configure and Compile ==&lt;br /&gt;
DarkRadiant employs the CMake build system under Linux as used in many open-source projects. Make sure you have the CMake toolchain downloaded, this is covered in the package installation commands above.&lt;br /&gt;
&lt;br /&gt;
To build DarkRadiant, run the typical chain of CMake and make commands:&lt;br /&gt;
&lt;br /&gt;
 cmake .&lt;br /&gt;
 make&lt;br /&gt;
 [sudo] make install&lt;br /&gt;
&lt;br /&gt;
By the above, a release build will be created; if a debug build is required pass the &amp;lt;tt&amp;gt;-DCMAKE_BUILD_TYPE=Debug&amp;lt;/tt&amp;gt; option to the cmake command script.&lt;br /&gt;
&lt;br /&gt;
Other points to note about the configure process:&lt;br /&gt;
&lt;br /&gt;
* The DarkMod-specific plugins are built by default, the &amp;lt;tt&amp;gt;-DENABLE_DM_PLUGINS=OFF&amp;lt;/tt&amp;gt; argument will disable them.&lt;br /&gt;
* The CMake script autodetects required dependencies, and will conditionally enable optional components of DarkRadiant (such as the sound plugin) based on what it finds.&lt;br /&gt;
* For quick testing of a DarkRadiant build, it is desirable to install it into a temporary location rather than the default of &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt;; for this, simply pass a prefix option such as &amp;lt;tt&amp;gt;-DCMAKE_INSTALL_PREFIX=/tmp/dr&amp;lt;/tt&amp;gt; to cmake, after which DarkRadiant will be installed in &amp;lt;tt&amp;gt;/tmp/dr/bin/darkradiant&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Multiprocessor Systems ===&lt;br /&gt;
&lt;br /&gt;
You can pass the &amp;lt;tt&amp;gt;--jobs=N&amp;lt;/tt&amp;gt; parameter to make:&lt;br /&gt;
 make --jobs=2&lt;br /&gt;
to use more than one processor for the compilation. This will eat lots of RAM, so don&#039;t do this on machines with little available memory.&lt;br /&gt;
&lt;br /&gt;
=== Building a .deb package ===&lt;br /&gt;
&lt;br /&gt;
To build a Debian/Ubuntu package, simply run&lt;br /&gt;
&lt;br /&gt;
 dpkg-buildpackage -rfakeroot&lt;br /&gt;
&lt;br /&gt;
in the main &amp;lt;tt&amp;gt;darkradiant&amp;lt;/tt&amp;gt; directory. The .deb will be created in the parent directory.&lt;br /&gt;
&lt;br /&gt;
{{coding}}&lt;br /&gt;
{{darkradiant|sort=Compilation}}&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=DarkRadiant_coding_standards&amp;diff=26681</id>
		<title>DarkRadiant coding standards</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=DarkRadiant_coding_standards&amp;diff=26681"/>
		<updated>2020-08-26T08:31:35Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: Additional shared ptr typedef option&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Although DarkRadiant was forked from GTKRadiant, the style of legacy GTKRadiant code should &#039;&#039;not&#039;&#039; be used as an example for new code. Therefore these &#039;&#039;&#039;coding standards&#039;&#039;&#039; should be used for new code, in order to maximise readability for developers.&lt;br /&gt;
&lt;br /&gt;
==Indentation==&lt;br /&gt;
&lt;br /&gt;
* Prefer 4-space indentation in new code. However, when editing legacy code which is using a different indentation style, it is acceptable to maintain consistency with the legacy code rather than reformatting. Try to avoid mixing tabs and spaces within the same file as this can break alignment when viewing diffs.&lt;br /&gt;
* Function and method bodies should use either the [https://en.wikipedia.org/wiki/Indentation_style#Allman_style Allman] or [https://en.wikipedia.org/wiki/Indentation_style#K&amp;amp;R_styleK&amp;amp;R K&amp;amp;R] brace styles, and where possible the opening brace should be in column 0. This enables developers using Vim to make use of the &amp;quot;[[&amp;quot; shortcut to jump to the beginning of the method.&lt;br /&gt;
&lt;br /&gt;
==Naming conventions==&lt;br /&gt;
&lt;br /&gt;
* All new code should be in a namespace, such as &#039;&#039;&#039;ui&#039;&#039;&#039; for UI-related code or &#039;&#039;&#039;model&#039;&#039;&#039; for code dealing with models.&lt;br /&gt;
* Class names should begin with a capital letter and capitalise each word: &#039;&#039;&#039;RenderablePicoModel&#039;&#039;&#039;, &#039;&#039;&#039;TextMenuItem&#039;&#039;&#039;&lt;br /&gt;
* Classes represent &amp;quot;things&amp;quot;, therefore they should be named after nouns not verbs: &#039;&#039;&#039;ModuleLoader&#039;&#039;&#039; rather than &#039;&#039;&#039;LoadModule&#039;&#039;&#039;.&lt;br /&gt;
* Each class should be in a file pair with file names matching the class name: &#039;&#039;&#039;MyClass&#039;&#039;&#039; is contained in &#039;&#039;&#039;MyClass.h&#039;&#039;&#039; and &#039;&#039;&#039;MyClass.cpp&#039;&#039;&#039;. Local classes used in a single .cpp file may be defined within that .cpp file. It is also acceptable to define trivial data structures returned by methods in the header file declaring the method, if that data structure is not used elsewhere.&lt;br /&gt;
* Method names and local variables should start with a lowercase letter, with subsequent words using camelcase: &#039;&#039;&#039;start()&#039;&#039;&#039;, &#039;&#039;&#039;getDataStructure()&#039;&#039;&#039;. With wxWidgets, however, the convention is different — methods begin with capital letters just like class names. When writing code that is tightly bound to wxWidgets, it is acceptable to use this same style for methods (but please be consistent).&lt;br /&gt;
* Member variables should begin with an underscore: &#039;&#039;&#039;_widget&#039;&#039;&#039;. Do not use the &amp;quot;m_name&amp;quot; convention in new code, as this is harder to read.&lt;br /&gt;
&lt;br /&gt;
===Typedefs===&lt;br /&gt;
Using the typedef keyword can improve readability and save typing by providing a simple name for a more complex data structure, however inappropriate use can also reduce readibility by forcing the reader to look up numerous typedefs which do no more than rename a standard type.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 typedef std::vector&amp;lt;std::string&amp;gt; StringList&lt;br /&gt;
&lt;br /&gt;
is a good typedef, because it is obvious what the type means, it allows easy editing if it were required to change it to a std::list rather than a vector (for example), and it makes it easy to work with derived types (&#039;&#039;&#039;StringList::iterator&#039;&#039;&#039; rather than &#039;&#039;&#039;std::vector&amp;lt;std::string&amp;gt;::iterator&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
On the other hand,&lt;br /&gt;
&lt;br /&gt;
 typedef float ShaderScaleParameter&lt;br /&gt;
&lt;br /&gt;
is a bad typedef. It provides no improved readability over simply using the primitive type, and gives the impression to a reader unfamiliar with the code that a more complex data structure is being used.&lt;br /&gt;
&lt;br /&gt;
* Never use typedefs to rename a standard type (unless there is a specific purpose, like providing a standard public typedef as part of a functor interface).&lt;br /&gt;
&lt;br /&gt;
==General code structure==&lt;br /&gt;
&lt;br /&gt;
* Always use Object-Oriented design methods wherever possible. Think in terms of objects which define methods to act on those objects, rather than C-style functions that process data structures passed as arguments. Non-member functions are OK for minor tasks, as long as they are within a namespace rather than at global scope.&lt;br /&gt;
* Never use global variables (non-constants at file or global scope). Constants at file scope are acceptable, either as primitive types or composite data structures (e.g. vectors or maps) whose content never needs to change.&lt;br /&gt;
&lt;br /&gt;
===Data types and objects===&lt;br /&gt;
&lt;br /&gt;
* Always use STL or other library objects (e.g. wxWidgets), rather than home-grown reinventions of the same thing. Use &#039;&#039;&#039;std::string&#039;&#039;&#039; for string variables, and &#039;&#039;&#039;std::map&#039;&#039;&#039; in favour of &#039;&#039;&#039;HashedCache&#039;&#039;&#039;. Classes that use these home-grown versions should be modified so as not to use them if at all possible, and eventually they will be removed.&lt;br /&gt;
* Note that &#039;&#039;we are no longer using Boost&#039;&#039;, since modern C++ provides almost all of the Boost facilities we previously needed (shared pointers, std::function etc), and avoiding Boost greatly simplifies the Windows build. If you are developing on a platform where Boost is easily available, be careful not to accidentally add a new Boost usage which will break Windows compilation.&lt;br /&gt;
* Do not use &#039;&#039;&#039;const char*&#039;&#039;&#039; objects except where necessary to pass to a library function (such as the C-based GTK library), or where a string constant is needed. Functions that accept or return strings should use &#039;&#039;&#039;std::string&#039;&#039;&#039; instead.&lt;br /&gt;
&lt;br /&gt;
=== Data allocation ===&lt;br /&gt;
Use &#039;&#039;&#039;std::shared_ptr&#039;&#039;&#039;s (or &#039;&#039;&#039;std::unqiue_ptr&#039;&#039;&#039;) wherever you need to allocate objects on the heap, as these objects auto-destruct when the last ptr instance is destroyed. Use &#039;&#039;&#039;new&#039;&#039;&#039; only if you need tight control of when the object should be removed from the heap, or to instantiate GUI classes that auto-destruct in their callbacks.&lt;br /&gt;
&lt;br /&gt;
A shared ptr should be named like this (Ptr suffix):&lt;br /&gt;
 typedef std::shared_ptr&amp;lt;MyClass&amp;gt; MyClassPtr;&lt;br /&gt;
&lt;br /&gt;
It is also acceptable to add the shared ptr typedef inside the class itself, e.g.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
{&lt;br /&gt;
    using Ptr = std::shared_ptr&amp;lt;MyClass&amp;gt;&lt;br /&gt;
};&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which allows the type to be referenced as &#039;&#039;&#039;MyClass::Ptr&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Static variables===&lt;br /&gt;
&lt;br /&gt;
If a static variable is required, encapsulate it within a small method that returns a reference to the static, e.g.&lt;br /&gt;
 MyObject&amp;amp; staticInstance() {&lt;br /&gt;
     static MyObject _instance;&lt;br /&gt;
     return _instance;&lt;br /&gt;
 }&lt;br /&gt;
This ensures that the static instance will be initialised when the method is first called, which avoids problems with the undefinability of static initialisation.&lt;br /&gt;
&lt;br /&gt;
===Access===&lt;br /&gt;
&lt;br /&gt;
* All data members should be private, except in data structures which provide no methods (other than constructors).&lt;br /&gt;
* Members which need to be accessed externally should be provided with get/set methods. This is an important part of separating interface from implementation, since a get/set method might actually modify more than one member variable, or even perform a calculation without referencing members at all.&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
&lt;br /&gt;
Exactly where and how to place comments is a matter of personal preference. However, at the very least, &#039;&#039;all&#039;&#039; public methods and functions should be commented in their associated header file, with details of their parameters, return value and function, along with any other important information (such as prerequisites for calling the function, who is responsible for destroying returned data etc.).&lt;br /&gt;
&lt;br /&gt;
{{darkradiant-internal|sort=Coding}}&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=DarkRadiant_coding_standards&amp;diff=26680</id>
		<title>DarkRadiant coding standards</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=DarkRadiant_coding_standards&amp;diff=26680"/>
		<updated>2020-08-26T08:26:49Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: Add note about not using Boost&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Although DarkRadiant was forked from GTKRadiant, the style of legacy GTKRadiant code should &#039;&#039;not&#039;&#039; be used as an example for new code. Therefore these &#039;&#039;&#039;coding standards&#039;&#039;&#039; should be used for new code, in order to maximise readability for developers.&lt;br /&gt;
&lt;br /&gt;
==Indentation==&lt;br /&gt;
&lt;br /&gt;
* Prefer 4-space indentation in new code. However, when editing legacy code which is using a different indentation style, it is acceptable to maintain consistency with the legacy code rather than reformatting. Try to avoid mixing tabs and spaces within the same file as this can break alignment when viewing diffs.&lt;br /&gt;
* Function and method bodies should use either the [https://en.wikipedia.org/wiki/Indentation_style#Allman_style Allman] or [https://en.wikipedia.org/wiki/Indentation_style#K&amp;amp;R_styleK&amp;amp;R K&amp;amp;R] brace styles, and where possible the opening brace should be in column 0. This enables developers using Vim to make use of the &amp;quot;[[&amp;quot; shortcut to jump to the beginning of the method.&lt;br /&gt;
&lt;br /&gt;
==Naming conventions==&lt;br /&gt;
&lt;br /&gt;
* All new code should be in a namespace, such as &#039;&#039;&#039;ui&#039;&#039;&#039; for UI-related code or &#039;&#039;&#039;model&#039;&#039;&#039; for code dealing with models.&lt;br /&gt;
* Class names should begin with a capital letter and capitalise each word: &#039;&#039;&#039;RenderablePicoModel&#039;&#039;&#039;, &#039;&#039;&#039;TextMenuItem&#039;&#039;&#039;&lt;br /&gt;
* Classes represent &amp;quot;things&amp;quot;, therefore they should be named after nouns not verbs: &#039;&#039;&#039;ModuleLoader&#039;&#039;&#039; rather than &#039;&#039;&#039;LoadModule&#039;&#039;&#039;.&lt;br /&gt;
* Each class should be in a file pair with file names matching the class name: &#039;&#039;&#039;MyClass&#039;&#039;&#039; is contained in &#039;&#039;&#039;MyClass.h&#039;&#039;&#039; and &#039;&#039;&#039;MyClass.cpp&#039;&#039;&#039;. Local classes used in a single .cpp file may be defined within that .cpp file. It is also acceptable to define trivial data structures returned by methods in the header file declaring the method, if that data structure is not used elsewhere.&lt;br /&gt;
* Method names and local variables should start with a lowercase letter, with subsequent words using camelcase: &#039;&#039;&#039;start()&#039;&#039;&#039;, &#039;&#039;&#039;getDataStructure()&#039;&#039;&#039;. With wxWidgets, however, the convention is different — methods begin with capital letters just like class names. When writing code that is tightly bound to wxWidgets, it is acceptable to use this same style for methods (but please be consistent).&lt;br /&gt;
* Member variables should begin with an underscore: &#039;&#039;&#039;_widget&#039;&#039;&#039;. Do not use the &amp;quot;m_name&amp;quot; convention in new code, as this is harder to read.&lt;br /&gt;
&lt;br /&gt;
===Typedefs===&lt;br /&gt;
Using the typedef keyword can improve readability and save typing by providing a simple name for a more complex data structure, however inappropriate use can also reduce readibility by forcing the reader to look up numerous typedefs which do no more than rename a standard type.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 typedef std::vector&amp;lt;std::string&amp;gt; StringList&lt;br /&gt;
&lt;br /&gt;
is a good typedef, because it is obvious what the type means, it allows easy editing if it were required to change it to a std::list rather than a vector (for example), and it makes it easy to work with derived types (&#039;&#039;&#039;StringList::iterator&#039;&#039;&#039; rather than &#039;&#039;&#039;std::vector&amp;lt;std::string&amp;gt;::iterator&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
On the other hand,&lt;br /&gt;
&lt;br /&gt;
 typedef float ShaderScaleParameter&lt;br /&gt;
&lt;br /&gt;
is a bad typedef. It provides no improved readability over simply using the primitive type, and gives the impression to a reader unfamiliar with the code that a more complex data structure is being used.&lt;br /&gt;
&lt;br /&gt;
* Never use typedefs to rename a standard type (unless there is a specific purpose, like providing a standard public typedef as part of a functor interface).&lt;br /&gt;
&lt;br /&gt;
==General code structure==&lt;br /&gt;
&lt;br /&gt;
* Always use Object-Oriented design methods wherever possible. Think in terms of objects which define methods to act on those objects, rather than C-style functions that process data structures passed as arguments. Non-member functions are OK for minor tasks, as long as they are within a namespace rather than at global scope.&lt;br /&gt;
* Never use global variables (non-constants at file or global scope). Constants at file scope are acceptable, either as primitive types or composite data structures (e.g. vectors or maps) whose content never needs to change.&lt;br /&gt;
&lt;br /&gt;
===Data types and objects===&lt;br /&gt;
&lt;br /&gt;
* Always use STL or other library objects (e.g. wxWidgets), rather than home-grown reinventions of the same thing. Use &#039;&#039;&#039;std::string&#039;&#039;&#039; for string variables, and &#039;&#039;&#039;std::map&#039;&#039;&#039; in favour of &#039;&#039;&#039;HashedCache&#039;&#039;&#039;. Classes that use these home-grown versions should be modified so as not to use them if at all possible, and eventually they will be removed.&lt;br /&gt;
* Note that &#039;&#039;we are no longer using Boost&#039;&#039;, since modern C++ provides almost all of the Boost facilities we previously needed (shared pointers, std::function etc), and avoiding Boost greatly simplifies the Windows build. If you are developing on a platform where Boost is easily available, be careful not to accidentally add a new Boost usage which will break Windows compilation.&lt;br /&gt;
* Do not use &#039;&#039;&#039;const char*&#039;&#039;&#039; objects except where necessary to pass to a library function (such as the C-based GTK library), or where a string constant is needed. Functions that accept or return strings should use &#039;&#039;&#039;std::string&#039;&#039;&#039; instead.&lt;br /&gt;
&lt;br /&gt;
=== Data allocation ===&lt;br /&gt;
Use &#039;&#039;&#039;std::shared_ptr&#039;&#039;&#039;s (or &#039;&#039;&#039;std::unqiue_ptr&#039;&#039;&#039;) wherever you need to allocate objects on the heap, as these objects auto-destruct when the last ptr instance is destroyed. Use &#039;&#039;&#039;new&#039;&#039;&#039; only if you need tight control of when the object should be removed from the heap, or to instantiate GUI classes that auto-destruct in their callbacks.&lt;br /&gt;
&lt;br /&gt;
A shared ptr should be named like this (Ptr suffix):&lt;br /&gt;
 typedef std::shared_ptr&amp;lt;MyClass&amp;gt; MyClassPtr;&lt;br /&gt;
&lt;br /&gt;
===Static variables===&lt;br /&gt;
&lt;br /&gt;
If a static variable is required, encapsulate it within a small method that returns a reference to the static, e.g.&lt;br /&gt;
 MyObject&amp;amp; staticInstance() {&lt;br /&gt;
     static MyObject _instance;&lt;br /&gt;
     return _instance;&lt;br /&gt;
 }&lt;br /&gt;
This ensures that the static instance will be initialised when the method is first called, which avoids problems with the undefinability of static initialisation.&lt;br /&gt;
&lt;br /&gt;
===Access===&lt;br /&gt;
&lt;br /&gt;
* All data members should be private, except in data structures which provide no methods (other than constructors).&lt;br /&gt;
* Members which need to be accessed externally should be provided with get/set methods. This is an important part of separating interface from implementation, since a get/set method might actually modify more than one member variable, or even perform a calculation without referencing members at all.&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
&lt;br /&gt;
Exactly where and how to place comments is a matter of personal preference. However, at the very least, &#039;&#039;all&#039;&#039; public methods and functions should be commented in their associated header file, with details of their parameters, return value and function, along with any other important information (such as prerequisites for calling the function, who is responsible for destroying returned data etc.).&lt;br /&gt;
&lt;br /&gt;
{{darkradiant-internal|sort=Coding}}&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=DarkRadiant_coding_standards&amp;diff=26679</id>
		<title>DarkRadiant coding standards</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=DarkRadiant_coding_standards&amp;diff=26679"/>
		<updated>2020-08-26T08:22:54Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: Update certain guidelines, add section on indentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Although DarkRadiant was forked from GTKRadiant, the style of legacy GTKRadiant code should &#039;&#039;not&#039;&#039; be used as an example for new code. Therefore these &#039;&#039;&#039;coding standards&#039;&#039;&#039; should be used for new code, in order to maximise readability for developers.&lt;br /&gt;
&lt;br /&gt;
==Indentation==&lt;br /&gt;
&lt;br /&gt;
* Prefer 4-space indentation in new code. However, when editing legacy code which is using a different indentation style, it is acceptable to maintain consistency with the legacy code rather than reformatting. Try to avoid mixing tabs and spaces within the same file as this can break alignment when viewing diffs.&lt;br /&gt;
* Function and method bodies should use either the [https://en.wikipedia.org/wiki/Indentation_style#Allman_style Allman] or [https://en.wikipedia.org/wiki/Indentation_style#K&amp;amp;R_styleK&amp;amp;R K&amp;amp;R] brace styles, and where possible the opening brace should be in column 0. This enables developers using Vim to make use of the &amp;quot;[[&amp;quot; shortcut to jump to the beginning of the method.&lt;br /&gt;
&lt;br /&gt;
==Naming conventions==&lt;br /&gt;
&lt;br /&gt;
* All new code should be in a namespace, such as &#039;&#039;&#039;ui&#039;&#039;&#039; for UI-related code or &#039;&#039;&#039;model&#039;&#039;&#039; for code dealing with models.&lt;br /&gt;
* Class names should begin with a capital letter and capitalise each word: &#039;&#039;&#039;RenderablePicoModel&#039;&#039;&#039;, &#039;&#039;&#039;TextMenuItem&#039;&#039;&#039;&lt;br /&gt;
* Classes represent &amp;quot;things&amp;quot;, therefore they should be named after nouns not verbs: &#039;&#039;&#039;ModuleLoader&#039;&#039;&#039; rather than &#039;&#039;&#039;LoadModule&#039;&#039;&#039;.&lt;br /&gt;
* Each class should be in a file pair with file names matching the class name: &#039;&#039;&#039;MyClass&#039;&#039;&#039; is contained in &#039;&#039;&#039;MyClass.h&#039;&#039;&#039; and &#039;&#039;&#039;MyClass.cpp&#039;&#039;&#039;. Local classes used in a single .cpp file may be defined within that .cpp file. It is also acceptable to define trivial data structures returned by methods in the header file declaring the method, if that data structure is not used elsewhere.&lt;br /&gt;
* Method names and local variables should start with a lowercase letter, with subsequent words using camelcase: &#039;&#039;&#039;start()&#039;&#039;&#039;, &#039;&#039;&#039;getDataStructure()&#039;&#039;&#039;. With wxWidgets, however, the convention is different — methods begin with capital letters just like class names. When writing code that is tightly bound to wxWidgets, it is acceptable to use this same style for methods (but please be consistent).&lt;br /&gt;
* Member variables should begin with an underscore: &#039;&#039;&#039;_widget&#039;&#039;&#039;. Do not use the &amp;quot;m_name&amp;quot; convention in new code, as this is harder to read.&lt;br /&gt;
&lt;br /&gt;
===Typedefs===&lt;br /&gt;
Using the typedef keyword can improve readability and save typing by providing a simple name for a more complex data structure, however inappropriate use can also reduce readibility by forcing the reader to look up numerous typedefs which do no more than rename a standard type.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 typedef std::vector&amp;lt;std::string&amp;gt; StringList&lt;br /&gt;
&lt;br /&gt;
is a good typedef, because it is obvious what the type means, it allows easy editing if it were required to change it to a std::list rather than a vector (for example), and it makes it easy to work with derived types (&#039;&#039;&#039;StringList::iterator&#039;&#039;&#039; rather than &#039;&#039;&#039;std::vector&amp;lt;std::string&amp;gt;::iterator&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
On the other hand,&lt;br /&gt;
&lt;br /&gt;
 typedef float ShaderScaleParameter&lt;br /&gt;
&lt;br /&gt;
is a bad typedef. It provides no improved readability over simply using the primitive type, and gives the impression to a reader unfamiliar with the code that a more complex data structure is being used.&lt;br /&gt;
&lt;br /&gt;
* Never use typedefs to rename a standard type (unless there is a specific purpose, like providing a standard public typedef as part of a functor interface).&lt;br /&gt;
&lt;br /&gt;
==General code structure==&lt;br /&gt;
&lt;br /&gt;
* Always use Object-Oriented design methods wherever possible. Think in terms of objects which define methods to act on those objects, rather than C-style functions that process data structures passed as arguments. Non-member functions are OK for minor tasks, as long as they are within a namespace rather than at global scope.&lt;br /&gt;
* Never use global variables (non-constants at file or global scope). Constants at file scope are acceptable, either as primitive types or composite data structures (e.g. vectors or maps) whose content never needs to change.&lt;br /&gt;
&lt;br /&gt;
===Data types and objects===&lt;br /&gt;
&lt;br /&gt;
* Always use STL or Boost objects, rather than home-grown reinventions of the same thing. Use &#039;&#039;&#039;std::string&#039;&#039;&#039; for string variables, and &#039;&#039;&#039;std::map&#039;&#039;&#039; in favour of &#039;&#039;&#039;HashedCache&#039;&#039;&#039;. Classes that use these home-grown versions should be modified so as not to use them if at all possible, and eventually they will be removed.&lt;br /&gt;
* Do not use &#039;&#039;&#039;const char*&#039;&#039;&#039; objects except where necessary to pass to a library function (such as the C-based GTK library), or where a string constant is needed. Functions that accept or return strings should use &#039;&#039;&#039;std::string&#039;&#039;&#039; instead.&lt;br /&gt;
&lt;br /&gt;
=== Data allocation ===&lt;br /&gt;
Use &#039;&#039;&#039;std::shared_ptr&#039;&#039;&#039;s (or &#039;&#039;&#039;std::unqiue_ptr&#039;&#039;&#039;) wherever you need to allocate objects on the heap, as these objects auto-destruct when the last ptr instance is destroyed. Use &#039;&#039;&#039;new&#039;&#039;&#039; only if you need tight control of when the object should be removed from the heap, or to instantiate GUI classes that auto-destruct in their callbacks.&lt;br /&gt;
&lt;br /&gt;
A shared ptr should be named like this (Ptr suffix):&lt;br /&gt;
 typedef std::shared_ptr&amp;lt;MyClass&amp;gt; MyClassPtr;&lt;br /&gt;
&lt;br /&gt;
===Static variables===&lt;br /&gt;
&lt;br /&gt;
If a static variable is required, encapsulate it within a small method that returns a reference to the static, e.g.&lt;br /&gt;
 MyObject&amp;amp; staticInstance() {&lt;br /&gt;
     static MyObject _instance;&lt;br /&gt;
     return _instance;&lt;br /&gt;
 }&lt;br /&gt;
This ensures that the static instance will be initialised when the method is first called, which avoids problems with the undefinability of static initialisation.&lt;br /&gt;
&lt;br /&gt;
===Access===&lt;br /&gt;
&lt;br /&gt;
* All data members should be private, except in data structures which provide no methods (other than constructors).&lt;br /&gt;
* Members which need to be accessed externally should be provided with get/set methods. This is an important part of separating interface from implementation, since a get/set method might actually modify more than one member variable, or even perform a calculation without referencing members at all.&lt;br /&gt;
&lt;br /&gt;
===Comments===&lt;br /&gt;
&lt;br /&gt;
Exactly where and how to place comments is a matter of personal preference. However, at the very least, &#039;&#039;all&#039;&#039; public methods and functions should be commented in their associated header file, with details of their parameters, return value and function, along with any other important information (such as prerequisites for calling the function, who is responsible for destroying returned data etc.).&lt;br /&gt;
&lt;br /&gt;
{{darkradiant-internal|sort=Coding}}&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=15433</id>
		<title>DarkRadiant - Compiling in Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=15433"/>
		<updated>2012-07-11T15:52:45Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: Added update information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Install Libraries and Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 11.10 ===&lt;br /&gt;
Copy and paste the following into a terminal (at least that&#039;s what worked in the beta2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install automake libtool g++ zlib1g-dev libjpeg62-dev libxml2-dev libgtkmm-2.4-dev libglew1.6-dev libalut-dev libvorbis-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libgtksourceviewmm-2.0-dev libgtkglextmm-x11-1.2-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 10.10 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install automake libtool g++ libgtkmm-2.4-dev libjpeg62-dev libgtkglextmm-x11-1.2-dev libxml2-dev libglew1.5-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libalut-dev libvorbis-dev libgtksourceviewmm-2.0-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.10 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install g++ libboost1.38-dev libgtk2.0-dev libglew1.5-dev libgtkglext1-dev libxml2-dev libalut-dev libvorbis-dev libboost-python-dev python-dev libgtksourceview2.0-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python headers are needed for the optional scripting plugin.&lt;br /&gt;
&lt;br /&gt;
Adjust the configure.ac file, as Ubuntu 9.10 appends the postfix -mt for each boost library installed in /usr/lib:&lt;br /&gt;
 boost_regex =&amp;gt; boost_regex-mt&lt;br /&gt;
 boost_filesystem =&amp;gt; boost_filesystem-mt&lt;br /&gt;
 boost_system =&amp;gt; boost_system-mt&lt;br /&gt;
 boost_python =&amp;gt; boost_python-mt&lt;br /&gt;
&lt;br /&gt;
 # Boost.Regex&lt;br /&gt;
 AC_CHECK_LIB([boost_regex-mt], [main],&lt;br /&gt;
              [REGEX_LIBS=&#039;-lboost_regex-mt&#039;],&lt;br /&gt;
              [AC_MSG_ERROR([Boost.Regex not found])])&lt;br /&gt;
 AC_SUBST([REGEX_LIBS])&lt;br /&gt;
 &lt;br /&gt;
 # Boost.Filesystem&lt;br /&gt;
 AC_CHECK_LIB([boost_filesystem-mt], [main],&lt;br /&gt;
              [BOOST_FILESYSTEM_LIBS=&#039;-lboost_filesystem-mt&#039;],&lt;br /&gt;
              [AC_MSG_ERROR([Boost.Filesystem not found])])&lt;br /&gt;
 AC_SUBST([BOOST_FILESYSTEM_LIBS])&lt;br /&gt;
 &lt;br /&gt;
 # Boost.System&lt;br /&gt;
 AC_CHECK_LIB([boost_system-mt], [main],&lt;br /&gt;
              [BOOST_SYSTEM_LIBS=&#039;-lboost_system-mt&#039;],&lt;br /&gt;
              [AC_MSG_ERROR([Boost.System not found])])&lt;br /&gt;
 AC_SUBST([BOOST_SYSTEM_LIBS])&lt;br /&gt;
&lt;br /&gt;
Same for the Python check below in configure.ac:&lt;br /&gt;
 AC_CHECK_LIB([boost_python-mt], [main],&lt;br /&gt;
                 [BOOST_PYTHON_LIBS=&#039;-lboost_python-mt&#039;],&lt;br /&gt;
                 [script_module=&#039;&#039;])&lt;br /&gt;
Then re-run ./autogen.sh and ./configure&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 8.04 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install g++ libboost-dev libboost-regex-dev libgtk2.0-dev libglew1.5-dev libgtkglext1-dev libxml2-dev libboost-serialization-dev libboost-filesystem-dev libboost-date-time-dev libalut-dev libvorbis-dev libboost-python-dev python-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python headers are needed for the optional scripting plugin.&lt;br /&gt;
&lt;br /&gt;
In the terminal, Ctrl Shift V is used for pasting instead of Ctrl V.&lt;br /&gt;
&lt;br /&gt;
=== Fedora 15 ===&lt;br /&gt;
Open a console and type:&lt;br /&gt;
 sudo yum install gcc gcc-c++ automake zlib-devel libjpeg-turbo-devel libxml2-devel glew-devel boost-devel&lt;br /&gt;
 sudo yum install gtk2-devel gtkmm24-devel gtkglextmm-devel gtksourceviewmm-devel libvorbis-devel freealut-devel python-devel&lt;br /&gt;
&lt;br /&gt;
== Obtain the source ==&lt;br /&gt;
&lt;br /&gt;
Install the &#039;&#039;&#039;git&#039;&#039;&#039; client. On Ubuntu this can be done via the Synaptic Manager or the command line:&lt;br /&gt;
 sudo apt-get install git&lt;br /&gt;
Fedora users can use this yum command line:&lt;br /&gt;
 sudo yum install git&lt;br /&gt;
Change to the directory where you want the source code to be in and then clone the Git repository with:&lt;br /&gt;
&lt;br /&gt;
 git clone git://github.com/orbweaver/DarkRadiant.git&lt;br /&gt;
&lt;br /&gt;
Once the initial clone is done, the source can be updated to the latest version from inside the working directory with:&lt;br /&gt;
&lt;br /&gt;
 git pull&lt;br /&gt;
&lt;br /&gt;
== Compile ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: in the past, DarkRadiant was built using SCons. This build system has now been removed in favour of the standard Automake build.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, make sure you have the automake toolchain downloaded.&lt;br /&gt;
&lt;br /&gt;
Debian/Ubuntu/Aptitude users:&lt;br /&gt;
 sudo apt-get install libtool autoconf&lt;br /&gt;
Fedora 15 users:&lt;br /&gt;
 sudo yum install libtool gettext-devel&lt;br /&gt;
Then run &lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
in your darkradiant folder.&lt;br /&gt;
&lt;br /&gt;
DarkRadiant employs an Autoconf/Automake build system under Linux as used in the majority of open-source projects. Compilation can be achieved using the standard&lt;br /&gt;
&lt;br /&gt;
 $ ./configure&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make install&lt;br /&gt;
&lt;br /&gt;
on most systems.&lt;br /&gt;
&lt;br /&gt;
By default, a release build will be created; if a debug build is required pass the &#039;&#039;&#039;--enable-debug&#039;&#039;&#039; option to the configure script.&lt;br /&gt;
&lt;br /&gt;
Other points to note about the configure process:&lt;br /&gt;
&lt;br /&gt;
* The DarkMod-specific plugins are not built by default. To enable these, pass &#039;&#039;&#039;--enable-darkmod-plugins&#039;&#039;&#039; to ./configure.&lt;br /&gt;
* The configure script autodetects required dependencies, and will conditionally-enable optional components of DarkRadiant (such as the sound plugin) based on what it finds.&lt;br /&gt;
* For quick testing of a DarkRadiant build, it is desirable to install it into a temporary location rather than the default of &#039;&#039;&#039;/usr/local&#039;&#039;&#039;; for this, simply pass a prefix option such as &#039;&#039;&#039;--prefix=/tmp/dr&#039;&#039;&#039; to configure, after which DarkRadiant will be installed in &#039;&#039;&#039;/tmp/dr/bin/darkradiant&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Multiprocessor Systems ===&lt;br /&gt;
You can pass the --jobs=N parameter to make:&lt;br /&gt;
 make --jobs=2&lt;br /&gt;
to use more than one processor for the compilation.&lt;br /&gt;
&lt;br /&gt;
=== Building a .deb package ===&lt;br /&gt;
&lt;br /&gt;
To build a Debian/Ubuntu package, simply run&lt;br /&gt;
&lt;br /&gt;
 dpkg-buildpackage -rfakeroot&lt;br /&gt;
&lt;br /&gt;
in the main &#039;&#039;&#039;darkradiant&#039;&#039;&#039; directory. The .deb will be created in the parent directory.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[DarkRadiant Linux Issues]]&lt;br /&gt;
&lt;br /&gt;
{{coding}}&lt;br /&gt;
{{darkradiant|sort=Compilation}}&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=15432</id>
		<title>DarkRadiant - Compiling in Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=15432"/>
		<updated>2012-07-11T15:51:42Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: Removed obsolete SVN commands&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Install Libraries and Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 11.10 ===&lt;br /&gt;
Copy and paste the following into a terminal (at least that&#039;s what worked in the beta2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install automake libtool g++ zlib1g-dev libjpeg62-dev libxml2-dev libgtkmm-2.4-dev libglew1.6-dev libalut-dev libvorbis-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libgtksourceviewmm-2.0-dev libgtkglextmm-x11-1.2-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 10.10 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install automake libtool g++ libgtkmm-2.4-dev libjpeg62-dev libgtkglextmm-x11-1.2-dev libxml2-dev libglew1.5-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libalut-dev libvorbis-dev libgtksourceviewmm-2.0-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.10 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install g++ libboost1.38-dev libgtk2.0-dev libglew1.5-dev libgtkglext1-dev libxml2-dev libalut-dev libvorbis-dev libboost-python-dev python-dev libgtksourceview2.0-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python headers are needed for the optional scripting plugin.&lt;br /&gt;
&lt;br /&gt;
Adjust the configure.ac file, as Ubuntu 9.10 appends the postfix -mt for each boost library installed in /usr/lib:&lt;br /&gt;
 boost_regex =&amp;gt; boost_regex-mt&lt;br /&gt;
 boost_filesystem =&amp;gt; boost_filesystem-mt&lt;br /&gt;
 boost_system =&amp;gt; boost_system-mt&lt;br /&gt;
 boost_python =&amp;gt; boost_python-mt&lt;br /&gt;
&lt;br /&gt;
 # Boost.Regex&lt;br /&gt;
 AC_CHECK_LIB([boost_regex-mt], [main],&lt;br /&gt;
              [REGEX_LIBS=&#039;-lboost_regex-mt&#039;],&lt;br /&gt;
              [AC_MSG_ERROR([Boost.Regex not found])])&lt;br /&gt;
 AC_SUBST([REGEX_LIBS])&lt;br /&gt;
 &lt;br /&gt;
 # Boost.Filesystem&lt;br /&gt;
 AC_CHECK_LIB([boost_filesystem-mt], [main],&lt;br /&gt;
              [BOOST_FILESYSTEM_LIBS=&#039;-lboost_filesystem-mt&#039;],&lt;br /&gt;
              [AC_MSG_ERROR([Boost.Filesystem not found])])&lt;br /&gt;
 AC_SUBST([BOOST_FILESYSTEM_LIBS])&lt;br /&gt;
 &lt;br /&gt;
 # Boost.System&lt;br /&gt;
 AC_CHECK_LIB([boost_system-mt], [main],&lt;br /&gt;
              [BOOST_SYSTEM_LIBS=&#039;-lboost_system-mt&#039;],&lt;br /&gt;
              [AC_MSG_ERROR([Boost.System not found])])&lt;br /&gt;
 AC_SUBST([BOOST_SYSTEM_LIBS])&lt;br /&gt;
&lt;br /&gt;
Same for the Python check below in configure.ac:&lt;br /&gt;
 AC_CHECK_LIB([boost_python-mt], [main],&lt;br /&gt;
                 [BOOST_PYTHON_LIBS=&#039;-lboost_python-mt&#039;],&lt;br /&gt;
                 [script_module=&#039;&#039;])&lt;br /&gt;
Then re-run ./autogen.sh and ./configure&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 8.04 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install g++ libboost-dev libboost-regex-dev libgtk2.0-dev libglew1.5-dev libgtkglext1-dev libxml2-dev libboost-serialization-dev libboost-filesystem-dev libboost-date-time-dev libalut-dev libvorbis-dev libboost-python-dev python-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python headers are needed for the optional scripting plugin.&lt;br /&gt;
&lt;br /&gt;
In the terminal, Ctrl Shift V is used for pasting instead of Ctrl V.&lt;br /&gt;
&lt;br /&gt;
=== Fedora 15 ===&lt;br /&gt;
Open a console and type:&lt;br /&gt;
 sudo yum install gcc gcc-c++ automake zlib-devel libjpeg-turbo-devel libxml2-devel glew-devel boost-devel&lt;br /&gt;
 sudo yum install gtk2-devel gtkmm24-devel gtkglextmm-devel gtksourceviewmm-devel libvorbis-devel freealut-devel python-devel&lt;br /&gt;
&lt;br /&gt;
== Obtain the source ==&lt;br /&gt;
&lt;br /&gt;
Install the &#039;&#039;&#039;git&#039;&#039;&#039; client. On Ubuntu this can be done via the Synaptic Manager or the command line:&lt;br /&gt;
 sudo apt-get install git&lt;br /&gt;
Fedora users can use this yum command line:&lt;br /&gt;
 sudo yum install git&lt;br /&gt;
Change to the directory where you want the source code to be in and then check the current version out of Git with:&lt;br /&gt;
&lt;br /&gt;
 git clone git://github.com/orbweaver/DarkRadiant.git&lt;br /&gt;
&lt;br /&gt;
== Compile ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: in the past, DarkRadiant was built using SCons. This build system has now been removed in favour of the standard Automake build.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, make sure you have the automake toolchain downloaded.&lt;br /&gt;
&lt;br /&gt;
Debian/Ubuntu/Aptitude users:&lt;br /&gt;
 sudo apt-get install libtool autoconf&lt;br /&gt;
Fedora 15 users:&lt;br /&gt;
 sudo yum install libtool gettext-devel&lt;br /&gt;
Then run &lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
in your darkradiant folder.&lt;br /&gt;
&lt;br /&gt;
DarkRadiant employs an Autoconf/Automake build system under Linux as used in the majority of open-source projects. Compilation can be achieved using the standard&lt;br /&gt;
&lt;br /&gt;
 $ ./configure&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make install&lt;br /&gt;
&lt;br /&gt;
on most systems.&lt;br /&gt;
&lt;br /&gt;
By default, a release build will be created; if a debug build is required pass the &#039;&#039;&#039;--enable-debug&#039;&#039;&#039; option to the configure script.&lt;br /&gt;
&lt;br /&gt;
Other points to note about the configure process:&lt;br /&gt;
&lt;br /&gt;
* The DarkMod-specific plugins are not built by default. To enable these, pass &#039;&#039;&#039;--enable-darkmod-plugins&#039;&#039;&#039; to ./configure.&lt;br /&gt;
* The configure script autodetects required dependencies, and will conditionally-enable optional components of DarkRadiant (such as the sound plugin) based on what it finds.&lt;br /&gt;
* For quick testing of a DarkRadiant build, it is desirable to install it into a temporary location rather than the default of &#039;&#039;&#039;/usr/local&#039;&#039;&#039;; for this, simply pass a prefix option such as &#039;&#039;&#039;--prefix=/tmp/dr&#039;&#039;&#039; to configure, after which DarkRadiant will be installed in &#039;&#039;&#039;/tmp/dr/bin/darkradiant&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Multiprocessor Systems ===&lt;br /&gt;
You can pass the --jobs=N parameter to make:&lt;br /&gt;
 make --jobs=2&lt;br /&gt;
to use more than one processor for the compilation.&lt;br /&gt;
&lt;br /&gt;
=== Building a .deb package ===&lt;br /&gt;
&lt;br /&gt;
To build a Debian/Ubuntu package, simply run&lt;br /&gt;
&lt;br /&gt;
 dpkg-buildpackage -rfakeroot&lt;br /&gt;
&lt;br /&gt;
in the main &#039;&#039;&#039;darkradiant&#039;&#039;&#039; directory. The .deb will be created in the parent directory.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[DarkRadiant Linux Issues]]&lt;br /&gt;
&lt;br /&gt;
{{coding}}&lt;br /&gt;
{{darkradiant|sort=Compilation}}&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=15431</id>
		<title>DarkRadiant - Compiling in Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=DarkRadiant_-_Compiling_in_Linux&amp;diff=15431"/>
		<updated>2012-07-11T15:50:41Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: Using git now not svn&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Install Libraries and Tools ==&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 11.10 ===&lt;br /&gt;
Copy and paste the following into a terminal (at least that&#039;s what worked in the beta2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install automake libtool g++ zlib1g-dev libjpeg62-dev libxml2-dev libgtkmm-2.4-dev libglew1.6-dev libalut-dev libvorbis-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libgtksourceviewmm-2.0-dev libgtkglextmm-x11-1.2-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 10.10 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install automake libtool g++ libgtkmm-2.4-dev libjpeg62-dev libgtkglextmm-x11-1.2-dev libxml2-dev libglew1.5-dev libboost-dev libboost-regex-dev libboost-filesystem-dev libboost-python-dev libalut-dev libvorbis-dev libgtksourceviewmm-2.0-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python and the gtksourceviewmm headers are needed for the optional scripting plugin. The alut and vorbis headers are used by the optional sound module.&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 9.10 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install g++ libboost1.38-dev libgtk2.0-dev libglew1.5-dev libgtkglext1-dev libxml2-dev libalut-dev libvorbis-dev libboost-python-dev python-dev libgtksourceview2.0-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python headers are needed for the optional scripting plugin.&lt;br /&gt;
&lt;br /&gt;
Adjust the configure.ac file, as Ubuntu 9.10 appends the postfix -mt for each boost library installed in /usr/lib:&lt;br /&gt;
 boost_regex =&amp;gt; boost_regex-mt&lt;br /&gt;
 boost_filesystem =&amp;gt; boost_filesystem-mt&lt;br /&gt;
 boost_system =&amp;gt; boost_system-mt&lt;br /&gt;
 boost_python =&amp;gt; boost_python-mt&lt;br /&gt;
&lt;br /&gt;
 # Boost.Regex&lt;br /&gt;
 AC_CHECK_LIB([boost_regex-mt], [main],&lt;br /&gt;
              [REGEX_LIBS=&#039;-lboost_regex-mt&#039;],&lt;br /&gt;
              [AC_MSG_ERROR([Boost.Regex not found])])&lt;br /&gt;
 AC_SUBST([REGEX_LIBS])&lt;br /&gt;
 &lt;br /&gt;
 # Boost.Filesystem&lt;br /&gt;
 AC_CHECK_LIB([boost_filesystem-mt], [main],&lt;br /&gt;
              [BOOST_FILESYSTEM_LIBS=&#039;-lboost_filesystem-mt&#039;],&lt;br /&gt;
              [AC_MSG_ERROR([Boost.Filesystem not found])])&lt;br /&gt;
 AC_SUBST([BOOST_FILESYSTEM_LIBS])&lt;br /&gt;
 &lt;br /&gt;
 # Boost.System&lt;br /&gt;
 AC_CHECK_LIB([boost_system-mt], [main],&lt;br /&gt;
              [BOOST_SYSTEM_LIBS=&#039;-lboost_system-mt&#039;],&lt;br /&gt;
              [AC_MSG_ERROR([Boost.System not found])])&lt;br /&gt;
 AC_SUBST([BOOST_SYSTEM_LIBS])&lt;br /&gt;
&lt;br /&gt;
Same for the Python check below in configure.ac:&lt;br /&gt;
 AC_CHECK_LIB([boost_python-mt], [main],&lt;br /&gt;
                 [BOOST_PYTHON_LIBS=&#039;-lboost_python-mt&#039;],&lt;br /&gt;
                 [script_module=&#039;&#039;])&lt;br /&gt;
Then re-run ./autogen.sh and ./configure&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 8.04 ===&lt;br /&gt;
Copy and paste the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install g++ libboost-dev libboost-regex-dev libgtk2.0-dev libglew1.5-dev libgtkglext1-dev libxml2-dev libboost-serialization-dev libboost-filesystem-dev libboost-date-time-dev libalut-dev libvorbis-dev libboost-python-dev python-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The python headers are needed for the optional scripting plugin.&lt;br /&gt;
&lt;br /&gt;
In the terminal, Ctrl Shift V is used for pasting instead of Ctrl V.&lt;br /&gt;
&lt;br /&gt;
=== Fedora 15 ===&lt;br /&gt;
Open a console and type:&lt;br /&gt;
 sudo yum install gcc gcc-c++ automake zlib-devel libjpeg-turbo-devel libxml2-devel glew-devel boost-devel&lt;br /&gt;
 sudo yum install gtk2-devel gtkmm24-devel gtkglextmm-devel gtksourceviewmm-devel libvorbis-devel freealut-devel python-devel&lt;br /&gt;
&lt;br /&gt;
== Obtain the source ==&lt;br /&gt;
&lt;br /&gt;
Install the &#039;&#039;&#039;git&#039;&#039;&#039; client. On Ubuntu this can be done via the Synaptic Manager or the command line:&lt;br /&gt;
 sudo apt-get install git&lt;br /&gt;
Fedora users can use this yum command line:&lt;br /&gt;
 sudo yum install git&lt;br /&gt;
Change to the directory where you want the source code to be in and then check the current version out of Git with:&lt;br /&gt;
&lt;br /&gt;
 git clone git://github.com/orbweaver/DarkRadiant.git&lt;br /&gt;
&lt;br /&gt;
== Compile ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: in the past, DarkRadiant was built using SCons. This build system has now been removed in favour of the standard Automake build.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First, make sure you have the automake toolchain downloaded.&lt;br /&gt;
&lt;br /&gt;
Debian/Ubuntu/Aptitude users:&lt;br /&gt;
 sudo apt-get install libtool autoconf&lt;br /&gt;
Fedora 15 users:&lt;br /&gt;
 sudo yum install libtool gettext-devel&lt;br /&gt;
Then run &lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
in your darkradiant folder.&lt;br /&gt;
&lt;br /&gt;
DarkRadiant employs an Autoconf/Automake build system under Linux as used in the majority of open-source projects. Compilation can be achieved using the standard&lt;br /&gt;
&lt;br /&gt;
 $ ./configure&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make install&lt;br /&gt;
&lt;br /&gt;
on most systems.&lt;br /&gt;
&lt;br /&gt;
By default, a release build will be created; if a debug build is required pass the &#039;&#039;&#039;--enable-debug&#039;&#039;&#039; option to the configure script.&lt;br /&gt;
&lt;br /&gt;
Other points to note about the configure process:&lt;br /&gt;
&lt;br /&gt;
* The DarkMod-specific plugins are not built by default. To enable these, pass &#039;&#039;&#039;--enable-darkmod-plugins&#039;&#039;&#039; to ./configure.&lt;br /&gt;
* The configure script autodetects required dependencies, and will conditionally-enable optional components of DarkRadiant (such as the sound plugin) based on what it finds.&lt;br /&gt;
* For quick testing of a DarkRadiant build, it is desirable to install it into a temporary location rather than the default of &#039;&#039;&#039;/usr/local&#039;&#039;&#039;; for this, simply pass a prefix option such as &#039;&#039;&#039;--prefix=/tmp/dr&#039;&#039;&#039; to configure, after which DarkRadiant will be installed in &#039;&#039;&#039;/tmp/dr/bin/darkradiant&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to update the source with the latest version from the SVN, just issue:&lt;br /&gt;
&lt;br /&gt;
 svn update&lt;br /&gt;
in the darkradiant source directory. &amp;lt;code&amp;gt;svn info&amp;lt;/code&amp;gt; shows you what version you currently have.&lt;br /&gt;
&lt;br /&gt;
=== Multiprocessor Systems ===&lt;br /&gt;
You can pass the --jobs=N parameter to make:&lt;br /&gt;
 make --jobs=2&lt;br /&gt;
to use more than one processor for the compilation.&lt;br /&gt;
&lt;br /&gt;
=== Building a .deb package ===&lt;br /&gt;
&lt;br /&gt;
To build a Debian/Ubuntu package, simply run&lt;br /&gt;
&lt;br /&gt;
 dpkg-buildpackage -rfakeroot&lt;br /&gt;
&lt;br /&gt;
in the main &#039;&#039;&#039;darkradiant&#039;&#039;&#039; directory. The .deb will be created in the parent directory.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[DarkRadiant Linux Issues]]&lt;br /&gt;
&lt;br /&gt;
{{coding}}&lt;br /&gt;
{{darkradiant|sort=Compilation}}&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Location_Settings&amp;diff=11728</id>
		<title>Location Settings</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Location_Settings&amp;diff=11728"/>
		<updated>2010-12-05T19:30:48Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: Another note about overriding ambient volumes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This article describes how to setup &#039;&#039;&#039;locations&#039;&#039;&#039; (also called &amp;quot;location zones&amp;quot; or &amp;quot;zones&amp;quot;) in your level, and then use these to:&lt;br /&gt;
&lt;br /&gt;
* fade to different ambient &#039;&#039;&#039;light levels&#039;&#039;&#039; for each zone&lt;br /&gt;
* fade between different ambient &#039;&#039;&#039;sounds&#039;&#039;&#039; in each zone&lt;br /&gt;
* run &#039;&#039;&#039;scripts&#039;&#039;&#039; automatically when the player enters or exits a zone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to use four types of entities in your map: &lt;br /&gt;
&lt;br /&gt;
* a special global entity (e.g. add only one, the position does not matter): &#039;&#039;&#039;atdm:location_settings&#039;&#039;&#039;&lt;br /&gt;
* a special global light entity named &#039;&#039;&#039;ambient_world&#039;&#039;&#039; &lt;br /&gt;
* multiple &#039;&#039;&#039;info_location&#039;&#039;&#039; and &#039;&#039;&#039;info_locationseparation&#039;&#039;&#039; entities&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;&lt;br /&gt;
:Note:  Two alternative ways to get ambient sounds in your map are using speakers ([[Adding ambient Sounds to your Map]]), and using triggers ([[Ambient Sounds - Zone (using triggers)]]).  Speakers are good if you only want your ambient to cover a definite radius and have a very simple setup.  Triggers are basically obsoleted by the method in this tutorial.  The only time you might still want to use a trigger-system is if you want a ambient sound to begin at a place where for some reason you can&#039;t create a portal to mark the zone boundary, but you can still have a trigger brush.  There are some issues with a trigger system, too (f.i. their CPU and memory usage), that make the method in this tutorial superior.  &lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The atdm:location_settings entity ==&lt;br /&gt;
&lt;br /&gt;
Create a &#039;&#039;&#039;atdm:location_settings&#039;&#039;&#039; entity in your blueroom (i.e., a room off to the side the player will never enter) or somewhere else in your map:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;{{RMB}} -&amp;gt; Create entity -&amp;gt; Darkmod -&amp;gt; Info -&amp;gt; atdm:location_settings&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Default values ===&lt;br /&gt;
&lt;br /&gt;
The location_settings entity takes a few &#039;&#039;default&#039;&#039; spawnargs related to the ambient light settings:&lt;br /&gt;
&lt;br /&gt;
* [[Location Settings#&amp;quot;ambient_light_fade_time&amp;quot;]]&lt;br /&gt;
* [[Location Settings#&amp;quot;ambient_light_fade_delay&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
For their meaning and values, please refer to their sections.&lt;br /&gt;
&lt;br /&gt;
=== update_period ===&lt;br /&gt;
&lt;br /&gt;
The spawnarg &#039;&#039;&#039;update_period&#039;&#039;&#039; specifies the time in seconds between updates. A good value is 0.2, e.g. 5 times per second. That avoids to run the script too often, and still allows seamless transitions.&lt;br /&gt;
&lt;br /&gt;
=== Sound Shaders ===&lt;br /&gt;
&lt;br /&gt;
In the entity&#039;s spawnargs, put the names of all the ambient sounds you want to play in your map.  (This pre-loads the sounds into the speaker so there isn&#039;t a pause when they start playing.)  Put it in one of these property/value forms (without the quote marks):&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;&amp;quot;snd_streets&amp;quot; &amp;quot;city_night01_loop_z&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;&amp;quot;snd_mansion&amp;quot; &amp;quot;sound/ambient/ambience/mansion_tense01a.ogg&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The left hand spawnarg should have a &amp;quot;snd_&amp;quot; prefix, and any name, but most useful is probably the name of the area it is for.  You&#039;ll use this name again when you place the location markers.  &lt;br /&gt;
&lt;br /&gt;
The right hand value points to the actual sound file that will play.  You can enter either the soundshader name, or the address where the sound file is (but see footnote).  You can see the soundshader names of ambient-ready sounds in the sub-folder &amp;quot;Darkmod/sound/tdm_ambient_ambience_zoned.sndshd&amp;quot;.   You can find the address of the sound files in &amp;quot;Darkmod/sound/ambient/ambience&amp;quot; (remember to start the address with &amp;quot;sound&amp;quot; in the spawnarg).  You can also listen to the sounds at that location.  They are are in .ogg format.  &lt;br /&gt;
&lt;br /&gt;
 Edit:Baddcog-Running through this first time, leaving notes to be fixed/editted later.&lt;br /&gt;
 Hint on sounds, you can also create a speaker (left-click&amp;gt;speaker) and it will give you a sound directory where you can play sound files and find the names. No searching through sound folders outside  of DR.&lt;br /&gt;
&lt;br /&gt;
:Note that it is very easy to add custom ambients with this system.  Just create a folder in your .pk4 (a .zip file renamed to .pk4) and name the folder &amp;quot;sound&amp;quot;, with another folder inside it named after your FM or an abbreviation.  Put your custom sound inside that second folder.  (E.g., I have a custom ambient named Frozen.ogg, and my FM&#039;s name is Patently Dangerous.  So in my .pk4 was &amp;quot;sound/patent/frozen.ogg&amp;quot;.  Note that ambients must be in either .ogg or .wav format. Now in your speaker_zone_ambient, just put the sound&#039;s address in the spawnarg (but see footnote).  In my case, I have &amp;quot;snd_warehouse&amp;quot; &amp;quot;sound/patent/frozen.ogg&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
It is worth noting that one special &amp;quot;sound&amp;quot; is already loaded by default.  &lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;&amp;quot;snd_silence&amp;quot; &amp;quot;silence&amp;quot;&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
You can see it if you check &amp;quot;Show Inherited Properties&amp;quot;.  This is the sound you use to turn &amp;quot;off&amp;quot; the ambient sounds playing, so there is silence in the zone.&lt;br /&gt;
&lt;br /&gt;
=== On Shader Names ===&lt;br /&gt;
&lt;br /&gt;
One footnote on the sound shader names. The &#039;&#039;shader tdm_ambient_ambience_zoned.sndshd&#039;&#039; has a special command (&amp;quot;leadin&amp;quot;) for its sounds that begins the ambient with a short pause.  This is to pre-empt a possible *pop* of sound for loud ambients which can occur when the player&#039;s system slows down (and only occasionally, at that), so the player never hears the pop.  (It&#039;s a quirk of how Doom3 does fade-ins; when you start a new sound, you have to rapidly fade it out first, like .001 seconds, then slowly fade back in.  But if the system slows and the ambient starts loud, it might stretch that .001 to something audible.)&lt;br /&gt;
 Edit:Baddcog- These seem to now have been appended with a _z if you look at sound names in speaker dialog.&lt;br /&gt;
&lt;br /&gt;
If you alternatively use the address or the shader name from &amp;quot;Darkmod/sound/tdm_ambient_ambience.sndshd&amp;quot; (which lack the &amp;quot;leadin&amp;quot; property) it will otherwise work fine, but you won&#039;t be protected from that occasional little pop (at least until we find another fix).  For ambients that start quietly or areas that won&#039;t slow the system down, it will probably never even be a problem and the player will never hear it, so using the address is fine, or using the tdm_ambient_ambience shader name if you don&#039;t want the tiny pause for whatever reason.  But if you want to control it, use the tdm_ambient_ambience_zoned name, and for a custom sound, to pre-empt the pop you&#039;ll need to use a custom shader with the &amp;quot;leadin&amp;quot; line.  Use the &amp;quot;Darkmod/sound/tdm_ambient_ambience_zoned.sndshd&amp;quot; as a template to do that, and name the custom shader file something like YourFMsName.sndshd, and put it in the &amp;quot;sound&amp;quot; folder in your .pk4.&lt;br /&gt;
&lt;br /&gt;
=== Sound Properties ===&lt;br /&gt;
&lt;br /&gt;
Regarding properties, the speaker (the &#039;&#039;&#039;atdm:location_settings&#039;&#039;&#039; entity is a speaker in disguise :) has by default the properties &amp;quot;omni&amp;quot;, &amp;quot;global&amp;quot;, and &amp;quot;looping&amp;quot; already turned on, so that all sounds played are heard everywhere, from no direction, and will loop.  If you change these properties (e.g., for one ambient) the change will apply to all ambients on the speaker.  So you probably don&#039;t want to turn these properties off.  &lt;br /&gt;
&lt;br /&gt;
&amp;quot;volume&amp;quot; is another potential property; but it has been left off as a default. You can change the volume of sounds played on the speaker with the property, but again it will apply to all the ambients on the speaker. It is better to defined individual &amp;quot;volume&amp;quot; spawnargs on each &#039;&#039;&#039;info_location&#039;&#039;&#039; entity, and there put the value between &amp;quot;-60&amp;quot; (&amp;quot;silence&amp;quot;) and &amp;quot;0&amp;quot; (full volume) in decibels (so around &amp;quot;-10&amp;quot; is about half volume).  See the section below on &amp;quot;volume&amp;quot; for more detail and some warnings about positive volume values.  &lt;br /&gt;
&lt;br /&gt;
Your entity will look like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Speaker4.jpg]]&lt;br /&gt;
&lt;br /&gt;
You are finished with the ambient sound part now.&lt;br /&gt;
&lt;br /&gt;
== The Ambient Light ==&lt;br /&gt;
&lt;br /&gt;
You need to create an ambient light in your level. This will cover the entire level, and provide a minimum default light for when there is no other light covering a surface:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;{{RMB}} -&amp;gt; Create light&#039;&#039;&#039;&lt;br /&gt;
# Move the light&#039;s origin to the center of your map, and drag it&#039;s size so that it covers your entire map, and then some more. Remember to increase the size of that light when you build more area into your map!&lt;br /&gt;
# Open the light inspector (default shortcut {{key|L}}) and set the light texture to &#039;&#039;&#039;lights/ambientlightnfo&#039;&#039;&#039;&lt;br /&gt;
# Set the color of the light to a reasonable default, f.i. &amp;quot;8 8 8&amp;quot; This value will be used when a zone has no other ambient light settings&lt;br /&gt;
# Open the entity inspector (default shortcut {{key|N}}) and set the name of the light to &#039;&#039;&#039;ambient_world&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last step is important!&lt;br /&gt;
&lt;br /&gt;
You are done now with the global ambient light.&lt;br /&gt;
&lt;br /&gt;
== The Location Entities ==&lt;br /&gt;
&lt;br /&gt;
Now you need to set up the location system so the game knows where the zones are, and their boundaries where changes will happen.  A location is basically any area that&#039;s closed in by brushes and marked portals and contains an info_location entity. Unlike a vis-portaled area (which is one area between [[vis_portals]], a.k.a. a &amp;quot;leaf&amp;quot;), a zone can cover more than one portaled area (&amp;quot;leaves&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
As an aside, locations are also used for setting the EAX properties in the area (e.g., the echo-y-ness of a big hall or cave, or the dullness of a small carpeted room).  So you have a good reason to have them even in addition to handling ambient sounds and lights.  &lt;br /&gt;
&lt;br /&gt;
=== info_locationseparator ===&lt;br /&gt;
&lt;br /&gt;
As I suggested above, you have to mark all the portals leading in and out of a zone by hand.  You do this with an entity called a &#039;&#039;&#039;info_locationseparator&#039;&#039;&#039;.  Create one so it touches the portal you want as a boundary.  &lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;{{RMB}} -&amp;gt; Create entity -&amp;gt; Darkmod -&amp;gt; Info -&amp;gt; info_locationseparator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t touch a portal with this entity, than it will not register in the game as the boundary to a new zone, and the zone will continue into the area on the other side of the portal.  This happens even if you have a second info_location (described below) on the other side (the game will just pick one and use that for the whole zone).  This can be a good thing because, say you have a mansion with 30 portals inside.  You can cover the whole area inside it by just marking the 2 or 3 portals leading into the mansion area through the doors and open windows, and everything inside that marked area will be counted as one location (just don&#039;t miss marking an exit, or have an un-portaled gap to the outside between brushes, or the location will leak outside.  It has to be hermetically sealed).  &lt;br /&gt;
&lt;br /&gt;
I have read discussion that a door touching a portal marks it as a location boundary, but in my experiments the door did not create a new location and I still had to use a info_locationseparator over the portal to register it as a boundary.  &lt;br /&gt;
&lt;br /&gt;
=== info_location ===&lt;br /&gt;
&lt;br /&gt;
Now, inside the zone you want to have, create an &#039;&#039;&#039;info_location&#039;&#039;&#039; entity:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;{{RMB}} -&amp;gt; Create entity -&amp;gt; Darkmod -&amp;gt; Info -&amp;gt; info_location&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Anywhere in the space of the zone is fine.  Name it the name of the zone you want (to make it easy to find when you push {{key|J}}).&lt;br /&gt;
&lt;br /&gt;
== Settings per location/zone ==&lt;br /&gt;
&lt;br /&gt;
On each info_location, you can set multiple spawnargs that adjust the light or sound for that location, as well&lt;br /&gt;
as run scripts. We cover them next:&lt;br /&gt;
&lt;br /&gt;
=== Ambient sound ===&lt;br /&gt;
&lt;br /&gt;
Now create a spawnarg property of &amp;quot;ambient&amp;quot; with the value being the speaker-name of the sound you used in the location_settings entity above (NOT the soundshader name or file name).  For example, &lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;&amp;quot;ambient&amp;quot;    &amp;quot;snd_streets&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will send a command to the location_settings (in its speaker capacity) to play the ambient it has registered under &amp;quot;snd_streets&amp;quot; that you entered.  When you enter a new zone, in turn, the new info_location sends a command to the speaker to turn off that ambient and start a new one.  &lt;br /&gt;
&lt;br /&gt;
If you wanted to have no ambient playing in the zone (and turn off any ambient started from another zone), you would use &amp;quot;snd_silence&amp;quot; as the value to command the speaker to turn off.  Also, if you have an info_location with no &amp;quot;ambient&amp;quot; value at all, it will also turn off the ambient (in the present version of this system).  That means if you make a new location but want the same ambient playing in it as the location next to it, you still need to add the ambient name for the already-playing ambient for it to continue playing into the new zone; otherwise it will turn off.  &lt;br /&gt;
&lt;br /&gt;
==== Examples ====&lt;br /&gt;
&lt;br /&gt;
Here are two info_locations on two sides of a portal, with an info_locationseparator touching the portal (more like piercing it), and with each info_location containing the name of the ambient that will play in its respective zone.&lt;br /&gt;
&lt;br /&gt;
[[Image:Snd_streets.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Snd_silence.jpg‎]]&lt;br /&gt;
&lt;br /&gt;
That&#039;s basically it.  The ambients will now turn on when you enter a zone and turn off when you enter a new zone, turning on the new ambient in that new zone.  If you open up the console, you should see a message saying that a new ambient is now playing in your current location, naming the ambient and location.&lt;br /&gt;
&lt;br /&gt;
=== Sound Fading ===&lt;br /&gt;
&lt;br /&gt;
Finally, there are a few other spawnargs on the info_locations that you usually don&#039;t have to worry about (with the possible exception of &amp;quot;volume&amp;quot;), but you can use them if you like, so I will mention them.  They concern the properties of the ambient fading.  Check the &amp;quot;Show Inhereted Properties&amp;quot; to see their default values.  Entering a new value will over-write the default value, but only for that one object.  &lt;br /&gt;
&lt;br /&gt;
[[Image:Info_loc.jpg‎]]&lt;br /&gt;
&lt;br /&gt;
==== fiduration ====&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fade in duration&amp;quot;.  This is the length of time in seconds it takes for the in-coming ambient (the one for this zone) to completely fade-in.  The default value is 4 seconds.  You can, e.g., make the fade last much longer with a larger value.  &lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want your ambient to fade in at all, but start immediately at full volume, change this value to &amp;quot;.001&amp;quot; (NOT zero). &lt;br /&gt;
&lt;br /&gt;
==== foduration ====&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fade out duration&amp;quot;.  This is the length of time in seconds it takes for the out-going ambient (the one from the zone you&#039;re leaving) to completely fade-out.  Again, if you want it to cut right off without fading, use a value of &amp;quot;.001&amp;quot;.   &lt;br /&gt;
&lt;br /&gt;
==== fidelay ====&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fade in Delay&amp;quot;.  You can delay the beginning of the in-coming ambient&#039;s fade-in after you enter the new area.  You might want to do this, for example, if you want the out-going ambient to completely fade out before you begin fading in the new ambient.  So you would set fidelay to the same time as the foduration.  By default it is set to .001 so that there is no delay and the fade in starts immediately.  If the out-going fade-out also starts immediately (which happens by default), then they blend together in a nice transition fade.  &lt;br /&gt;
&lt;br /&gt;
==== fodelay ====&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fade out Delay&amp;quot;.  Similarly you can delay the beginning of the out-going ambient&#039;s fade out.  You might want to do this if you wanted the in-coming ambient to completely fade in before you started the fade out of the old ambient.  Then you would set it to fiduration.  Like fidelay, it is set to .001 so there is no delay and the fade out starts immediately.  &lt;br /&gt;
&lt;br /&gt;
==== fovolume ====&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fade out volume&amp;quot;.  This sets the volume to which the out-going ambient fades to.  -60 turns it off, which is the default (0 means no decrease in volume at all).  If you go any higher than -60, than it will leave the old ambient still playing at a lower volume under the new ambient (at least until you enter a 3rd new zone).  Not sure why you&#039;d ever want to do that, so you probably don&#039;t want to change it.  &lt;br /&gt;
&lt;br /&gt;
==== volume ====&lt;br /&gt;
&lt;br /&gt;
This allows the mapper to override the volume of the ambient sound once it has fully faded in, and uses the same scale as the &#039;&#039;&#039;s_volume&#039;&#039;&#039; speaker parameter. See [[Setting Up Speakers#volume/ s_volume]] &amp;amp; [[Volume Issues]] for more detailed discussion of the volume parameter.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not override ambient volumes unless strictly necessary&#039;&#039;&#039;. Maps with wildly different ambient volume settings result in a poor experience for players, and limit the ability of the Dark Mod team to respond to volume-related issues by changing default volumes in sound shader declarations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These last two (&#039;&#039;&#039;foduration_2foip&#039;&#039;&#039; and &#039;&#039;&#039;fiduration_2foip&#039;&#039;&#039;) are pretty obscure situations, so you probably don&#039;t need to ever mess with them unless you want to completely get rid of ambient fades (then you can set them to .001 like the other &#039;fade duration&#039; properties).&lt;br /&gt;
&lt;br /&gt;
==== foduration_2foip ====&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fade-out duration during a &#039;2 Fade-outs in progress&#039; situation&amp;quot;.  This provides a shorter fade-out duration (in seconds) for when the player quickly runs into a 3rd location, such that the 1st and 2nd ambients from areas the player just left are still fading out (hence the 2 fade-outs). But the quickend-fade-out only applies to the 1st ambient fading out. (i.e., not of the ambient you just left, but the one you left just before that -- unless you&#039;re backtracking, then it just fades the prev-prev ambient back in).  Fading out that prev-prev ambient more quickly in turn quickens the time the new fade-in can start (because you can&#039;t have 3 sounds on at the same time on the zone speaker, only 2).  So it in effect reduces the gap of quiet that happens before the newest ambient fully fades-in by enabling it to start its fade-in faster.  The default is 1 second.  &lt;br /&gt;
&lt;br /&gt;
==== fiduration_2foip ====&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fade-in duration during a &#039;2 Fade-outs in progress&#039; situation&amp;quot;.  Like its counterpart, this sets a shorter duration of a fade-in of a new ambient (in seconds) when you run into a 3rd location, while the ambients from the 1st and 2nd locations are fading out.  Again, because so many ambients are fading out, it can leave a gap of silence for a bit until the new 3rd ambient fades in.  So setting a shorter duration than usual for the newest ambient to fully fade in helps shorten the quiet space.  The default is 2 seconds (as opposed to a normal default fade-in duration of 4 seconds).  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example of Location with No Fading Transition ====&lt;br /&gt;
&lt;br /&gt;
As mentioned above, if you wanted a set-up that turned off all fades so that the out-going ambient shut directly off and the in-coming ambient turns directly on, you&#039;d change all the duration properties to .001, like the following image.  (Note that this modifies the transition only for entering this one location.  All the other info_locations maintain their default values unless you also change them by hand.)  &lt;br /&gt;
&lt;br /&gt;
[[image: Fade_duration.jpg‎]]&lt;br /&gt;
&lt;br /&gt;
=== Ambient light settings ===&lt;br /&gt;
&lt;br /&gt;
These spawnargs can be set on &#039;&#039;&#039;atdm:info_location&#039;&#039;&#039; entities and apply to the current zone then:&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;ambient_light&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
This spawnarg specifies the ambient light color for this zone. Setting it f.i. to &amp;quot;0.10 0.02 0.02&amp;quot; would fade the ambient light to a slightly reddish color. This can be useful for covering a lava cave. Other examples are slightly blue light for moonlit outsides, greenish cast for caves or underwater areas etc.&lt;br /&gt;
&lt;br /&gt;
If you do not set this on an info_location entity, the default value of the global &amp;quot;ambient_world&amp;quot; entity will be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*You need to set the color values as fractions between 0 and 1, e.g. &#039;&#039;&#039;&amp;quot;0.08 0.08 0.02&amp;quot;&#039;&#039;&#039; and &#039;&#039;&#039;NOT&#039;&#039;&#039; as integers like so &amp;lt;s&amp;gt;&amp;quot;8 8 2&amp;quot;&amp;lt;/s&amp;gt;, or it will not work.&lt;br /&gt;
&lt;br /&gt;
:*If the color change between two zones is too big, the fading and change can become obvious to the player and spoil the subtlety. This can happen for instance if you zoom from a bluish-lit outside directly to a reddish-glowing cave inside. To help the transition, consider adding an intermidiate zone with a light color that is either in between the two, or a more neutral grey. Making it not possible to look from one zone to the other also helps, this way they player can&#039;t see that f.i. the outside ground suddenly also glows reddish when looking back from the cave entrance to the outside.&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;ambient_light_fade_time&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
This specifies the time in seconds it will take to fade from the current ambient light color to the one specified for this location. A slower fade means more gradual light changes, so they don&#039;t become too obvious to the player. Use at least 3, better 5 or 7 seconds.&lt;br /&gt;
&lt;br /&gt;
If set to -1, the default time specified at the &#039;&#039;&#039;atdm:location_settings&#039;&#039;&#039; entity will be used.&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;ambient_light_fade_delay&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
This specifies the time in seconds the fading will be delayed when the player changes location.&lt;br /&gt;
&lt;br /&gt;
Useful to prevent fades toggling back and forth when the player stands in a doorway and goes a nudge forward/backwards. A good value is at least 1 second.&lt;br /&gt;
&lt;br /&gt;
If set to -1, the default time specified at the &#039;&#039;&#039;atdm:location_settings&#039;&#039;&#039; entity will be used.&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;ambient_light_dynamic&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is a factor&#039;&#039;&#039;, all lights in the current area will be summed together and scaled by this value.&lt;br /&gt;
&lt;br /&gt;
If set to a value other than &amp;quot;0 0 0&amp;quot;, the lights in the current zone will be all summed together and then&lt;br /&gt;
added to the current base ambient light. This happens with the frequency of &#039;&#039;&#039;update_period&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The basic effect is that a roaring fire also slightly makes the walls flicker, and extinguishing all lights in a room would decrease the ambient light slightly.&lt;br /&gt;
&lt;br /&gt;
The factor should be set up so that for large and dark rooms (e.g. caves) the dynamic part is small, while for small, bright rooms (white walls) the dynamic part is bigger. Examples are: &amp;quot;0.05 0.05 0.05&amp;quot; and &amp;quot;0.1 0.1 0.1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that setting the dynamic factor to high can result in the player being busted by lights that are turned on in the room even when the player is in the shadow.&lt;br /&gt;
&lt;br /&gt;
See also the article about [[Dynamic ambient light]].&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;ambient_light_dynamic_cap&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Used to cap the dynamic ambient light part. If set to 0, will be ignored, so to have a very very small&lt;br /&gt;
cap, set to &amp;quot;0.01&amp;quot;, e.g. if you want only the red part to be dynamic, set it f.i. &amp;quot;0.15 0.01 0.01&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
See also the article about [[Dynamic ambient light]].&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;ambient_light_dynamic_falloff&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Possible values are:&lt;br /&gt;
&lt;br /&gt;
* -1 on info_location: use the value from the atdm:location_settings entity&lt;br /&gt;
* 0 - no dynamic falloff&lt;br /&gt;
* 0.5 - small, based on square root of distance&lt;br /&gt;
* 1 - medium, linear dynamic falloff (should be used as it looks best)&lt;br /&gt;
* 2 - high, square of distance based falloff&lt;br /&gt;
&lt;br /&gt;
See also the article about [[Dynamic ambient light]].&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;ambient_light_dist_scale&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
A factor to scale the distance before applying a dynamic light falloff. Only used then &#039;&#039;&#039;ambient_light_dynamic_falloff&#039;&#039;&#039; is not 0. Good valuesa are around 1.0.&lt;br /&gt;
&lt;br /&gt;
See also the article about [[Dynamic ambient light]].&lt;br /&gt;
&lt;br /&gt;
=== Script calls ===&lt;br /&gt;
&lt;br /&gt;
The next four spawnargs all specify scripts to call when the player enters or exits a zone. Note that the very first zone is also &amp;quot;entered&amp;quot; by the player when the map starts. That means &amp;quot;call_once_on_entry&amp;quot; for the start zone should be called at start-time.&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;call_once_on_exit&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Called only once when the zone is left by the player.&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;call_once_on_entry&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Called only once when the zone is entered by the player.&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;call_on_exit&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Always called when the player leaves that zone.&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;call_on_entry&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
Always called when the player enters that zone.&lt;br /&gt;
&lt;br /&gt;
==== Example scripts ====&lt;br /&gt;
&lt;br /&gt;
Here is an example script that spawns an object where the &#039;&#039;&#039;info_location&#039;&#039;&#039; entity is for the zone the player just left. You can call this script by setting:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;&amp;quot;call_once_on_exit&amp;quot; &amp;quot;spawn_pear&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
on your info_location entity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void spawn_pear( entity old_zone )&lt;br /&gt;
  {&lt;br /&gt;
  // Get the name of the location that the player just left:&lt;br /&gt;
  string location_name = old_zone.getName();&lt;br /&gt;
  // and display it on the console for debugging&lt;br /&gt;
  sys.print (&amp;quot;Spawning pear after leaving &amp;quot; + location_name + &amp;quot;\n&amp;quot;);&lt;br /&gt;
  // spawn the pear entity&lt;br /&gt;
  entity pear = sys.spawn(&amp;quot;atdm:moveable_food_pear&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // and now get the position of the old location entity:&lt;br /&gt;
  vector origin = old_zone.getOrigin();&lt;br /&gt;
  // finally move the pear to the point of the info_location&lt;br /&gt;
  pear.setOrigin( origin );&lt;br /&gt;
  // so once the player exits this location, ONE pear will spawn and fall down&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Adding ambient Sounds to your Map]]&lt;br /&gt;
* [[Dynamic ambient light]].&lt;br /&gt;
* [[Ambient Sounds - Zone (using triggers)]]&lt;br /&gt;
* [[Sound File Formats]]&lt;br /&gt;
&lt;br /&gt;
{{tutorial-sound}}&lt;br /&gt;
{{editing}}&lt;br /&gt;
{{tutorial-scripting}}&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Setting_Up_Speakers&amp;diff=11727</id>
		<title>Setting Up Speakers</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Setting_Up_Speakers&amp;diff=11727"/>
		<updated>2010-12-05T19:22:55Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: Note to discourage per-speaker volume overrides&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a mapper can drop a speaker entity in the map and set it up correctly in DarkRadiant. The focus is on shoundshader keywords and how to override them.&lt;br /&gt;
&lt;br /&gt;
== Create A Speaker Entity ==&lt;br /&gt;
&lt;br /&gt;
To create a speaker you can simply click {{RMB}} in DarkRadiant and select &amp;quot;Create speaker...&amp;quot;. This will:&lt;br /&gt;
* create a speaker entity&lt;br /&gt;
* open a window that lets you choose a sound&lt;br /&gt;
After choosing a sound you can alter the sound&#039;s properties in the entity inspector.&lt;br /&gt;
&lt;br /&gt;
To do that it is handy to know how sounds in our game basically work. Via sound shaders, that is:&lt;br /&gt;
&lt;br /&gt;
== Sound Shaders And Spawnargs ==&lt;br /&gt;
&lt;br /&gt;
A sound shader is a text file that resides in darkmod/sounds and comes with the .sndshd extension. These shaders tell the engine where the .waves or .oggs can be found along with some common parameters.&lt;br /&gt;
&lt;br /&gt;
As an example we look at the shader for &amp;quot;footsteps on stone materials while walking&amp;quot; (you would not put these in game via a speaker normally, but you &#039;&#039;could&#039;&#039; do it since all sounds work technically the same):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 tdm_footstep_stone_walk&lt;br /&gt;
 { &lt;br /&gt;
 	description &amp;quot;Made by GoldChocobo&amp;quot;&lt;br /&gt;
 	no_dups&lt;br /&gt;
 	minDistance 1&lt;br /&gt;
 	maxDistance 30&lt;br /&gt;
 	volume -12&lt;br /&gt;
 &lt;br /&gt;
 	sound/sfx/movement/footsteps/player/stone_walk01.ogg&lt;br /&gt;
 	sound/sfx/movement/footsteps/player/stone_walk02.ogg&lt;br /&gt;
 	sound/sfx/movement/footsteps/player/stone_walk03.ogg&lt;br /&gt;
 	sound/sfx/movement/footsteps/player/stone_walk04.ogg&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It starts with the shader name &amp;quot;tdm_footstep_stone_walk&amp;quot;. This will show up in DarkRadiant&#039;s &amp;quot;Choose sound&amp;quot; dialog. Then we have some keywords followed by the actual sound files and their relative path.&lt;br /&gt;
&lt;br /&gt;
There are four sounds (not only one) to allow variety. They get played in a random order, one each time the sound is triggered. (In most cases, see [[Problem Hearing Varied Sounds]].)&lt;br /&gt;
&lt;br /&gt;
Picking the &#039;&#039;volume&#039;&#039; keyword you can see it is followed by a negative value. These are meant to be decibel (dB), so we can expect 0 to be the maximum while a reduction by 10 approximately is half the volume.&lt;br /&gt;
&lt;br /&gt;
If you created your speaker and wanted to change it&#039;s volume in DarkRadiant you would go to the entity inspector (default shortcut: n) and add the spawnarg &#039;&#039;s_volume&#039;&#039;. Whatever number you enter here is meant to override the shader setting.&lt;br /&gt;
&lt;br /&gt;
This is what it looks like:&lt;br /&gt;
&lt;br /&gt;
[[Image:Entity-inspector-speaker.png]]&lt;br /&gt;
&lt;br /&gt;
The icons left to the keyword indicate Radiant knows them -- you will get a tooltip on mouseover. If you mistype anything you will see nothing there, which is a good indicator.&lt;br /&gt;
&lt;br /&gt;
So what we have is a system where our shaders provide the default values. We can override these values in the map file using the appropriate spawnargs. Note that not defining anything in the shader as well as in your map file won&#039;t crash the game -- there are still fallback values (propably hardcoded in the engine).&lt;br /&gt;
&lt;br /&gt;
In the following list the keywords are presented as a pair, where possible. The soundshader keyword is followed by the corresponding counterpart you would use in DR.&lt;br /&gt;
&lt;br /&gt;
=== volume/ s_volume ===&lt;br /&gt;
&lt;br /&gt;
:The &#039;&#039;volume&#039;&#039; is set in dB. Usually this means there is a maximum of &#039;&#039;0&#039;&#039; dB. The minimum is &#039;&#039;-60&#039;&#039; dB which results in absoulute silence.&lt;br /&gt;
&lt;br /&gt;
:Up to a certain point the game allows the use of positive values as well, but be aware, as this is sensitive:&lt;br /&gt;
&lt;br /&gt;
:To prevent clipping the engine has a mechanism that does not allow the &#039;&#039;volume&#039;&#039; to overdrive your sound hardware. For testing, it can be disabled via the &#039;&#039;s_clipVolumes&#039;&#039; cvar, but if it is active it will clip the &#039;&#039;volume&#039;&#039; for every output sound channel after all the other calculations are done -- this includes stereo panning, so once the volume setting is too high all the speakers (in your headphones, on your stereo) will play the sound at the same maximum volume. It gets virtually monofied, the player no longer is able to locate the sound.&lt;br /&gt;
&lt;br /&gt;
:In general it is best to avoid setting the volume on an individual speaker unless strictly necessary, because it prevents future updates to the volume specified in the sound shader from taking effect in your map. It is preferable to set the volume correctly on the sound shader declaration itself (or request that the Dark Mod team do so, if it is a core asset supplied with the mod).&lt;br /&gt;
&lt;br /&gt;
=== unclamped/ s_unclamped ===&lt;br /&gt;
&lt;br /&gt;
:Possible values are &#039;&#039;0&#039;&#039; and &#039;&#039;1&#039;&#039;. This overrides the global &#039;&#039;volume&#039;&#039; clipping and will make your sound bypass the &#039;&#039;s_clipVolumes&#039;&#039; setting.&lt;br /&gt;
&lt;br /&gt;
:Should be used with extra care, can trigger hardware clipping. This will not damage your hardware, but sound real crappy -- keep in mind this is a game and not your favourite tube amp.&lt;br /&gt;
&lt;br /&gt;
=== minDistance/ s_mindistance ===&lt;br /&gt;
&lt;br /&gt;
:This works together with &#039;&#039;maxDistance&#039;&#039; like this:&lt;br /&gt;
&lt;br /&gt;
:[[Image:Mindistance-maxdistance-falloff.png]]&lt;br /&gt;
&lt;br /&gt;
:Around the speaker there is a spherical volume, defined by &#039;&#039;minDistance&#039;&#039;. Inside that, the sound plays at the specified full &#039;&#039;volume&#039;&#039;. The (hopefully) larger &#039;&#039;maxDistance&#039;&#039; defines a bigger sphere. Outside of it the &#039;&#039;volume&#039;&#039; will be &#039;&#039;0&#039;&#039;, inside of it there is a falloff from max. to min.&lt;br /&gt;
&lt;br /&gt;
:Note: &#039;&#039;&#039;Do not set &#039;&#039;s_mindistance&#039;&#039; to &#039;&#039;0&#039;&#039;!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:While a real sound does not have a &amp;quot;mindistance&amp;quot; it will not work to set &#039;&#039;s_mindistance&#039;&#039; to &#039;&#039;0&#039;&#039;. A quick test revealed the following behavior:&lt;br /&gt;
&lt;br /&gt;
:[[Image:Mindistance-overrides.png]]&lt;br /&gt;
&lt;br /&gt;
:This shows we can overide the shader values with our spawnarg in DR, but when we set it to &#039;&#039;0&#039;&#039; it counts not as a number but as a toggle that simply disables our intended input. This is as good as deleting the property.&lt;br /&gt;
&lt;br /&gt;
:The value will fall back to the shader default (lucky case is purple, bad cases are red). In the right column (red and yellow field) you can see what happens when no values are provided by the shader nor the spawnarg: doom simply sets the &#039;&#039;minDistance&#039;&#039; to &#039;&#039;1&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:As a resort mappers can always use &#039;&#039;s_mindistance 1&#039;&#039;, that&#039;s close enaugh for rock&#039;n&#039;roll.&lt;br /&gt;
&lt;br /&gt;
=== maxDistance/ s_maxdistance ===&lt;br /&gt;
&lt;br /&gt;
:See above. The outlines of &#039;&#039;maxDistance&#039;&#039; can be drag-resized in DarkRadiant. This does not show you the real dispersion of the sound in most cases (due to occlusion, see below).&lt;br /&gt;
&lt;br /&gt;
:Not setting the &#039;&#039;maxDistance&#039;&#039; or at the same time setting &#039;&#039;s_maxdistance&#039;&#039; to &#039;&#039;0&#039;&#039; (which is insane anyway) will cause doom to use &#039;&#039;10&#039;&#039; instead.&lt;br /&gt;
&lt;br /&gt;
=== looping/ s_looping ===&lt;br /&gt;
&lt;br /&gt;
:Turns on and off looping. The sound will repeat endlessly in a forward loop.&lt;br /&gt;
&lt;br /&gt;
=== omnidirectional/ s_omni ===&lt;br /&gt;
&lt;br /&gt;
:The sound will have the same &#039;&#039;volume&#039;&#039; on all speakers, so it sounds like not having a specific origin. Normally used for ambience music (when not using the preferred method via [[Location Settings]]). Works with falloff as provided by &#039;&#039;minDistance&#039;&#039; and &#039;&#039;maxDistance&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== global/ s_global ===&lt;br /&gt;
&lt;br /&gt;
:Plays the sound at full &#039;&#039;volume&#039;&#039; everywhere in the map.&lt;br /&gt;
&lt;br /&gt;
=== no_occlusion/ s_occlusion ===&lt;br /&gt;
&lt;br /&gt;
:The shader keyword turns occlusion off, &#039;&#039;s_occlusion&#039;&#039; must be set to &#039;&#039;1&#039;&#039; for the same effect (this is counterintuitive).&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;What is occlusion?&#039;&#039;&#039; -- To resemble a realistic falloff for sounds, the game traces the route to the speaker from the player position through vis_portals instead of line of sight. Even closed doors or windows are taken into account for that calculation.&lt;br /&gt;
&lt;br /&gt;
:If you want your specific sound to be not affected by this, you can turn it off this way.&lt;br /&gt;
&lt;br /&gt;
:Note: it is highly recommended to turn occlusion off for ambient music, or it will fade when you close a door etc.&lt;br /&gt;
&lt;br /&gt;
=== shakes/ s_shakes ===&lt;br /&gt;
&lt;br /&gt;
:A special effect, that shakes the screen when the sound plays. Possible values are fractions between &#039;&#039;0&#039;&#039; and &#039;&#039;1&#039;&#039;. This is multiplied with the &#039;&#039;volume&#039;&#039; to determine the intensity of the effect.&lt;br /&gt;
&lt;br /&gt;
:Note: &#039;&#039;s_shakes 0&#039;&#039; will disable itself and fall back to the &#039;&#039;shakes&#039;&#039; value in the shader.&lt;br /&gt;
&lt;br /&gt;
:Note2: Iddevnet says it should not be used with .ogg files.&lt;br /&gt;
&lt;br /&gt;
=== n. a./ s_waitfortrigger ===&lt;br /&gt;
&lt;br /&gt;
:If set to &#039;&#039;1&#039;&#039; the speaker will wait for a trigger to activate it.&lt;br /&gt;
&lt;br /&gt;
=== n. a./ s_shader ===&lt;br /&gt;
&lt;br /&gt;
:Points to the sound shader the speaker uses. Can as well be used to reference audio files directly, when not present in any shader.&lt;br /&gt;
&lt;br /&gt;
=== leadin/ n. a. ===&lt;br /&gt;
&lt;br /&gt;
:Specifies a file that is played as a lead-in to a looped part of the sound.&lt;br /&gt;
&lt;br /&gt;
=== leadinVolume/ n. a. ===&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Volume&#039;&#039; of the lead-in part in a looped sound.&lt;br /&gt;
&lt;br /&gt;
=== no_dups/ n. a. ===&lt;br /&gt;
&lt;br /&gt;
:This prevents the same audio file out of the multiple ones in a shader to be played twice in a row when randomly playing them.&lt;br /&gt;
&lt;br /&gt;
:Not of any use when your shader references only one file.&lt;br /&gt;
&lt;br /&gt;
=== private/ n. a. ===&lt;br /&gt;
&lt;br /&gt;
:The sound is only present to the player.&lt;br /&gt;
&lt;br /&gt;
=== description/ n. a. ===&lt;br /&gt;
&lt;br /&gt;
:A short discription in the shader. In DarkMod it usually names the creator of the sound.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
When you set up a few sounds, you propably like to check them out in game. Learn about additional tools for [[Debugging Your Speakers]].&lt;br /&gt;
&lt;br /&gt;
Unfortunately I missed [[Sounds: Background and Local]], before creating a bit of an overlap with this article.&lt;br /&gt;
&lt;br /&gt;
Further information can be found at [http://www.modwiki.net/wiki/Sound_(keywords) modwiki.net] or [http://www.iddevnet.com/doom3/sounds.php iddevnet].&lt;br /&gt;
&lt;br /&gt;
[[Category:Sound]]&lt;br /&gt;
[[Category:Editing]]&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Sounds:_Background_and_Local&amp;diff=10085</id>
		<title>Sounds: Background and Local</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Sounds:_Background_and_Local&amp;diff=10085"/>
		<updated>2010-06-23T13:07:38Z</updated>

		<summary type="html">&lt;p&gt;Orbweaver: /* Loudness, Volume */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;written by Fidcal&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
All that is assumed is you know the essentials described in [[Dark Radiant Must Know Basic Intro]]&lt;br /&gt;
&lt;br /&gt;
If you want a global ambient sound heard throughout your mission then also read [[Adding ambient Sounds to your Map]].&lt;br /&gt;
&lt;br /&gt;
This tutorial covers general background sounds, local ambience, environmental, or sounds related to specific objects in the game such as a machine or a drain.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sound File Types ==&lt;br /&gt;
&lt;br /&gt;
OGG and WAV files are used in Dark Mod. For details see [[Sound File Formats]]&lt;br /&gt;
&lt;br /&gt;
OGG files are compressed whereas WAV files do not compress well even in zip files (so I&#039;m told!)&lt;br /&gt;
&lt;br /&gt;
You can create your own sounds but there is already a large range provided in Dark Mod ready to use.&lt;br /&gt;
&lt;br /&gt;
Those sound files  can be referenced either directly (with full path and name) or via a definition file called a sound shader which can include various controls as well as the name of the sound file and path. Multiple sound file definitions can be included in one sound shader file. Other controls are available as properties in the speaker entity in the map file. These properties will override the equivalent definition in the sound shader.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Speaker Entity ==&lt;br /&gt;
&lt;br /&gt;
The speaker entity is like a loudspeaker that you place in your mission.&lt;br /&gt;
&lt;br /&gt;
To include a sound in your mission...&lt;br /&gt;
&lt;br /&gt;
* create a speaker entity and position it where you want the sound to be centred.&lt;br /&gt;
* Add the property s_shader&lt;br /&gt;
* In Dark Radiant you can select a sound shader from the button below the entity properties.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Properties of the Speaker Entity ==&lt;br /&gt;
&lt;br /&gt;
The following are properties to add to the speaker entity to adjust the way it plays sounds. There is no need to dmap between adjustments of these properties. Assuming you have dmapped once you can just use map to test changes.&lt;br /&gt;
&lt;br /&gt;
Before proceeding, it&#039;s worth quoting Orbweaver:&lt;br /&gt;
&lt;br /&gt;
# If a speaker is looping, it will play all the time, but will obviously only be audible when the player is within range.&lt;br /&gt;
# If a speaker is non-looping but waits for trigger, then it will do nothing until triggered. Once triggered it will play but will only be audible if the player is within range.&lt;br /&gt;
# If a speaker is non-looping and untriggered, it will play once at startup, irrespective of whether the player is near enough to hear it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Loudness, Volume ==&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;s_volume&#039;&#039;&#039; property allows you to change the volume of a sound. It specifies the change to the volume of the audio file, in decibels, and may be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Be careful about making sounds too loud with this keyvalue, decibels are fairly &amp;quot;small&amp;quot; units and setting a volume increase of +20dB may well make the sound too loud for players. Ambient sounds should be at a similar volume throughout the map, and should not be so loud as to obliterate important gameplay sounds such as footsteps, or cause the player to reach for their volume control every time they enter a new area.&lt;br /&gt;
&lt;br /&gt;
== Control of volume by &#039;Ambient Volume&#039; menu setting ==&lt;br /&gt;
If you want to give the player user-friendly control over the sound volume (as with ambient music, which some players prefer off), include the keypair &amp;quot;s_music&amp;quot; &amp;quot;1&amp;quot; on the speaker entity.&lt;br /&gt;
&lt;br /&gt;
== Direction of Source, Propogation through Doorways==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
s_occlusion 1 makes the sound go in a straight line and not through visportalled gaps like doorways etc. If set to 0 then it follows a natural route through openings.&lt;br /&gt;
&lt;br /&gt;
s_omni 1 makes the sound come from no particular direction so this is ideal for ambience like rainfall or mood music (unless that music is meant to come from something in the game.) Set s_omni to 0 if you want your sound to sound like it is coming from the speaker entity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Range, Radius, Distance covered by Sound ==&lt;br /&gt;
&lt;br /&gt;
The units used for the distance reached by the speaker entity are in &#039;&#039;metres&#039;&#039; not Doom units so these approximate 40 normal units. In DoomEd the radius is shown in the grid view and this feature is also being added to Dark Radiant.&lt;br /&gt;
&lt;br /&gt;
* s_mindistance N = distance in metres from speaker at which sound starts to fade. Within that radius it is at full volume.&lt;br /&gt;
&lt;br /&gt;
* s_maxdistance N = distance in metres from speaker beyond which it cannot be heard at all.&lt;br /&gt;
&lt;br /&gt;
==Triggering a Sound==&lt;br /&gt;
&lt;br /&gt;
Speakers by default will start to play at mission start even if the player is not in range to hear them. But speakers can be set to wait for a trigger - so any switch, button or other trigger can start and stop them. To do this, set the property s_waitfortrigger to 1 then the speaker is disabled until triggered by a switch of some sort. Default is 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Playing a Sound Once ==&lt;br /&gt;
&lt;br /&gt;
By default, if no looping or repeat is set up then a speaker will play once at mission start then stop. But unless the player is within range it will not be heard.&lt;br /&gt;
&lt;br /&gt;
So to play a sound once when the player approaches you need a separate vicinity trigger (see also [[#Triggering a Sound]]) that triggers only once. This is how...&lt;br /&gt;
&lt;br /&gt;
* Create and place your speaker and give it the property &#039;&#039;s_waitfortrigger&#039;&#039; with a value of 1&lt;br /&gt;
* At the place where you want the player to trigger the sound create a brush with a volume suitable for the trap so the player will pass into it.&lt;br /&gt;
* With the brush selected, assign it (create) an entity &#039;&#039;trigger_once&#039;&#039;&lt;br /&gt;
* The brush automatically gets a &#039;&#039;trigger&#039;&#039; texture which is invisible in-game.&lt;br /&gt;
* Add the property &#039;&#039;target&#039;&#039; with the value being the name of your speaker.&lt;br /&gt;
&lt;br /&gt;
When the player moves into that invisible brush it should trigger the speaker to play its sound once only.&lt;br /&gt;
&lt;br /&gt;
== Repeating a Sound Continuously ==&lt;br /&gt;
&lt;br /&gt;
=== s_looping ===&lt;br /&gt;
&lt;br /&gt;
s_looping repeats a sound seamlessly and is the one to use for continuous sound like rain, continuous machinery, etc. (compare also [[#wait (repeat)|wait]] before using this.&lt;br /&gt;
&lt;br /&gt;
s_looping set to 1 means...&lt;br /&gt;
&lt;br /&gt;
# Play sound immediately the player is within range (set by s_maxdistance)&lt;br /&gt;
# Wait until the sound has finished playing&lt;br /&gt;
# Repeat endlessly unless the player moves out of range (set by s_maxdistance)&lt;br /&gt;
&lt;br /&gt;
Set s_looping to 0 to disable (default)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== wait (repeat) ===&lt;br /&gt;
&lt;br /&gt;
wait n means repeat every n seconds endlessly so is the one to use to repeat with a gap between plays of the sound. Do NOT use it with s_looping set to 1 because &#039;wait&#039; repeats on its own and s_looping will override it and repeat immediately and endlessly.&lt;br /&gt;
&lt;br /&gt;
wait n means...&lt;br /&gt;
&lt;br /&gt;
# Play sound  immediately the player is within range (set by s_maxdistance)&lt;br /&gt;
# Wait n seconds from START of playing sound&lt;br /&gt;
# Repeat endlessly unless the player moves out of range (set by s_maxdistance)&lt;br /&gt;
&lt;br /&gt;
What if n is shorter than the length of the wav or ogg file? If there is only a single sound in the sound shader file then it cuts the sound short and starts again. Here&#039;s an example of what happens If, eg, you play a bell sound that is 6 seconds long (the original ogg or wav file) and if you set wait 1 then it will...&lt;br /&gt;
&lt;br /&gt;
# start to play the sound&lt;br /&gt;
# plays it for 1 second&lt;br /&gt;
# will not complete that but...&lt;br /&gt;
# begin again at the start every 1 second.&lt;br /&gt;
&lt;br /&gt;
However, if there are multiple sounds in the sound shader file which are selected randomly then they one will be played every N seconds and they will overlap unless it happens to call the same one twice in a row (which can be prevented with nodupes in the sound shader file.)&lt;br /&gt;
&lt;br /&gt;
Use with random to vary the wait time...&lt;br /&gt;
&lt;br /&gt;
=== random ===&lt;br /&gt;
&lt;br /&gt;
Use with the wait property to vary the repeat time. random n varies the wait time randomly by plus or minus n seconds. So for example...&lt;br /&gt;
&lt;br /&gt;
* wait 30&lt;br /&gt;
* random 10&lt;br /&gt;
&lt;br /&gt;
...will play the sound repeatedly between 20 to 40 seconds from the start of playing the sound.&lt;br /&gt;
&lt;br /&gt;
If random is greater than wait then it works the same but with a minimum of zero, so....&lt;br /&gt;
&lt;br /&gt;
* wait 10&lt;br /&gt;
* random 15&lt;br /&gt;
&lt;br /&gt;
... will play the sound repeatedly between 0 and 25 seconds from the start of playing the sound.&lt;br /&gt;
&lt;br /&gt;
he sound no directional source, ie, it will not seem to come from the direction of the speaker but from all directions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Screen Shaking, Explosions, etc. ==&lt;br /&gt;
&lt;br /&gt;
s_shakes set to 1 makes the screen shake when the sound is loud. Suitable for explosions, earthquakes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Sound Shader Definition Files==&lt;br /&gt;
&lt;br /&gt;
This to be written. It might need a separate article in which case adjust the link above. Meanwhile here is an external link...&lt;br /&gt;
&lt;br /&gt;
http://www.iddevnet.com/doom3/sounds.php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Sound]]&lt;br /&gt;
[[Category:Editing]]&lt;/div&gt;</summary>
		<author><name>Orbweaver</name></author>
	</entry>
</feed>