<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://staging-wiki.unvanquished.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fuma</id>
	<title>Unvanquished - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://staging-wiki.unvanquished.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fuma"/>
	<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/wiki/Special:Contributions/Fuma"/>
	<updated>2026-04-04T19:45:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Formats/Navigation_mesh&amp;diff=2137</id>
		<title>Formats/Navigation mesh</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Formats/Navigation_mesh&amp;diff=2137"/>
		<updated>2013-10-11T15:58:11Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* Testing the Mesh */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Daemon engine supports automatic navigation mesh generation from bsp map files. This navigation mesh (or &amp;quot;navmesh&amp;quot; for short) is used by the bots to navigate throughout the world.&lt;br /&gt;
&lt;br /&gt;
==Generating a Navigation Mesh==&lt;br /&gt;
&lt;br /&gt;
The -nav parameter to daemonmap will generate a navigation mesh from a bsp file.&lt;br /&gt;
Use it like so:&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
 daemonmap.exe -game unv -nav mapname.bsp&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
 ./daemonmap -game unv -nav mapname.bsp&lt;br /&gt;
&lt;br /&gt;
===Optional Parameters===&lt;br /&gt;
&lt;br /&gt;
The navigation mesh generation process is conservative by default. This means some areas (particularly, small ledges) that should be walkable may instead create a break in the navmesh which bots interpret as &amp;quot;I am unable to go past there.&amp;quot; The following optional parameters give the map maker some control over navmesh generation to help with this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-cellheight&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A lower cellheight will increase mesh generation accuracy at the cost of generation time and mesh size.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If there are gaps in the navigation mesh even though a player can easily just walk to get through, you can decrease the value to help.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-median&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Applies a median filter to the walkable areas of the mesh to help contain any &amp;quot;noise.&amp;quot;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;See [http://digestingduck.blogspot.com/2010/07/recast-area-types-per-triangle.html this article] for more information.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-optimistic&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Attempts to compensate for cellsize inaccuracy by increasing the stepheight navigation mesh generation parameter based on the current samplesize. It is recommended to be used with a lower than default cellsize to help avoid over optimistic assumptions (i.e., saying some areas are walkable that really aren't). Useful for fixing breaks in the mesh caused by some small ledges.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This produces bad results depending on how big your &amp;lt;code&amp;gt;cellsize&amp;lt;/code&amp;gt; parameter is, but generating the mesh in this way will be faster than simply decreasing the &amp;lt;code&amp;gt;cellheight&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using a Navigation Mesh==&lt;br /&gt;
&lt;br /&gt;
Navigation mesh files go in the &amp;lt;code&amp;gt;maps/&amp;lt;/code&amp;gt; directory either in the folder specified by the &amp;lt;code&amp;gt;fs_game&amp;lt;/code&amp;gt; cvar, or in the maps folder inside a map's &amp;lt;code&amp;gt;.pk3&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Testing the Mesh==&lt;br /&gt;
&lt;br /&gt;
* You may test your map locally by entering &amp;lt;code&amp;gt;\devmap &amp;lt;var&amp;gt;mapName&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; as you would to test any map at any time. Note, of course, that this will disconnect you from whatever game you may currently be in.&lt;br /&gt;
* To enable drawing the navigation mesh, use &amp;lt;code&amp;gt;navedit enable navmeshname&amp;lt;/code&amp;gt; where &amp;quot;navmeshname&amp;quot; is one of: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
*human_base&lt;br /&gt;
*human_bsuit&lt;br /&gt;
*builder&lt;br /&gt;
*builder-upg&lt;br /&gt;
*level0&lt;br /&gt;
*level1&lt;br /&gt;
*level1upg&lt;br /&gt;
*level2&lt;br /&gt;
*level2upg&lt;br /&gt;
*level3&lt;br /&gt;
*level3upg&lt;br /&gt;
*level4&lt;br /&gt;
&amp;lt;/ul&amp;gt; &lt;br /&gt;
Where level4 is tyrant, level3 is dragoon, level2 is marauder, level1 is basilisk, and level0 is dretch. The two builder navmeshes are not used at this time.&lt;br /&gt;
* Add bots with the &amp;lt;code&amp;gt;bot&amp;lt;/code&amp;gt; command and spectate the game.&lt;br /&gt;
&lt;br /&gt;
==Editing the Navigation Mesh==&lt;br /&gt;
Navmesh editing is still a work in progress, but it can be useful for fixing unnavigable ledges.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, automatic navigation mesh generation that fully supports all of the map features and player abilities in Unvanquished is incredibly difficult. Automatic generation will usually produce a very satisfactory base mesh, but some areas may need further tweaking.&lt;br /&gt;
&lt;br /&gt;
To edit the navmesh, you must select the one you wish to edit using the &amp;lt;code&amp;gt;navedit&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
To add connections use the &amp;lt;code&amp;gt;addcon&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
A oneway connection will only allow bots to move from the start of the connection to the end of the connection, but not from the end to the start. A twoway connection will allow bots to move in either direction along the connection. The radius of the connection is how far away the center of the bot has to be from the middle to take the connection.&lt;br /&gt;
&lt;br /&gt;
Modifications to the navmesh are made in real time, so any bots that have spawned will react accordingly.&lt;br /&gt;
&lt;br /&gt;
When you are done editing a specific navmesh, you can use &amp;lt;code&amp;gt;navedit save&amp;lt;/code&amp;gt; to save your work.&lt;br /&gt;
[[Category:Bots]]&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Formats/Navigation_mesh&amp;diff=2136</id>
		<title>Formats/Navigation mesh</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Formats/Navigation_mesh&amp;diff=2136"/>
		<updated>2013-10-11T15:56:32Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* Editing the Navigation Mesh */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Daemon engine supports automatic navigation mesh generation from bsp map files. This navigation mesh (or &amp;quot;navmesh&amp;quot; for short) is used by the bots to navigate throughout the world.&lt;br /&gt;
&lt;br /&gt;
==Generating a Navigation Mesh==&lt;br /&gt;
&lt;br /&gt;
The -nav parameter to daemonmap will generate a navigation mesh from a bsp file.&lt;br /&gt;
Use it like so:&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
 daemonmap.exe -game unv -nav mapname.bsp&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
 ./daemonmap -game unv -nav mapname.bsp&lt;br /&gt;
&lt;br /&gt;
===Optional Parameters===&lt;br /&gt;
&lt;br /&gt;
The navigation mesh generation process is conservative by default. This means some areas (particularly, small ledges) that should be walkable may instead create a break in the navmesh which bots interpret as &amp;quot;I am unable to go past there.&amp;quot; The following optional parameters give the map maker some control over navmesh generation to help with this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-cellheight&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A lower cellheight will increase mesh generation accuracy at the cost of generation time and mesh size.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If there are gaps in the navigation mesh even though a player can easily just walk to get through, you can decrease the value to help.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-median&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Applies a median filter to the walkable areas of the mesh to help contain any &amp;quot;noise.&amp;quot;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;See [http://digestingduck.blogspot.com/2010/07/recast-area-types-per-triangle.html this article] for more information.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-optimistic&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Attempts to compensate for cellsize inaccuracy by increasing the stepheight navigation mesh generation parameter based on the current samplesize. It is recommended to be used with a lower than default cellsize to help avoid over optimistic assumptions (i.e., saying some areas are walkable that really aren't). Useful for fixing breaks in the mesh caused by some small ledges.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This produces bad results depending on how big your &amp;lt;code&amp;gt;cellsize&amp;lt;/code&amp;gt; parameter is, but generating the mesh in this way will be faster than simply decreasing the &amp;lt;code&amp;gt;cellheight&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using a Navigation Mesh==&lt;br /&gt;
&lt;br /&gt;
Navigation mesh files go in the &amp;lt;code&amp;gt;maps/&amp;lt;/code&amp;gt; directory either in the folder specified by the &amp;lt;code&amp;gt;fs_game&amp;lt;/code&amp;gt; cvar, or in the maps folder inside a map's &amp;lt;code&amp;gt;.pk3&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Testing the Mesh==&lt;br /&gt;
&lt;br /&gt;
* You may test your map locally by entering &amp;lt;code&amp;gt;\devmap &amp;lt;var&amp;gt;mapName&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; as you would to test any map at any time. Note, of course, that this will disconnect you from whatever game you may currently be in.&lt;br /&gt;
* To enable drawing the navigation mesh, use &amp;lt;code&amp;gt;navedit enable navmeshname&amp;lt;/code&amp;gt; where &amp;quot;navmeshname&amp;quot; is one of: human_base, human_bsuit, builder, builder-upg, level0, level1, level1upg, level2, level2upg, level3, level3upg, level4. level4 is tyrant, level3 is dragoon, level2 is marauder, level1 is basilisk, level0 is dretch. The two builder navmeshes are not used at this time.&lt;br /&gt;
* Add bots with the &amp;lt;code&amp;gt;bot&amp;lt;/code&amp;gt; command and spectate the game.&lt;br /&gt;
&lt;br /&gt;
==Editing the Navigation Mesh==&lt;br /&gt;
Navmesh editing is still a work in progress, but it can be useful for fixing unnavigable ledges.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, automatic navigation mesh generation that fully supports all of the map features and player abilities in Unvanquished is incredibly difficult. Automatic generation will usually produce a very satisfactory base mesh, but some areas may need further tweaking.&lt;br /&gt;
&lt;br /&gt;
To edit the navmesh, you must select the one you wish to edit using the &amp;lt;code&amp;gt;navedit&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
To add connections use the &amp;lt;code&amp;gt;addcon&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
A oneway connection will only allow bots to move from the start of the connection to the end of the connection, but not from the end to the start. A twoway connection will allow bots to move in either direction along the connection. The radius of the connection is how far away the center of the bot has to be from the middle to take the connection.&lt;br /&gt;
&lt;br /&gt;
Modifications to the navmesh are made in real time, so any bots that have spawned will react accordingly.&lt;br /&gt;
&lt;br /&gt;
When you are done editing a specific navmesh, you can use &amp;lt;code&amp;gt;navedit save&amp;lt;/code&amp;gt; to save your work.&lt;br /&gt;
[[Category:Bots]]&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Formats/Navigation_mesh&amp;diff=2135</id>
		<title>Formats/Navigation mesh</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Formats/Navigation_mesh&amp;diff=2135"/>
		<updated>2013-10-11T15:51:50Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* Testing the Mesh */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Daemon engine supports automatic navigation mesh generation from bsp map files. This navigation mesh (or &amp;quot;navmesh&amp;quot; for short) is used by the bots to navigate throughout the world.&lt;br /&gt;
&lt;br /&gt;
==Generating a Navigation Mesh==&lt;br /&gt;
&lt;br /&gt;
The -nav parameter to daemonmap will generate a navigation mesh from a bsp file.&lt;br /&gt;
Use it like so:&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
 daemonmap.exe -game unv -nav mapname.bsp&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
 ./daemonmap -game unv -nav mapname.bsp&lt;br /&gt;
&lt;br /&gt;
===Optional Parameters===&lt;br /&gt;
&lt;br /&gt;
The navigation mesh generation process is conservative by default. This means some areas (particularly, small ledges) that should be walkable may instead create a break in the navmesh which bots interpret as &amp;quot;I am unable to go past there.&amp;quot; The following optional parameters give the map maker some control over navmesh generation to help with this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-cellheight&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A lower cellheight will increase mesh generation accuracy at the cost of generation time and mesh size.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If there are gaps in the navigation mesh even though a player can easily just walk to get through, you can decrease the value to help.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-median&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Applies a median filter to the walkable areas of the mesh to help contain any &amp;quot;noise.&amp;quot;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;See [http://digestingduck.blogspot.com/2010/07/recast-area-types-per-triangle.html this article] for more information.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-optimistic&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Attempts to compensate for cellsize inaccuracy by increasing the stepheight navigation mesh generation parameter based on the current samplesize. It is recommended to be used with a lower than default cellsize to help avoid over optimistic assumptions (i.e., saying some areas are walkable that really aren't). Useful for fixing breaks in the mesh caused by some small ledges.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This produces bad results depending on how big your &amp;lt;code&amp;gt;cellsize&amp;lt;/code&amp;gt; parameter is, but generating the mesh in this way will be faster than simply decreasing the &amp;lt;code&amp;gt;cellheight&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using a Navigation Mesh==&lt;br /&gt;
&lt;br /&gt;
Navigation mesh files go in the &amp;lt;code&amp;gt;maps/&amp;lt;/code&amp;gt; directory either in the folder specified by the &amp;lt;code&amp;gt;fs_game&amp;lt;/code&amp;gt; cvar, or in the maps folder inside a map's &amp;lt;code&amp;gt;.pk3&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Testing the Mesh==&lt;br /&gt;
&lt;br /&gt;
* You may test your map locally by entering &amp;lt;code&amp;gt;\devmap &amp;lt;var&amp;gt;mapName&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; as you would to test any map at any time. Note, of course, that this will disconnect you from whatever game you may currently be in.&lt;br /&gt;
* To enable drawing the navigation mesh, use &amp;lt;code&amp;gt;navedit enable navmeshname&amp;lt;/code&amp;gt; where &amp;quot;navmeshname&amp;quot; is one of: human_base, human_bsuit, builder, builder-upg, level0, level1, level1upg, level2, level2upg, level3, level3upg, level4. level4 is tyrant, level3 is dragoon, level2 is marauder, level1 is basilisk, level0 is dretch. The two builder navmeshes are not used at this time.&lt;br /&gt;
* Add bots with the &amp;lt;code&amp;gt;bot&amp;lt;/code&amp;gt; command and spectate the game.&lt;br /&gt;
&lt;br /&gt;
==Editing the Navigation Mesh==&lt;br /&gt;
Unfortunately, automatic navigation mesh generation that fully supports all of the map features and player abilities in Unvanquished is incredibly difficult. Automatic generation will usually produce a very satisfactory base mesh, but some areas may need further tweaking.&lt;br /&gt;
&lt;br /&gt;
===Adding Jump Links===&lt;br /&gt;
===Adding Ladder Links===&lt;br /&gt;
===Adding Pounce Links===&lt;br /&gt;
===Adding Drop off Links===&lt;br /&gt;
===Adding Walk Links===&lt;br /&gt;
[[Category:Bots]]&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Formats/Navigation_mesh&amp;diff=2134</id>
		<title>Formats/Navigation mesh</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Formats/Navigation_mesh&amp;diff=2134"/>
		<updated>2013-10-11T15:46:21Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* Optional Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Daemon engine supports automatic navigation mesh generation from bsp map files. This navigation mesh (or &amp;quot;navmesh&amp;quot; for short) is used by the bots to navigate throughout the world.&lt;br /&gt;
&lt;br /&gt;
==Generating a Navigation Mesh==&lt;br /&gt;
&lt;br /&gt;
The -nav parameter to daemonmap will generate a navigation mesh from a bsp file.&lt;br /&gt;
Use it like so:&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
 daemonmap.exe -game unv -nav mapname.bsp&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
 ./daemonmap -game unv -nav mapname.bsp&lt;br /&gt;
&lt;br /&gt;
===Optional Parameters===&lt;br /&gt;
&lt;br /&gt;
The navigation mesh generation process is conservative by default. This means some areas (particularly, small ledges) that should be walkable may instead create a break in the navmesh which bots interpret as &amp;quot;I am unable to go past there.&amp;quot; The following optional parameters give the map maker some control over navmesh generation to help with this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-cellheight&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A lower cellheight will increase mesh generation accuracy at the cost of generation time and mesh size.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If there are gaps in the navigation mesh even though a player can easily just walk to get through, you can decrease the value to help.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-median&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Applies a median filter to the walkable areas of the mesh to help contain any &amp;quot;noise.&amp;quot;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;See [http://digestingduck.blogspot.com/2010/07/recast-area-types-per-triangle.html this article] for more information.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;-optimistic&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Attempts to compensate for cellsize inaccuracy by increasing the stepheight navigation mesh generation parameter based on the current samplesize. It is recommended to be used with a lower than default cellsize to help avoid over optimistic assumptions (i.e., saying some areas are walkable that really aren't). Useful for fixing breaks in the mesh caused by some small ledges.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This produces bad results depending on how big your &amp;lt;code&amp;gt;cellsize&amp;lt;/code&amp;gt; parameter is, but generating the mesh in this way will be faster than simply decreasing the &amp;lt;code&amp;gt;cellheight&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using a Navigation Mesh==&lt;br /&gt;
&lt;br /&gt;
Navigation mesh files go in the &amp;lt;code&amp;gt;maps/&amp;lt;/code&amp;gt; directory either in the folder specified by the &amp;lt;code&amp;gt;fs_game&amp;lt;/code&amp;gt; cvar, or in the maps folder inside a map's &amp;lt;code&amp;gt;.pk3&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Testing the Mesh==&lt;br /&gt;
&lt;br /&gt;
* You may test your map locally by entering &amp;lt;code&amp;gt;\devmap &amp;lt;var&amp;gt;mapName&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; as you would to test any map at any time. Note, of course, that this will disconnect you from whatever game you may currently be in.&lt;br /&gt;
* To enable drawing the navigation mesh, set &amp;lt;code&amp;gt;r_debugSurface&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Add bots with the &amp;lt;code&amp;gt;bot&amp;lt;/code&amp;gt; command and spectate the game.&lt;br /&gt;
&lt;br /&gt;
==Editing the Navigation Mesh==&lt;br /&gt;
Unfortunately, automatic navigation mesh generation that fully supports all of the map features and player abilities in Unvanquished is incredibly difficult. Automatic generation will usually produce a very satisfactory base mesh, but some areas may need further tweaking.&lt;br /&gt;
&lt;br /&gt;
===Adding Jump Links===&lt;br /&gt;
===Adding Ladder Links===&lt;br /&gt;
===Adding Pounce Links===&lt;br /&gt;
===Adding Drop off Links===&lt;br /&gt;
===Adding Walk Links===&lt;br /&gt;
[[Category:Bots]]&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Technical_Documentation&amp;diff=1992</id>
		<title>Technical Documentation</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Technical_Documentation&amp;diff=1992"/>
		<updated>2013-04-24T04:06:09Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* Compile Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have a question that is not answered here, you can always hop on the [http://unvanquished.net/forum/forumdisplay.php/30-Programming programming sub-forums] or [[IRC]].&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
If you have not already, go [[Getting_the_source|get the code]], read up on your options for [[development environments]], and [[Compiling_the_source|compile it]]. Instructions are available for a variety of platforms. If your platform of choice is not listed, you are welcome to add instructions for it.&lt;br /&gt;
&lt;br /&gt;
From there, play the game! The [[Running the game]] page contains documentation on all the most commonly used and user-accessible commands and console variables. If you have trouble, see the [[troubleshooting]] page for possible solutions. Additional documentation is available on console variables:&lt;br /&gt;
* [[New_Cvars|Cvars that are new to Daemon]]&lt;br /&gt;
* [[Renderer_Status|Cvars for the renderer]] &amp;amp;mdash; This page also lists information on what renderer features are known to have issues.&lt;br /&gt;
&lt;br /&gt;
There are also very detailed instructions on [[Testing|testing the game]], which includes information on using sophisticated profiling tools such as apitrace, GPUPerfStudio, gDEBugger, valgrind, and clang-analyzer.&lt;br /&gt;
&lt;br /&gt;
===Need something to work on?===&lt;br /&gt;
&lt;br /&gt;
There's lots of places to look for work to do:&lt;br /&gt;
&lt;br /&gt;
* You are always welcome to fix any [https://github.com/Unvanquished/Unvanquished/issues issues reported on the bug tracker]. Just either leave a comment on the issue you're interested in or drop in [[IRC]] beforehand to let us know that you're working on it, so we don't try to work on it at the same time. Do be aware that we have several sub-projects, each with their own bug tracker, which are all listed on the [[Bug reporting|Bug Reporting]] page.&lt;br /&gt;
* Quick and easy tasks are listed on the [[Contributor Quickies]] page.&lt;br /&gt;
* More involved tasks are listed on the [[Programming Task List]].&lt;br /&gt;
* The most daunting challenges are listed on the [[Feature Proposals]] page. '''Be sure to communicate with us if you intend on working on one of these features!'''&lt;br /&gt;
&lt;br /&gt;
===Giving Back===&lt;br /&gt;
&lt;br /&gt;
You are welcome to contribute in any way possible! We have [[Contributing_code|guidelines for contributing code]] as well as documentation on [[Coding_convention|coding conventions]].&lt;br /&gt;
&lt;br /&gt;
==Branches==&lt;br /&gt;
&lt;br /&gt;
The following branches are under active development and may be of interest:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;librocket&amp;lt;/code&amp;gt; &amp;amp;mdash; Work to integrate libRocket is being done on this branch. libRocket is a library that will allow us to create user interfaces using dialects of HTML and CSS.&lt;br /&gt;
* &amp;lt;code&amp;gt;bots2&amp;lt;/code&amp;gt; &amp;amp;mdash; New bot code, using behavior trees.&lt;br /&gt;
&lt;br /&gt;
==Language Oddities==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;You must use the &amp;lt;code&amp;gt;INLINE&amp;lt;/code&amp;gt; macro instead of &amp;lt;code&amp;gt;inline&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;li&amp;gt;You must cast integers that are being used as enum values to an enum type. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BG_Class ( ( class_t ) self-&amp;gt;client-&amp;gt;ps.stats[ STAT_CLASS ] )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source Code &amp;amp;amp; Data Structure==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;main/&amp;lt;/code&amp;gt; Data associated with the game.&lt;br /&gt;
** &amp;lt;code&amp;gt;def/&amp;lt;/code&amp;gt; Entity definitions for [[Mapping|Radiant]].&lt;br /&gt;
** &amp;lt;code&amp;gt;fonts/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfx/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;glsl/&amp;lt;/code&amp;gt; OpenGL shader code.&lt;br /&gt;
** &amp;lt;code&amp;gt;lights/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;models/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;scripts/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;sound/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;translation/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;ui/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;engine/&amp;lt;/code&amp;gt; Engine source code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;asm/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;client/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;null/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;qcommon/&amp;lt;/code&amp;gt; Common code: utility functions, typedefs, macros, and the like.&lt;br /&gt;
*** &amp;lt;code&amp;gt;renderer/&amp;lt;/code&amp;gt; Vanilla (fixed-function pipeline) renderer&lt;br /&gt;
*** &amp;lt;code&amp;gt;rendererGL/&amp;lt;/code&amp;gt; Modern XReal-based renderer&lt;br /&gt;
*** &amp;lt;code&amp;gt;server/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;sys/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gamelogic/&amp;lt;/code&amp;gt; Code that falls outside the scope of the core engine. These are all run in separate [[virtual machines]].&lt;br /&gt;
*** &amp;lt;code&amp;gt;cgame/&amp;lt;/code&amp;gt; Client-side game code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;game/&amp;lt;/code&amp;gt; Server-side game code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;ui/&amp;lt;/code&amp;gt; User interface code.&lt;br /&gt;
&lt;br /&gt;
==Program Entry Point==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function may be found at around line 591 of {{SourceFile|src/engine/sys/sys_main.c}}. Note that some magic happens on the Mac in {{SourceFile|src/engine/sys/SDLMain.m}}.&lt;br /&gt;
&lt;br /&gt;
==Lag Compensation==&lt;br /&gt;
&lt;br /&gt;
Daemon uses Neil &amp;quot;haste&amp;quot; Toronto's [http://www.ra.is/unlagged/ Unlagged mod].&lt;br /&gt;
&lt;br /&gt;
==Data Files==&lt;br /&gt;
&lt;br /&gt;
Daemon uses a variety of file formats. Many of these formats are custom. &amp;lt;!-- just try and provide a dump of all configuration files, then I'll reorganize them --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Bot behavior trees&lt;br /&gt;
* Player configuration files&lt;br /&gt;
** Crosshair configuration&lt;br /&gt;
** Pubkey&lt;br /&gt;
** GUID&lt;br /&gt;
* Server configuration files&lt;br /&gt;
** [[Map_layouts|Map layouts]]&lt;br /&gt;
** Map rotations&lt;br /&gt;
* Particle &amp;amp; trail system files&lt;br /&gt;
* Sound configurations&lt;br /&gt;
** [[Music_and_sounds#Buildables|Buildables]]&lt;br /&gt;
* Model data ([[Exporting_Models#What_is_MD5.3F|discussion of supported formats]])&lt;br /&gt;
** Skins&lt;br /&gt;
** [[Exporting_Models#MD3_3|MD3 animation configuration files]] &amp;amp;mdash; specify which frames are for which animations&lt;br /&gt;
** Configuration files&lt;br /&gt;
*** [[Exporting_Models#Buildables_2|Buildables]]&lt;br /&gt;
*** [[Exporting_Models#Weapons_2|Weapons]]&lt;br /&gt;
*** [[Exporting_Models#Player_models_2|Player models]]&lt;br /&gt;
* Map data&lt;br /&gt;
** Map geometry (BSPs)&lt;br /&gt;
** Color grading configurations&lt;br /&gt;
&lt;br /&gt;
==Game Logic==&lt;br /&gt;
&lt;br /&gt;
Game logic is split into three areas: user interface, server-side, and client-side. Each runs in its own [[Virtual_machines|virtual machine]].&lt;br /&gt;
&lt;br /&gt;
==Client-Side==&lt;br /&gt;
&lt;br /&gt;
Buildable information is encapsulated in the &amp;lt;code&amp;gt;cg_buildables&amp;lt;/code&amp;gt; array (declared in {{SourceFile|src/gamelogic/cgame/cg_main.c|cg_main.c}})&lt;br /&gt;
&lt;br /&gt;
Constants used to define gamelogic variables are in {{SourceFile|src/gamelogic/game/tremulous.h}}.&lt;br /&gt;
&lt;br /&gt;
Types:&lt;br /&gt;
* &amp;lt;code&amp;gt;buildableInfo_t&amp;lt;/code&amp;gt; &amp;amp;mdash; Encapsulates data associated with buildables (sounds, animations, etc.).&lt;br /&gt;
* &amp;lt;code&amp;gt;buildable_t&amp;lt;/code&amp;gt; &amp;amp;mdash; An enumeration of all buildable types.&lt;br /&gt;
* &amp;lt;code&amp;gt;buildableAttributes_t&amp;lt;/code&amp;gt; &amp;amp;mdash; Encapsulates gameplay information associated with buildables. There is an array of these called &amp;lt;code&amp;gt;bg_buildableList&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Server-Side==&lt;br /&gt;
&lt;br /&gt;
Server game state initialization occurs in &amp;lt;code&amp;gt;G_InitGame()&amp;lt;/code&amp;gt; in {{SourceFile|src/gamelogic/game/g_main.c}}.&lt;br /&gt;
&lt;br /&gt;
==Particle &amp;amp;amp; Trail System==&lt;br /&gt;
&lt;br /&gt;
For now, please see the [http://tremulous.net/manual/#x1-130003.2 Tremulous documentation].&lt;br /&gt;
&lt;br /&gt;
==GL3 Renderer==&lt;br /&gt;
&lt;br /&gt;
Source code for the modern OpenGL renderer is located in {{SourceFile|src/engine/rendererGL}}. This renderer is often referred to as the &amp;quot;GL3&amp;quot; renderer, whereas the legacy renderer (found in {{SourceFile|src/engine/renderer}}) is often referred to as the &amp;quot;vanilla&amp;quot; renderer.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
* There is some incomplete disabled Direct3D code mixed in the modern OpenGL renderer code.&lt;br /&gt;
* Shaders are implemented as subclasses of the &amp;lt;code&amp;gt;GLShader&amp;lt;/code&amp;gt; class. All are defined in {{SourceFile|src/engine/rendererGL/gl_shader.h}}.&lt;br /&gt;
* Each GLSL shader has their compilation and loading controlled by the single GLShaderManager class&lt;br /&gt;
* Compiled shaders are cached to disk when possible to speed up load times&lt;br /&gt;
* Shader compilation may be done up front before the game loads, or delayed till the main menu depending on the value of r_lazyShaders&lt;br /&gt;
* All possible parameters (what OpenGL calls [http://www.opengl.org/sdk/docs/man4/xhtml/glUniform.xml &amp;quot;uniform variables&amp;quot;]) that may be passed to a shader are enumerated through multiple inheritance.&lt;br /&gt;
E.g., &amp;lt;code&amp;gt;gl_genericShader&amp;lt;/code&amp;gt; is of type &amp;lt;code&amp;gt;GLShader_generic*&amp;lt;/code&amp;gt; which derives from the following classes:&lt;br /&gt;
** &amp;lt;code&amp;gt;GLShader&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorMap&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorTextureMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ViewOrigin&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_AlphaTest&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ModelMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ModelViewProjectionMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorModulate&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_Color&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_BoneMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_VertexInterpolation&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_PortalPlane&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLDeformStage&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_PORTAL_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_ALPHA_TESTING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_SKINNING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_ANIMATION&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_DEFORM_VERTEXES&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_ENVIRONMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_LIGHTMAP&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The u_* parent classes provide functions that allow external code to set shader uniforms. e.g gl_genericShader-&amp;gt;SetUniform_ColorTextureMatrix()&lt;br /&gt;
&lt;br /&gt;
* GLSL shaders may be found in &amp;lt;code&amp;gt;main/glsl/&amp;lt;/code&amp;gt;. Please see the [[GLSL Shaders|full article]] for a complete listing.&lt;br /&gt;
&lt;br /&gt;
===Helper Classes===&lt;br /&gt;
&lt;br /&gt;
As mentioned above, shader classes make use of multiple inheritance to give them the relevant methods for controlling their behavior.&lt;br /&gt;
&lt;br /&gt;
====Compile Macros====&lt;br /&gt;
&lt;br /&gt;
Compile macros are used to reduce the number of uniforms needed, and speed up execution by eliminating useless if ( ) statements.&lt;br /&gt;
&lt;br /&gt;
They also allow for easy code reuse when turning off some features like e.g Normal Mapping.&lt;br /&gt;
&lt;br /&gt;
Compile macros are set when rendering before the call to shader-&amp;gt;BindProgram().&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_ALPHA_TESTING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_PORTAL_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_FRUSTUM_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_SKINNING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_ANIMATION&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_DEFORM_VERTEXES&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_ENVIRONMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_LIGHTMAP&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_NORMAL_MAPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_PARALLAX_MAPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_REFLECTIVE_SPECULAR&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_EYE_OUTSIDE&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_BRIGHTPASS_FILTER&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_LIGHT_DIRECTIONAL&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_SHADOWING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_GBUFFER&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
&lt;br /&gt;
Mac OS X users with XCode installed can access OpenGL man pages via the terminal. &amp;lt;!-- TODO: discuss how to get these on windows or linux? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, OpenGL API reference documentation is available online:&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/man3/ OpenGL 3.3 Reference Pages]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/manglsl/ OpenGL Shading Language (GLSL) Reference Pages]&lt;br /&gt;
* [http://www.khronos.org/files/opengl-quick-reference-card.pdf OpenGL 3.3 &amp;amp;amp; GLSL Quick Reference Card]&lt;br /&gt;
&lt;br /&gt;
==Valgrind and fglrx==&lt;br /&gt;
&lt;br /&gt;
fglrx drivers cause Valgrind to spew out a lot of false errors. You can suppress these by using the --suppressions=/path/to/file.supp flag. You must pass the full path (no use of the tilde symbol). The following [http://www.mediafire.com/?z6ehwrxpw2m469h file] can be used as a template for your suppression file. Keep in mind that the location of the fglrx library may need to be changed.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
&lt;br /&gt;
===Publications===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://halo.bungie.net/Inside/publications.aspx Bungie, Inc.] &amp;amp;mdash; creators of the Marathon, Myth, and Halo franchises.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://dice.se/publications/ DICE SE] &amp;amp;mdash; creators of the Battlefield franchise.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.guerrilla-games.com/publications/ Guerilla Games] &amp;amp;mdash; creators of the Killzone franchise.&lt;br /&gt;
&amp;lt;p&amp;gt;Also of interest is the &amp;quot;Making of Killzone 2&amp;quot; video series, not listed on their site:&amp;lt;/p&amp;gt;&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-1?objectid=748475 Part 1]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-2?objectid=748475 Part 2]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-3?objectid=748475 Part 3]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-4?objectid=748475 Part 4]&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.valvesoftware.com/company/publications.html Valve Software] &amp;amp;mdash; creators of the Half-Life franchise.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===General Game Development===&lt;br /&gt;
&lt;br /&gt;
* [http://devmaster.net/ Devmaster.net]&lt;br /&gt;
&lt;br /&gt;
===OpenGL===&lt;br /&gt;
&lt;br /&gt;
* [http://www.opengl.org/ Official OpenGL page]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/man3/ OpenGL 3.3 Reference Pages]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/manglsl/ OpenGL Shading Language Reference Pages]&lt;br /&gt;
* [http://arcsynthesis.org/gltut/ Learning Modern 3D Graphics Programming]&lt;br /&gt;
&lt;br /&gt;
===Quake===&lt;br /&gt;
&lt;br /&gt;
* [http://fd.fabiensanglard.net/doom3/pdfs/johnc-plan_1999.pdf John Carmack's notes from development]&lt;br /&gt;
* &amp;quot;Looking at the Quake 3 Source&amp;quot;&lt;br /&gt;
** [http://element61.blogspot.com/2005/08/looking-at-quake-3-source-part-1.html Part 1]&lt;br /&gt;
** [http://element61.blogspot.com/2005/08/looking-at-quake-3-source-part-2.html Part 2]&lt;br /&gt;
** [http://element61.blogspot.com/2005/09/looking-at-quake-3-source-part-3.html Part 3]&lt;br /&gt;
* [http://www.quakewiki.net/archives/code3arena/ Code3Arena]&lt;br /&gt;
* [http://www.modwiki.net/wiki/MD5_(file_format) MD5 file format]&lt;br /&gt;
* [http://tfc.duke.free.fr/coding/md5-specs-en.html Another MD5 format article]&lt;br /&gt;
* [http://fabiensanglard.net/quake3/index.php Quake 3 Source Code Review]&lt;br /&gt;
* [http://www.quake3world.com/forum/index.php Quake3World Discussion Forums]&lt;br /&gt;
* [http://wiki.ioquake3.org/ ioquake3 project wiki] &amp;amp;mdash; Primarily oriented for users, developers and server administrators.&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Technical_Documentation&amp;diff=1991</id>
		<title>Technical Documentation</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Technical_Documentation&amp;diff=1991"/>
		<updated>2013-04-24T04:05:51Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* Helper Classes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have a question that is not answered here, you can always hop on the [http://unvanquished.net/forum/forumdisplay.php/30-Programming programming sub-forums] or [[IRC]].&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
If you have not already, go [[Getting_the_source|get the code]], read up on your options for [[development environments]], and [[Compiling_the_source|compile it]]. Instructions are available for a variety of platforms. If your platform of choice is not listed, you are welcome to add instructions for it.&lt;br /&gt;
&lt;br /&gt;
From there, play the game! The [[Running the game]] page contains documentation on all the most commonly used and user-accessible commands and console variables. If you have trouble, see the [[troubleshooting]] page for possible solutions. Additional documentation is available on console variables:&lt;br /&gt;
* [[New_Cvars|Cvars that are new to Daemon]]&lt;br /&gt;
* [[Renderer_Status|Cvars for the renderer]] &amp;amp;mdash; This page also lists information on what renderer features are known to have issues.&lt;br /&gt;
&lt;br /&gt;
There are also very detailed instructions on [[Testing|testing the game]], which includes information on using sophisticated profiling tools such as apitrace, GPUPerfStudio, gDEBugger, valgrind, and clang-analyzer.&lt;br /&gt;
&lt;br /&gt;
===Need something to work on?===&lt;br /&gt;
&lt;br /&gt;
There's lots of places to look for work to do:&lt;br /&gt;
&lt;br /&gt;
* You are always welcome to fix any [https://github.com/Unvanquished/Unvanquished/issues issues reported on the bug tracker]. Just either leave a comment on the issue you're interested in or drop in [[IRC]] beforehand to let us know that you're working on it, so we don't try to work on it at the same time. Do be aware that we have several sub-projects, each with their own bug tracker, which are all listed on the [[Bug reporting|Bug Reporting]] page.&lt;br /&gt;
* Quick and easy tasks are listed on the [[Contributor Quickies]] page.&lt;br /&gt;
* More involved tasks are listed on the [[Programming Task List]].&lt;br /&gt;
* The most daunting challenges are listed on the [[Feature Proposals]] page. '''Be sure to communicate with us if you intend on working on one of these features!'''&lt;br /&gt;
&lt;br /&gt;
===Giving Back===&lt;br /&gt;
&lt;br /&gt;
You are welcome to contribute in any way possible! We have [[Contributing_code|guidelines for contributing code]] as well as documentation on [[Coding_convention|coding conventions]].&lt;br /&gt;
&lt;br /&gt;
==Branches==&lt;br /&gt;
&lt;br /&gt;
The following branches are under active development and may be of interest:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;librocket&amp;lt;/code&amp;gt; &amp;amp;mdash; Work to integrate libRocket is being done on this branch. libRocket is a library that will allow us to create user interfaces using dialects of HTML and CSS.&lt;br /&gt;
* &amp;lt;code&amp;gt;bots2&amp;lt;/code&amp;gt; &amp;amp;mdash; New bot code, using behavior trees.&lt;br /&gt;
&lt;br /&gt;
==Language Oddities==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;You must use the &amp;lt;code&amp;gt;INLINE&amp;lt;/code&amp;gt; macro instead of &amp;lt;code&amp;gt;inline&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;li&amp;gt;You must cast integers that are being used as enum values to an enum type. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BG_Class ( ( class_t ) self-&amp;gt;client-&amp;gt;ps.stats[ STAT_CLASS ] )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source Code &amp;amp;amp; Data Structure==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;main/&amp;lt;/code&amp;gt; Data associated with the game.&lt;br /&gt;
** &amp;lt;code&amp;gt;def/&amp;lt;/code&amp;gt; Entity definitions for [[Mapping|Radiant]].&lt;br /&gt;
** &amp;lt;code&amp;gt;fonts/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfx/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;glsl/&amp;lt;/code&amp;gt; OpenGL shader code.&lt;br /&gt;
** &amp;lt;code&amp;gt;lights/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;models/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;scripts/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;sound/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;translation/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;ui/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;engine/&amp;lt;/code&amp;gt; Engine source code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;asm/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;client/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;null/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;qcommon/&amp;lt;/code&amp;gt; Common code: utility functions, typedefs, macros, and the like.&lt;br /&gt;
*** &amp;lt;code&amp;gt;renderer/&amp;lt;/code&amp;gt; Vanilla (fixed-function pipeline) renderer&lt;br /&gt;
*** &amp;lt;code&amp;gt;rendererGL/&amp;lt;/code&amp;gt; Modern XReal-based renderer&lt;br /&gt;
*** &amp;lt;code&amp;gt;server/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;sys/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gamelogic/&amp;lt;/code&amp;gt; Code that falls outside the scope of the core engine. These are all run in separate [[virtual machines]].&lt;br /&gt;
*** &amp;lt;code&amp;gt;cgame/&amp;lt;/code&amp;gt; Client-side game code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;game/&amp;lt;/code&amp;gt; Server-side game code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;ui/&amp;lt;/code&amp;gt; User interface code.&lt;br /&gt;
&lt;br /&gt;
==Program Entry Point==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function may be found at around line 591 of {{SourceFile|src/engine/sys/sys_main.c}}. Note that some magic happens on the Mac in {{SourceFile|src/engine/sys/SDLMain.m}}.&lt;br /&gt;
&lt;br /&gt;
==Lag Compensation==&lt;br /&gt;
&lt;br /&gt;
Daemon uses Neil &amp;quot;haste&amp;quot; Toronto's [http://www.ra.is/unlagged/ Unlagged mod].&lt;br /&gt;
&lt;br /&gt;
==Data Files==&lt;br /&gt;
&lt;br /&gt;
Daemon uses a variety of file formats. Many of these formats are custom. &amp;lt;!-- just try and provide a dump of all configuration files, then I'll reorganize them --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Bot behavior trees&lt;br /&gt;
* Player configuration files&lt;br /&gt;
** Crosshair configuration&lt;br /&gt;
** Pubkey&lt;br /&gt;
** GUID&lt;br /&gt;
* Server configuration files&lt;br /&gt;
** [[Map_layouts|Map layouts]]&lt;br /&gt;
** Map rotations&lt;br /&gt;
* Particle &amp;amp; trail system files&lt;br /&gt;
* Sound configurations&lt;br /&gt;
** [[Music_and_sounds#Buildables|Buildables]]&lt;br /&gt;
* Model data ([[Exporting_Models#What_is_MD5.3F|discussion of supported formats]])&lt;br /&gt;
** Skins&lt;br /&gt;
** [[Exporting_Models#MD3_3|MD3 animation configuration files]] &amp;amp;mdash; specify which frames are for which animations&lt;br /&gt;
** Configuration files&lt;br /&gt;
*** [[Exporting_Models#Buildables_2|Buildables]]&lt;br /&gt;
*** [[Exporting_Models#Weapons_2|Weapons]]&lt;br /&gt;
*** [[Exporting_Models#Player_models_2|Player models]]&lt;br /&gt;
* Map data&lt;br /&gt;
** Map geometry (BSPs)&lt;br /&gt;
** Color grading configurations&lt;br /&gt;
&lt;br /&gt;
==Game Logic==&lt;br /&gt;
&lt;br /&gt;
Game logic is split into three areas: user interface, server-side, and client-side. Each runs in its own [[Virtual_machines|virtual machine]].&lt;br /&gt;
&lt;br /&gt;
==Client-Side==&lt;br /&gt;
&lt;br /&gt;
Buildable information is encapsulated in the &amp;lt;code&amp;gt;cg_buildables&amp;lt;/code&amp;gt; array (declared in {{SourceFile|src/gamelogic/cgame/cg_main.c|cg_main.c}})&lt;br /&gt;
&lt;br /&gt;
Constants used to define gamelogic variables are in {{SourceFile|src/gamelogic/game/tremulous.h}}.&lt;br /&gt;
&lt;br /&gt;
Types:&lt;br /&gt;
* &amp;lt;code&amp;gt;buildableInfo_t&amp;lt;/code&amp;gt; &amp;amp;mdash; Encapsulates data associated with buildables (sounds, animations, etc.).&lt;br /&gt;
* &amp;lt;code&amp;gt;buildable_t&amp;lt;/code&amp;gt; &amp;amp;mdash; An enumeration of all buildable types.&lt;br /&gt;
* &amp;lt;code&amp;gt;buildableAttributes_t&amp;lt;/code&amp;gt; &amp;amp;mdash; Encapsulates gameplay information associated with buildables. There is an array of these called &amp;lt;code&amp;gt;bg_buildableList&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Server-Side==&lt;br /&gt;
&lt;br /&gt;
Server game state initialization occurs in &amp;lt;code&amp;gt;G_InitGame()&amp;lt;/code&amp;gt; in {{SourceFile|src/gamelogic/game/g_main.c}}.&lt;br /&gt;
&lt;br /&gt;
==Particle &amp;amp;amp; Trail System==&lt;br /&gt;
&lt;br /&gt;
For now, please see the [http://tremulous.net/manual/#x1-130003.2 Tremulous documentation].&lt;br /&gt;
&lt;br /&gt;
==GL3 Renderer==&lt;br /&gt;
&lt;br /&gt;
Source code for the modern OpenGL renderer is located in {{SourceFile|src/engine/rendererGL}}. This renderer is often referred to as the &amp;quot;GL3&amp;quot; renderer, whereas the legacy renderer (found in {{SourceFile|src/engine/renderer}}) is often referred to as the &amp;quot;vanilla&amp;quot; renderer.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
* There is some incomplete disabled Direct3D code mixed in the modern OpenGL renderer code.&lt;br /&gt;
* Shaders are implemented as subclasses of the &amp;lt;code&amp;gt;GLShader&amp;lt;/code&amp;gt; class. All are defined in {{SourceFile|src/engine/rendererGL/gl_shader.h}}.&lt;br /&gt;
* Each GLSL shader has their compilation and loading controlled by the single GLShaderManager class&lt;br /&gt;
* Compiled shaders are cached to disk when possible to speed up load times&lt;br /&gt;
* Shader compilation may be done up front before the game loads, or delayed till the main menu depending on the value of r_lazyShaders&lt;br /&gt;
* All possible parameters (what OpenGL calls [http://www.opengl.org/sdk/docs/man4/xhtml/glUniform.xml &amp;quot;uniform variables&amp;quot;]) that may be passed to a shader are enumerated through multiple inheritance.&lt;br /&gt;
E.g., &amp;lt;code&amp;gt;gl_genericShader&amp;lt;/code&amp;gt; is of type &amp;lt;code&amp;gt;GLShader_generic*&amp;lt;/code&amp;gt; which derives from the following classes:&lt;br /&gt;
** &amp;lt;code&amp;gt;GLShader&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorMap&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorTextureMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ViewOrigin&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_AlphaTest&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ModelMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ModelViewProjectionMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorModulate&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_Color&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_BoneMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_VertexInterpolation&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_PortalPlane&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLDeformStage&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_PORTAL_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_ALPHA_TESTING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_SKINNING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_ANIMATION&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_DEFORM_VERTEXES&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_ENVIRONMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_LIGHTMAP&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The u_* parent classes provide functions that allow external code to set shader uniforms. e.g gl_genericShader-&amp;gt;SetUniform_ColorTextureMatrix()&lt;br /&gt;
&lt;br /&gt;
* GLSL shaders may be found in &amp;lt;code&amp;gt;main/glsl/&amp;lt;/code&amp;gt;. Please see the [[GLSL Shaders|full article]] for a complete listing.&lt;br /&gt;
&lt;br /&gt;
===Helper Classes===&lt;br /&gt;
&lt;br /&gt;
As mentioned above, shader classes make use of multiple inheritance to give them the relevant methods for controlling their behavior.&lt;br /&gt;
&lt;br /&gt;
====Compile Macros====&lt;br /&gt;
&lt;br /&gt;
Compile macros are used to reduce the number of uniforms needed, and speed up execution by eliminating useless if ( ) statements.&lt;br /&gt;
They also allow for easy code reuse when turning off some features like e.g Normal Mapping.&lt;br /&gt;
Compile macros are set when rendering before the call to shader-&amp;gt;BindProgram().&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_ALPHA_TESTING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_PORTAL_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_FRUSTUM_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_SKINNING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_ANIMATION&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_DEFORM_VERTEXES&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_ENVIRONMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_LIGHTMAP&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_NORMAL_MAPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_PARALLAX_MAPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_REFLECTIVE_SPECULAR&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_EYE_OUTSIDE&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_BRIGHTPASS_FILTER&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_LIGHT_DIRECTIONAL&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_SHADOWING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_GBUFFER&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
&lt;br /&gt;
Mac OS X users with XCode installed can access OpenGL man pages via the terminal. &amp;lt;!-- TODO: discuss how to get these on windows or linux? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, OpenGL API reference documentation is available online:&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/man3/ OpenGL 3.3 Reference Pages]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/manglsl/ OpenGL Shading Language (GLSL) Reference Pages]&lt;br /&gt;
* [http://www.khronos.org/files/opengl-quick-reference-card.pdf OpenGL 3.3 &amp;amp;amp; GLSL Quick Reference Card]&lt;br /&gt;
&lt;br /&gt;
==Valgrind and fglrx==&lt;br /&gt;
&lt;br /&gt;
fglrx drivers cause Valgrind to spew out a lot of false errors. You can suppress these by using the --suppressions=/path/to/file.supp flag. You must pass the full path (no use of the tilde symbol). The following [http://www.mediafire.com/?z6ehwrxpw2m469h file] can be used as a template for your suppression file. Keep in mind that the location of the fglrx library may need to be changed.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
&lt;br /&gt;
===Publications===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://halo.bungie.net/Inside/publications.aspx Bungie, Inc.] &amp;amp;mdash; creators of the Marathon, Myth, and Halo franchises.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://dice.se/publications/ DICE SE] &amp;amp;mdash; creators of the Battlefield franchise.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.guerrilla-games.com/publications/ Guerilla Games] &amp;amp;mdash; creators of the Killzone franchise.&lt;br /&gt;
&amp;lt;p&amp;gt;Also of interest is the &amp;quot;Making of Killzone 2&amp;quot; video series, not listed on their site:&amp;lt;/p&amp;gt;&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-1?objectid=748475 Part 1]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-2?objectid=748475 Part 2]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-3?objectid=748475 Part 3]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-4?objectid=748475 Part 4]&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.valvesoftware.com/company/publications.html Valve Software] &amp;amp;mdash; creators of the Half-Life franchise.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===General Game Development===&lt;br /&gt;
&lt;br /&gt;
* [http://devmaster.net/ Devmaster.net]&lt;br /&gt;
&lt;br /&gt;
===OpenGL===&lt;br /&gt;
&lt;br /&gt;
* [http://www.opengl.org/ Official OpenGL page]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/man3/ OpenGL 3.3 Reference Pages]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/manglsl/ OpenGL Shading Language Reference Pages]&lt;br /&gt;
* [http://arcsynthesis.org/gltut/ Learning Modern 3D Graphics Programming]&lt;br /&gt;
&lt;br /&gt;
===Quake===&lt;br /&gt;
&lt;br /&gt;
* [http://fd.fabiensanglard.net/doom3/pdfs/johnc-plan_1999.pdf John Carmack's notes from development]&lt;br /&gt;
* &amp;quot;Looking at the Quake 3 Source&amp;quot;&lt;br /&gt;
** [http://element61.blogspot.com/2005/08/looking-at-quake-3-source-part-1.html Part 1]&lt;br /&gt;
** [http://element61.blogspot.com/2005/08/looking-at-quake-3-source-part-2.html Part 2]&lt;br /&gt;
** [http://element61.blogspot.com/2005/09/looking-at-quake-3-source-part-3.html Part 3]&lt;br /&gt;
* [http://www.quakewiki.net/archives/code3arena/ Code3Arena]&lt;br /&gt;
* [http://www.modwiki.net/wiki/MD5_(file_format) MD5 file format]&lt;br /&gt;
* [http://tfc.duke.free.fr/coding/md5-specs-en.html Another MD5 format article]&lt;br /&gt;
* [http://fabiensanglard.net/quake3/index.php Quake 3 Source Code Review]&lt;br /&gt;
* [http://www.quake3world.com/forum/index.php Quake3World Discussion Forums]&lt;br /&gt;
* [http://wiki.ioquake3.org/ ioquake3 project wiki] &amp;amp;mdash; Primarily oriented for users, developers and server administrators.&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Technical_Documentation&amp;diff=1990</id>
		<title>Technical Documentation</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Technical_Documentation&amp;diff=1990"/>
		<updated>2013-04-24T03:57:56Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have a question that is not answered here, you can always hop on the [http://unvanquished.net/forum/forumdisplay.php/30-Programming programming sub-forums] or [[IRC]].&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
If you have not already, go [[Getting_the_source|get the code]], read up on your options for [[development environments]], and [[Compiling_the_source|compile it]]. Instructions are available for a variety of platforms. If your platform of choice is not listed, you are welcome to add instructions for it.&lt;br /&gt;
&lt;br /&gt;
From there, play the game! The [[Running the game]] page contains documentation on all the most commonly used and user-accessible commands and console variables. If you have trouble, see the [[troubleshooting]] page for possible solutions. Additional documentation is available on console variables:&lt;br /&gt;
* [[New_Cvars|Cvars that are new to Daemon]]&lt;br /&gt;
* [[Renderer_Status|Cvars for the renderer]] &amp;amp;mdash; This page also lists information on what renderer features are known to have issues.&lt;br /&gt;
&lt;br /&gt;
There are also very detailed instructions on [[Testing|testing the game]], which includes information on using sophisticated profiling tools such as apitrace, GPUPerfStudio, gDEBugger, valgrind, and clang-analyzer.&lt;br /&gt;
&lt;br /&gt;
===Need something to work on?===&lt;br /&gt;
&lt;br /&gt;
There's lots of places to look for work to do:&lt;br /&gt;
&lt;br /&gt;
* You are always welcome to fix any [https://github.com/Unvanquished/Unvanquished/issues issues reported on the bug tracker]. Just either leave a comment on the issue you're interested in or drop in [[IRC]] beforehand to let us know that you're working on it, so we don't try to work on it at the same time. Do be aware that we have several sub-projects, each with their own bug tracker, which are all listed on the [[Bug reporting|Bug Reporting]] page.&lt;br /&gt;
* Quick and easy tasks are listed on the [[Contributor Quickies]] page.&lt;br /&gt;
* More involved tasks are listed on the [[Programming Task List]].&lt;br /&gt;
* The most daunting challenges are listed on the [[Feature Proposals]] page. '''Be sure to communicate with us if you intend on working on one of these features!'''&lt;br /&gt;
&lt;br /&gt;
===Giving Back===&lt;br /&gt;
&lt;br /&gt;
You are welcome to contribute in any way possible! We have [[Contributing_code|guidelines for contributing code]] as well as documentation on [[Coding_convention|coding conventions]].&lt;br /&gt;
&lt;br /&gt;
==Branches==&lt;br /&gt;
&lt;br /&gt;
The following branches are under active development and may be of interest:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;librocket&amp;lt;/code&amp;gt; &amp;amp;mdash; Work to integrate libRocket is being done on this branch. libRocket is a library that will allow us to create user interfaces using dialects of HTML and CSS.&lt;br /&gt;
* &amp;lt;code&amp;gt;bots2&amp;lt;/code&amp;gt; &amp;amp;mdash; New bot code, using behavior trees.&lt;br /&gt;
&lt;br /&gt;
==Language Oddities==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;You must use the &amp;lt;code&amp;gt;INLINE&amp;lt;/code&amp;gt; macro instead of &amp;lt;code&amp;gt;inline&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;li&amp;gt;You must cast integers that are being used as enum values to an enum type. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BG_Class ( ( class_t ) self-&amp;gt;client-&amp;gt;ps.stats[ STAT_CLASS ] )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source Code &amp;amp;amp; Data Structure==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;main/&amp;lt;/code&amp;gt; Data associated with the game.&lt;br /&gt;
** &amp;lt;code&amp;gt;def/&amp;lt;/code&amp;gt; Entity definitions for [[Mapping|Radiant]].&lt;br /&gt;
** &amp;lt;code&amp;gt;fonts/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfx/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;glsl/&amp;lt;/code&amp;gt; OpenGL shader code.&lt;br /&gt;
** &amp;lt;code&amp;gt;lights/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;models/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;scripts/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;sound/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;translation/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;ui/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;engine/&amp;lt;/code&amp;gt; Engine source code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;asm/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;client/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;null/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;qcommon/&amp;lt;/code&amp;gt; Common code: utility functions, typedefs, macros, and the like.&lt;br /&gt;
*** &amp;lt;code&amp;gt;renderer/&amp;lt;/code&amp;gt; Vanilla (fixed-function pipeline) renderer&lt;br /&gt;
*** &amp;lt;code&amp;gt;rendererGL/&amp;lt;/code&amp;gt; Modern XReal-based renderer&lt;br /&gt;
*** &amp;lt;code&amp;gt;server/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;sys/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gamelogic/&amp;lt;/code&amp;gt; Code that falls outside the scope of the core engine. These are all run in separate [[virtual machines]].&lt;br /&gt;
*** &amp;lt;code&amp;gt;cgame/&amp;lt;/code&amp;gt; Client-side game code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;game/&amp;lt;/code&amp;gt; Server-side game code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;ui/&amp;lt;/code&amp;gt; User interface code.&lt;br /&gt;
&lt;br /&gt;
==Program Entry Point==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function may be found at around line 591 of {{SourceFile|src/engine/sys/sys_main.c}}. Note that some magic happens on the Mac in {{SourceFile|src/engine/sys/SDLMain.m}}.&lt;br /&gt;
&lt;br /&gt;
==Lag Compensation==&lt;br /&gt;
&lt;br /&gt;
Daemon uses Neil &amp;quot;haste&amp;quot; Toronto's [http://www.ra.is/unlagged/ Unlagged mod].&lt;br /&gt;
&lt;br /&gt;
==Data Files==&lt;br /&gt;
&lt;br /&gt;
Daemon uses a variety of file formats. Many of these formats are custom. &amp;lt;!-- just try and provide a dump of all configuration files, then I'll reorganize them --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Bot behavior trees&lt;br /&gt;
* Player configuration files&lt;br /&gt;
** Crosshair configuration&lt;br /&gt;
** Pubkey&lt;br /&gt;
** GUID&lt;br /&gt;
* Server configuration files&lt;br /&gt;
** [[Map_layouts|Map layouts]]&lt;br /&gt;
** Map rotations&lt;br /&gt;
* Particle &amp;amp; trail system files&lt;br /&gt;
* Sound configurations&lt;br /&gt;
** [[Music_and_sounds#Buildables|Buildables]]&lt;br /&gt;
* Model data ([[Exporting_Models#What_is_MD5.3F|discussion of supported formats]])&lt;br /&gt;
** Skins&lt;br /&gt;
** [[Exporting_Models#MD3_3|MD3 animation configuration files]] &amp;amp;mdash; specify which frames are for which animations&lt;br /&gt;
** Configuration files&lt;br /&gt;
*** [[Exporting_Models#Buildables_2|Buildables]]&lt;br /&gt;
*** [[Exporting_Models#Weapons_2|Weapons]]&lt;br /&gt;
*** [[Exporting_Models#Player_models_2|Player models]]&lt;br /&gt;
* Map data&lt;br /&gt;
** Map geometry (BSPs)&lt;br /&gt;
** Color grading configurations&lt;br /&gt;
&lt;br /&gt;
==Game Logic==&lt;br /&gt;
&lt;br /&gt;
Game logic is split into three areas: user interface, server-side, and client-side. Each runs in its own [[Virtual_machines|virtual machine]].&lt;br /&gt;
&lt;br /&gt;
==Client-Side==&lt;br /&gt;
&lt;br /&gt;
Buildable information is encapsulated in the &amp;lt;code&amp;gt;cg_buildables&amp;lt;/code&amp;gt; array (declared in {{SourceFile|src/gamelogic/cgame/cg_main.c|cg_main.c}})&lt;br /&gt;
&lt;br /&gt;
Constants used to define gamelogic variables are in {{SourceFile|src/gamelogic/game/tremulous.h}}.&lt;br /&gt;
&lt;br /&gt;
Types:&lt;br /&gt;
* &amp;lt;code&amp;gt;buildableInfo_t&amp;lt;/code&amp;gt; &amp;amp;mdash; Encapsulates data associated with buildables (sounds, animations, etc.).&lt;br /&gt;
* &amp;lt;code&amp;gt;buildable_t&amp;lt;/code&amp;gt; &amp;amp;mdash; An enumeration of all buildable types.&lt;br /&gt;
* &amp;lt;code&amp;gt;buildableAttributes_t&amp;lt;/code&amp;gt; &amp;amp;mdash; Encapsulates gameplay information associated with buildables. There is an array of these called &amp;lt;code&amp;gt;bg_buildableList&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Server-Side==&lt;br /&gt;
&lt;br /&gt;
Server game state initialization occurs in &amp;lt;code&amp;gt;G_InitGame()&amp;lt;/code&amp;gt; in {{SourceFile|src/gamelogic/game/g_main.c}}.&lt;br /&gt;
&lt;br /&gt;
==Particle &amp;amp;amp; Trail System==&lt;br /&gt;
&lt;br /&gt;
For now, please see the [http://tremulous.net/manual/#x1-130003.2 Tremulous documentation].&lt;br /&gt;
&lt;br /&gt;
==GL3 Renderer==&lt;br /&gt;
&lt;br /&gt;
Source code for the modern OpenGL renderer is located in {{SourceFile|src/engine/rendererGL}}. This renderer is often referred to as the &amp;quot;GL3&amp;quot; renderer, whereas the legacy renderer (found in {{SourceFile|src/engine/renderer}}) is often referred to as the &amp;quot;vanilla&amp;quot; renderer.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
* There is some incomplete disabled Direct3D code mixed in the modern OpenGL renderer code.&lt;br /&gt;
* Shaders are implemented as subclasses of the &amp;lt;code&amp;gt;GLShader&amp;lt;/code&amp;gt; class. All are defined in {{SourceFile|src/engine/rendererGL/gl_shader.h}}.&lt;br /&gt;
* Each GLSL shader has their compilation and loading controlled by the single GLShaderManager class&lt;br /&gt;
* Compiled shaders are cached to disk when possible to speed up load times&lt;br /&gt;
* Shader compilation may be done up front before the game loads, or delayed till the main menu depending on the value of r_lazyShaders&lt;br /&gt;
* All possible parameters (what OpenGL calls [http://www.opengl.org/sdk/docs/man4/xhtml/glUniform.xml &amp;quot;uniform variables&amp;quot;]) that may be passed to a shader are enumerated through multiple inheritance.&lt;br /&gt;
E.g., &amp;lt;code&amp;gt;gl_genericShader&amp;lt;/code&amp;gt; is of type &amp;lt;code&amp;gt;GLShader_generic*&amp;lt;/code&amp;gt; which derives from the following classes:&lt;br /&gt;
** &amp;lt;code&amp;gt;GLShader&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorMap&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorTextureMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ViewOrigin&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_AlphaTest&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ModelMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ModelViewProjectionMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorModulate&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_Color&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_BoneMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_VertexInterpolation&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_PortalPlane&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLDeformStage&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_PORTAL_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_ALPHA_TESTING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_SKINNING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_ANIMATION&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_DEFORM_VERTEXES&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_ENVIRONMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_LIGHTMAP&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The u_* parent classes provide functions that allow external code to set shader uniforms. e.g gl_genericShader-&amp;gt;SetUniform_ColorTextureMatrix()&lt;br /&gt;
&lt;br /&gt;
* GLSL shaders may be found in &amp;lt;code&amp;gt;main/glsl/&amp;lt;/code&amp;gt;. Please see the [[GLSL Shaders|full article]] for a complete listing.&lt;br /&gt;
&lt;br /&gt;
===Helper Classes===&lt;br /&gt;
&lt;br /&gt;
As mentioned above, shader classes make use of multiple inheritance to give them the relevant methods for controlling their behavior.&lt;br /&gt;
&lt;br /&gt;
====Uniform Variables====&lt;br /&gt;
&lt;br /&gt;
Uniform variables are enumerated in the &amp;lt;code&amp;gt;shaderProgram_t&amp;lt;/code&amp;gt; structure in {{SourceFile|src/engine/rendererGL/tr_local.h}}, and are controlled by classes beginning with the &amp;lt;code&amp;gt;u_&amp;lt;/code&amp;gt; prefix:&lt;br /&gt;
&lt;br /&gt;
* u_BoneMatrix &amp;amp;mdash; Provides the convenience method &amp;lt;code&amp;gt;SetUniform_BoneMatrix&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Compile Macros====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_ALPHA_TESTING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_PORTAL_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_FRUSTUM_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_SKINNING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_ANIMATION&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_DEFORM_VERTEXES&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_ENVIRONMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_LIGHTMAP&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_NORMAL_MAPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_PARALLAX_MAPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_REFLECTIVE_SPECULAR&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_TWOSIDED&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_EYE_OUTSIDE&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_BRIGHTPASS_FILTER&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_LIGHT_DIRECTIONAL&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_SHADOWING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_GBUFFER&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
&lt;br /&gt;
Mac OS X users with XCode installed can access OpenGL man pages via the terminal. &amp;lt;!-- TODO: discuss how to get these on windows or linux? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, OpenGL API reference documentation is available online:&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/man3/ OpenGL 3.3 Reference Pages]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/manglsl/ OpenGL Shading Language (GLSL) Reference Pages]&lt;br /&gt;
* [http://www.khronos.org/files/opengl-quick-reference-card.pdf OpenGL 3.3 &amp;amp;amp; GLSL Quick Reference Card]&lt;br /&gt;
&lt;br /&gt;
==Valgrind and fglrx==&lt;br /&gt;
&lt;br /&gt;
fglrx drivers cause Valgrind to spew out a lot of false errors. You can suppress these by using the --suppressions=/path/to/file.supp flag. You must pass the full path (no use of the tilde symbol). The following [http://www.mediafire.com/?z6ehwrxpw2m469h file] can be used as a template for your suppression file. Keep in mind that the location of the fglrx library may need to be changed.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
&lt;br /&gt;
===Publications===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://halo.bungie.net/Inside/publications.aspx Bungie, Inc.] &amp;amp;mdash; creators of the Marathon, Myth, and Halo franchises.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://dice.se/publications/ DICE SE] &amp;amp;mdash; creators of the Battlefield franchise.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.guerrilla-games.com/publications/ Guerilla Games] &amp;amp;mdash; creators of the Killzone franchise.&lt;br /&gt;
&amp;lt;p&amp;gt;Also of interest is the &amp;quot;Making of Killzone 2&amp;quot; video series, not listed on their site:&amp;lt;/p&amp;gt;&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-1?objectid=748475 Part 1]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-2?objectid=748475 Part 2]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-3?objectid=748475 Part 3]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-4?objectid=748475 Part 4]&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.valvesoftware.com/company/publications.html Valve Software] &amp;amp;mdash; creators of the Half-Life franchise.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===General Game Development===&lt;br /&gt;
&lt;br /&gt;
* [http://devmaster.net/ Devmaster.net]&lt;br /&gt;
&lt;br /&gt;
===OpenGL===&lt;br /&gt;
&lt;br /&gt;
* [http://www.opengl.org/ Official OpenGL page]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/man3/ OpenGL 3.3 Reference Pages]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/manglsl/ OpenGL Shading Language Reference Pages]&lt;br /&gt;
* [http://arcsynthesis.org/gltut/ Learning Modern 3D Graphics Programming]&lt;br /&gt;
&lt;br /&gt;
===Quake===&lt;br /&gt;
&lt;br /&gt;
* [http://fd.fabiensanglard.net/doom3/pdfs/johnc-plan_1999.pdf John Carmack's notes from development]&lt;br /&gt;
* &amp;quot;Looking at the Quake 3 Source&amp;quot;&lt;br /&gt;
** [http://element61.blogspot.com/2005/08/looking-at-quake-3-source-part-1.html Part 1]&lt;br /&gt;
** [http://element61.blogspot.com/2005/08/looking-at-quake-3-source-part-2.html Part 2]&lt;br /&gt;
** [http://element61.blogspot.com/2005/09/looking-at-quake-3-source-part-3.html Part 3]&lt;br /&gt;
* [http://www.quakewiki.net/archives/code3arena/ Code3Arena]&lt;br /&gt;
* [http://www.modwiki.net/wiki/MD5_(file_format) MD5 file format]&lt;br /&gt;
* [http://tfc.duke.free.fr/coding/md5-specs-en.html Another MD5 format article]&lt;br /&gt;
* [http://fabiensanglard.net/quake3/index.php Quake 3 Source Code Review]&lt;br /&gt;
* [http://www.quake3world.com/forum/index.php Quake3World Discussion Forums]&lt;br /&gt;
* [http://wiki.ioquake3.org/ ioquake3 project wiki] &amp;amp;mdash; Primarily oriented for users, developers and server administrators.&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Technical_Documentation&amp;diff=1989</id>
		<title>Technical Documentation</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Technical_Documentation&amp;diff=1989"/>
		<updated>2013-04-24T03:55:40Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have a question that is not answered here, you can always hop on the [http://unvanquished.net/forum/forumdisplay.php/30-Programming programming sub-forums] or [[IRC]].&lt;br /&gt;
&lt;br /&gt;
==Getting Started==&lt;br /&gt;
&lt;br /&gt;
If you have not already, go [[Getting_the_source|get the code]], read up on your options for [[development environments]], and [[Compiling_the_source|compile it]]. Instructions are available for a variety of platforms. If your platform of choice is not listed, you are welcome to add instructions for it.&lt;br /&gt;
&lt;br /&gt;
From there, play the game! The [[Running the game]] page contains documentation on all the most commonly used and user-accessible commands and console variables. If you have trouble, see the [[troubleshooting]] page for possible solutions. Additional documentation is available on console variables:&lt;br /&gt;
* [[New_Cvars|Cvars that are new to Daemon]]&lt;br /&gt;
* [[Renderer_Status|Cvars for the renderer]] &amp;amp;mdash; This page also lists information on what renderer features are known to have issues.&lt;br /&gt;
&lt;br /&gt;
There are also very detailed instructions on [[Testing|testing the game]], which includes information on using sophisticated profiling tools such as apitrace, GPUPerfStudio, gDEBugger, valgrind, and clang-analyzer.&lt;br /&gt;
&lt;br /&gt;
===Need something to work on?===&lt;br /&gt;
&lt;br /&gt;
There's lots of places to look for work to do:&lt;br /&gt;
&lt;br /&gt;
* You are always welcome to fix any [https://github.com/Unvanquished/Unvanquished/issues issues reported on the bug tracker]. Just either leave a comment on the issue you're interested in or drop in [[IRC]] beforehand to let us know that you're working on it, so we don't try to work on it at the same time. Do be aware that we have several sub-projects, each with their own bug tracker, which are all listed on the [[Bug reporting|Bug Reporting]] page.&lt;br /&gt;
* Quick and easy tasks are listed on the [[Contributor Quickies]] page.&lt;br /&gt;
* More involved tasks are listed on the [[Programming Task List]].&lt;br /&gt;
* The most daunting challenges are listed on the [[Feature Proposals]] page. '''Be sure to communicate with us if you intend on working on one of these features!'''&lt;br /&gt;
&lt;br /&gt;
===Giving Back===&lt;br /&gt;
&lt;br /&gt;
You are welcome to contribute in any way possible! We have [[Contributing_code|guidelines for contributing code]] as well as documentation on [[Coding_convention|coding conventions]].&lt;br /&gt;
&lt;br /&gt;
==Branches==&lt;br /&gt;
&lt;br /&gt;
The following branches are under active development and may be of interest:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;librocket&amp;lt;/code&amp;gt; &amp;amp;mdash; Work to integrate libRocket is being done on this branch. libRocket is a library that will allow us to create user interfaces using dialects of HTML and CSS.&lt;br /&gt;
* &amp;lt;code&amp;gt;bots2&amp;lt;/code&amp;gt; &amp;amp;mdash; New bot code, using behavior trees.&lt;br /&gt;
&lt;br /&gt;
==Language Oddities==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;You must use the &amp;lt;code&amp;gt;INLINE&amp;lt;/code&amp;gt; macro instead of &amp;lt;code&amp;gt;inline&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;li&amp;gt;You must cast integers that are being used as enum values to an enum type. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BG_Class ( ( class_t ) self-&amp;gt;client-&amp;gt;ps.stats[ STAT_CLASS ] )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source Code &amp;amp;amp; Data Structure==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;main/&amp;lt;/code&amp;gt; Data associated with the game.&lt;br /&gt;
** &amp;lt;code&amp;gt;def/&amp;lt;/code&amp;gt; Entity definitions for [[Mapping|Radiant]].&lt;br /&gt;
** &amp;lt;code&amp;gt;fonts/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gfx/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;glsl/&amp;lt;/code&amp;gt; OpenGL shader code.&lt;br /&gt;
** &amp;lt;code&amp;gt;lights/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;models/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;scripts/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;sound/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;translation/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;ui/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;src/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;engine/&amp;lt;/code&amp;gt; Engine source code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;asm/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;client/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;null/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;qcommon/&amp;lt;/code&amp;gt; Common code: utility functions, typedefs, macros, and the like.&lt;br /&gt;
*** &amp;lt;code&amp;gt;renderer/&amp;lt;/code&amp;gt; Vanilla (fixed-function pipeline) renderer&lt;br /&gt;
*** &amp;lt;code&amp;gt;rendererGL/&amp;lt;/code&amp;gt; Modern XReal-based renderer&lt;br /&gt;
*** &amp;lt;code&amp;gt;server/&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;sys/&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;gamelogic/&amp;lt;/code&amp;gt; Code that falls outside the scope of the core engine. These are all run in separate [[virtual machines]].&lt;br /&gt;
*** &amp;lt;code&amp;gt;cgame/&amp;lt;/code&amp;gt; Client-side game code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;game/&amp;lt;/code&amp;gt; Server-side game code.&lt;br /&gt;
*** &amp;lt;code&amp;gt;ui/&amp;lt;/code&amp;gt; User interface code.&lt;br /&gt;
&lt;br /&gt;
==Program Entry Point==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; function may be found at around line 591 of {{SourceFile|src/engine/sys/sys_main.c}}. Note that some magic happens on the Mac in {{SourceFile|src/engine/sys/SDLMain.m}}.&lt;br /&gt;
&lt;br /&gt;
==Lag Compensation==&lt;br /&gt;
&lt;br /&gt;
Daemon uses Neil &amp;quot;haste&amp;quot; Toronto's [http://www.ra.is/unlagged/ Unlagged mod].&lt;br /&gt;
&lt;br /&gt;
==Data Files==&lt;br /&gt;
&lt;br /&gt;
Daemon uses a variety of file formats. Many of these formats are custom. &amp;lt;!-- just try and provide a dump of all configuration files, then I'll reorganize them --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Bot behavior trees&lt;br /&gt;
* Player configuration files&lt;br /&gt;
** Crosshair configuration&lt;br /&gt;
** Pubkey&lt;br /&gt;
** GUID&lt;br /&gt;
* Server configuration files&lt;br /&gt;
** [[Map_layouts|Map layouts]]&lt;br /&gt;
** Map rotations&lt;br /&gt;
* Particle &amp;amp; trail system files&lt;br /&gt;
* Sound configurations&lt;br /&gt;
** [[Music_and_sounds#Buildables|Buildables]]&lt;br /&gt;
* Model data ([[Exporting_Models#What_is_MD5.3F|discussion of supported formats]])&lt;br /&gt;
** Skins&lt;br /&gt;
** [[Exporting_Models#MD3_3|MD3 animation configuration files]] &amp;amp;mdash; specify which frames are for which animations&lt;br /&gt;
** Configuration files&lt;br /&gt;
*** [[Exporting_Models#Buildables_2|Buildables]]&lt;br /&gt;
*** [[Exporting_Models#Weapons_2|Weapons]]&lt;br /&gt;
*** [[Exporting_Models#Player_models_2|Player models]]&lt;br /&gt;
* Map data&lt;br /&gt;
** Map geometry (BSPs)&lt;br /&gt;
** Color grading configurations&lt;br /&gt;
&lt;br /&gt;
==Game Logic==&lt;br /&gt;
&lt;br /&gt;
Game logic is split into three areas: user interface, server-side, and client-side. Each runs in its own [[Virtual_machines|virtual machine]].&lt;br /&gt;
&lt;br /&gt;
==Client-Side==&lt;br /&gt;
&lt;br /&gt;
Buildable information is encapsulated in the &amp;lt;code&amp;gt;cg_buildables&amp;lt;/code&amp;gt; array (declared in {{SourceFile|src/gamelogic/cgame/cg_main.c|cg_main.c}})&lt;br /&gt;
&lt;br /&gt;
Constants used to define gamelogic variables are in {{SourceFile|src/gamelogic/game/tremulous.h}}.&lt;br /&gt;
&lt;br /&gt;
Types:&lt;br /&gt;
* &amp;lt;code&amp;gt;buildableInfo_t&amp;lt;/code&amp;gt; &amp;amp;mdash; Encapsulates data associated with buildables (sounds, animations, etc.).&lt;br /&gt;
* &amp;lt;code&amp;gt;buildable_t&amp;lt;/code&amp;gt; &amp;amp;mdash; An enumeration of all buildable types.&lt;br /&gt;
* &amp;lt;code&amp;gt;buildableAttributes_t&amp;lt;/code&amp;gt; &amp;amp;mdash; Encapsulates gameplay information associated with buildables. There is an array of these called &amp;lt;code&amp;gt;bg_buildableList&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Server-Side==&lt;br /&gt;
&lt;br /&gt;
Server game state initialization occurs in &amp;lt;code&amp;gt;G_InitGame()&amp;lt;/code&amp;gt; in {{SourceFile|src/gamelogic/game/g_main.c}}.&lt;br /&gt;
&lt;br /&gt;
==Particle &amp;amp;amp; Trail System==&lt;br /&gt;
&lt;br /&gt;
For now, please see the [http://tremulous.net/manual/#x1-130003.2 Tremulous documentation].&lt;br /&gt;
&lt;br /&gt;
==GL3 Renderer==&lt;br /&gt;
&lt;br /&gt;
Source code for the modern OpenGL renderer is located in {{SourceFile|src/engine/rendererGL}}. This renderer is often referred to as the &amp;quot;GL3&amp;quot; renderer, whereas the legacy renderer (found in {{SourceFile|src/engine/renderer}}) is often referred to as the &amp;quot;vanilla&amp;quot; renderer.&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
&lt;br /&gt;
* There is some incomplete disabled Direct3D code mixed in the modern OpenGL renderer code.&lt;br /&gt;
Shaders are implemented as subclasses of the &amp;lt;code&amp;gt;GLShader&amp;lt;/code&amp;gt; class. All are defined in {{SourceFile|src/engine/rendererGL/gl_shader.h}}.&lt;br /&gt;
* Compiled GLSL shader files (located in the hard-coded location &amp;lt;code&amp;gt;&amp;quot;glsl/&amp;lt;shadername&amp;gt;/&amp;quot;&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;.bin&amp;lt;/code&amp;gt; filename extension) are read by &amp;lt;code&amp;gt;GLShaderManager::LoadShaderBinary()&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Each GLSL shader has their compilation and loading controlled by the single GLShaderManager class&lt;br /&gt;
* Shader compilation may be done up front before the game loads, or delayed till the main menu depending on the value of r_lazyShaders&lt;br /&gt;
* All possible parameters (what OpenGL calls [http://www.opengl.org/sdk/docs/man4/xhtml/glUniform.xml &amp;quot;uniform variables&amp;quot;]) that may be passed to a shader are enumerated through multiple inheritance.&lt;br /&gt;
E.g., &amp;lt;code&amp;gt;gl_genericShader&amp;lt;/code&amp;gt; is of type &amp;lt;code&amp;gt;GLShader_generic*&amp;lt;/code&amp;gt; which derives from the following classes:&lt;br /&gt;
** &amp;lt;code&amp;gt;GLShader&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorMap&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorTextureMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ViewOrigin&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_AlphaTest&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ModelMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ModelViewProjectionMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_ColorModulate&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_Color&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_BoneMatrix&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_VertexInterpolation&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;u_PortalPlane&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLDeformStage&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_PORTAL_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_ALPHA_TESTING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_SKINNING&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_ANIMATION&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_DEFORM_VERTEXES&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_ENVIRONMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_LIGHTMAP&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The u_* parent classes provide functions that allow external code to set shader uniforms. e.g gl_genericShader-&amp;gt;SetUniform_ColorTextureMatrix()&lt;br /&gt;
&lt;br /&gt;
* GLSL shaders may be found in &amp;lt;code&amp;gt;main/glsl/&amp;lt;/code&amp;gt;. Please see the [[GLSL Shaders|full article]] for a complete listing.&lt;br /&gt;
&lt;br /&gt;
===Helper Classes===&lt;br /&gt;
&lt;br /&gt;
As mentioned above, shader classes make use of multiple inheritance to give them the relevant methods for controlling their behavior.&lt;br /&gt;
&lt;br /&gt;
====Uniform Variables====&lt;br /&gt;
&lt;br /&gt;
Uniform variables are enumerated in the &amp;lt;code&amp;gt;shaderProgram_t&amp;lt;/code&amp;gt; structure in {{SourceFile|src/engine/rendererGL/tr_local.h}}, and are controlled by classes beginning with the &amp;lt;code&amp;gt;u_&amp;lt;/code&amp;gt; prefix:&lt;br /&gt;
&lt;br /&gt;
* u_BoneMatrix &amp;amp;mdash; Provides the convenience method &amp;lt;code&amp;gt;SetUniform_BoneMatrix&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Compile Macros====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_ALPHA_TESTING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_PORTAL_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_FRUSTUM_CLIPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_SKINNING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_VERTEX_ANIMATION&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_DEFORM_VERTEXES&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_ENVIRONMENT&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_TCGEN_LIGHTMAP&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_NORMAL_MAPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_PARALLAX_MAPPING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_REFLECTIVE_SPECULAR&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_TWOSIDED&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_EYE_OUTSIDE&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_BRIGHTPASS_FILTER&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_LIGHT_DIRECTIONAL&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_SHADOWING&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;GLCompileMacro_USE_GBUFFER&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
&lt;br /&gt;
Mac OS X users with XCode installed can access OpenGL man pages via the terminal. &amp;lt;!-- TODO: discuss how to get these on windows or linux? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, OpenGL API reference documentation is available online:&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/man3/ OpenGL 3.3 Reference Pages]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/manglsl/ OpenGL Shading Language (GLSL) Reference Pages]&lt;br /&gt;
* [http://www.khronos.org/files/opengl-quick-reference-card.pdf OpenGL 3.3 &amp;amp;amp; GLSL Quick Reference Card]&lt;br /&gt;
&lt;br /&gt;
==Valgrind and fglrx==&lt;br /&gt;
&lt;br /&gt;
fglrx drivers cause Valgrind to spew out a lot of false errors. You can suppress these by using the --suppressions=/path/to/file.supp flag. You must pass the full path (no use of the tilde symbol). The following [http://www.mediafire.com/?z6ehwrxpw2m469h file] can be used as a template for your suppression file. Keep in mind that the location of the fglrx library may need to be changed.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
&lt;br /&gt;
===Publications===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://halo.bungie.net/Inside/publications.aspx Bungie, Inc.] &amp;amp;mdash; creators of the Marathon, Myth, and Halo franchises.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://dice.se/publications/ DICE SE] &amp;amp;mdash; creators of the Battlefield franchise.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.guerrilla-games.com/publications/ Guerilla Games] &amp;amp;mdash; creators of the Killzone franchise.&lt;br /&gt;
&amp;lt;p&amp;gt;Also of interest is the &amp;quot;Making of Killzone 2&amp;quot; video series, not listed on their site:&amp;lt;/p&amp;gt;&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-1?objectid=748475 Part 1]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-2?objectid=748475 Part 2]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-3?objectid=748475 Part 3]&lt;br /&gt;
* [http://www.ign.com/videos/2009/01/27/killzone-2-ps3-the-making-of-killzone-2-part-4?objectid=748475 Part 4]&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.valvesoftware.com/company/publications.html Valve Software] &amp;amp;mdash; creators of the Half-Life franchise.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===General Game Development===&lt;br /&gt;
&lt;br /&gt;
* [http://devmaster.net/ Devmaster.net]&lt;br /&gt;
&lt;br /&gt;
===OpenGL===&lt;br /&gt;
&lt;br /&gt;
* [http://www.opengl.org/ Official OpenGL page]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/man3/ OpenGL 3.3 Reference Pages]&lt;br /&gt;
* [http://www.opengl.org/sdk/docs/manglsl/ OpenGL Shading Language Reference Pages]&lt;br /&gt;
* [http://arcsynthesis.org/gltut/ Learning Modern 3D Graphics Programming]&lt;br /&gt;
&lt;br /&gt;
===Quake===&lt;br /&gt;
&lt;br /&gt;
* [http://fd.fabiensanglard.net/doom3/pdfs/johnc-plan_1999.pdf John Carmack's notes from development]&lt;br /&gt;
* &amp;quot;Looking at the Quake 3 Source&amp;quot;&lt;br /&gt;
** [http://element61.blogspot.com/2005/08/looking-at-quake-3-source-part-1.html Part 1]&lt;br /&gt;
** [http://element61.blogspot.com/2005/08/looking-at-quake-3-source-part-2.html Part 2]&lt;br /&gt;
** [http://element61.blogspot.com/2005/09/looking-at-quake-3-source-part-3.html Part 3]&lt;br /&gt;
* [http://www.quakewiki.net/archives/code3arena/ Code3Arena]&lt;br /&gt;
* [http://www.modwiki.net/wiki/MD5_(file_format) MD5 file format]&lt;br /&gt;
* [http://tfc.duke.free.fr/coding/md5-specs-en.html Another MD5 format article]&lt;br /&gt;
* [http://fabiensanglard.net/quake3/index.php Quake 3 Source Code Review]&lt;br /&gt;
* [http://www.quake3world.com/forum/index.php Quake3World Discussion Forums]&lt;br /&gt;
* [http://wiki.ioquake3.org/ ioquake3 project wiki] &amp;amp;mdash; Primarily oriented for users, developers and server administrators.&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Getting_the_source&amp;diff=100</id>
		<title>Getting the source</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Getting_the_source&amp;diff=100"/>
		<updated>2012-03-16T21:18:35Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* ToroiseGIT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
==Installing Git==&lt;br /&gt;
&lt;br /&gt;
If you already have Git installed, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Windows users can acquire git from the [http://code.google.com/p/msysgit/ MSysGit project]. If you would prefer a graphical front-end, there is [http://code.google.com/p/tortoisegit/ TortoiseGit], but regardless MSysGit must be installed.&lt;br /&gt;
&lt;br /&gt;
===Mac OS X===&lt;br /&gt;
&lt;br /&gt;
Apple has included Git with Xcode since version 4. You may download Xcode from [https://developer.apple.com/xcode/ Apple's developer website].&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
====Debian &amp;amp; Ubuntu====&lt;br /&gt;
&lt;br /&gt;
Install git using the package manager:&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install git&lt;br /&gt;
&lt;br /&gt;
==Downloading the source==&lt;br /&gt;
&lt;br /&gt;
The Unvanquished source code is hosted on GitHub [https://github.com/TremZ/Unvanquished here]. You can either download a snapshot of the source by clicking 'ZIP', or you can use git to clone the repository.&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Use git on the command line:&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/TremZ/Unvanquished.git&lt;br /&gt;
&lt;br /&gt;
This will create a directory called &amp;lt;code&amp;gt;Unvanquished&amp;lt;/code&amp;gt; in your home folder.&lt;br /&gt;
&lt;br /&gt;
===Mac OS X===&lt;br /&gt;
&lt;br /&gt;
====Command Line====&lt;br /&gt;
&lt;br /&gt;
Acquiring the source code using the command line is the same as on Linux. Just open a Terminal (/Applications/Utilities/Terminal) window and clone the source code like so:&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/TremZ/Unvanquished.git&lt;br /&gt;
&lt;br /&gt;
====Xcode 4====&lt;br /&gt;
&lt;br /&gt;
# Start Xcode.&lt;br /&gt;
# Open the Organizer window (Window &amp;amp;rarr; Organizer or &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;Shift&amp;lt;/span&amp;gt;+&amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;Command&amp;amp;nbsp;&amp;amp;#x2318;&amp;lt;/span&amp;gt;+&amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;)&lt;br /&gt;
# Click the &amp;quot;Repositories&amp;quot; button on the top bar.&lt;br /&gt;
# Click the &amp;quot;+&amp;quot; button in the lower-left corner, and choose &amp;quot;Checkout or Clone Repository&amp;amp;hellip;&amp;quot;.&lt;br /&gt;
# In the rollout sheet that appears, enter &amp;lt;code&amp;gt;https://github.com/TremZ/Unvanquished.git&amp;lt;/code&amp;gt; into the &amp;quot;Location&amp;quot; field, and click &amp;quot;Next&amp;quot;.&lt;br /&gt;
# Enter &amp;quot;Unvanquished&amp;quot; into the &amp;quot;Name&amp;quot; field, ensure that the &amp;quot;Type&amp;quot; combo box is set to &amp;quot;Git&amp;quot;, and click &amp;quot;Clone&amp;quot;.&lt;br /&gt;
# You will be prompted where to save the repository. Choose a location and click &amp;quot;Clone&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
====ToroiseGIT====&lt;br /&gt;
&lt;br /&gt;
# Make and enter a new folder to store the source code in&lt;br /&gt;
# Right click the inside of the folder -&amp;gt; Git Clone...&lt;br /&gt;
# In the Url textbox enter: &amp;lt;code&amp;gt;https://github.com/TremZ/Unvanquished.git&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click ok.&lt;br /&gt;
&lt;br /&gt;
====Command Line====&lt;br /&gt;
Open the MsysGit terminal and type:&lt;br /&gt;
 $ git clone https://github.com/Tremz/Unvanquished.git&lt;br /&gt;
&lt;br /&gt;
==Compiling==&lt;br /&gt;
&lt;br /&gt;
Please see [[Compiling the source|this page]] for more information.&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Getting_the_source&amp;diff=99</id>
		<title>Getting the source</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Getting_the_source&amp;diff=99"/>
		<updated>2012-03-16T21:18:16Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* Downloading the source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
==Installing Git==&lt;br /&gt;
&lt;br /&gt;
If you already have Git installed, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Windows users can acquire git from the [http://code.google.com/p/msysgit/ MSysGit project]. If you would prefer a graphical front-end, there is [http://code.google.com/p/tortoisegit/ TortoiseGit], but regardless MSysGit must be installed.&lt;br /&gt;
&lt;br /&gt;
===Mac OS X===&lt;br /&gt;
&lt;br /&gt;
Apple has included Git with Xcode since version 4. You may download Xcode from [https://developer.apple.com/xcode/ Apple's developer website].&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
====Debian &amp;amp; Ubuntu====&lt;br /&gt;
&lt;br /&gt;
Install git using the package manager:&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install git&lt;br /&gt;
&lt;br /&gt;
==Downloading the source==&lt;br /&gt;
&lt;br /&gt;
The Unvanquished source code is hosted on GitHub [https://github.com/TremZ/Unvanquished here]. You can either download a snapshot of the source by clicking 'ZIP', or you can use git to clone the repository.&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
&lt;br /&gt;
Use git on the command line:&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/TremZ/Unvanquished.git&lt;br /&gt;
&lt;br /&gt;
This will create a directory called &amp;lt;code&amp;gt;Unvanquished&amp;lt;/code&amp;gt; in your home folder.&lt;br /&gt;
&lt;br /&gt;
===Mac OS X===&lt;br /&gt;
&lt;br /&gt;
====Command Line====&lt;br /&gt;
&lt;br /&gt;
Acquiring the source code using the command line is the same as on Linux. Just open a Terminal (/Applications/Utilities/Terminal) window and clone the source code like so:&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/TremZ/Unvanquished.git&lt;br /&gt;
&lt;br /&gt;
====Xcode 4====&lt;br /&gt;
&lt;br /&gt;
# Start Xcode.&lt;br /&gt;
# Open the Organizer window (Window &amp;amp;rarr; Organizer or &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;Shift&amp;lt;/span&amp;gt;+&amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;Command&amp;amp;nbsp;&amp;amp;#x2318;&amp;lt;/span&amp;gt;+&amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;)&lt;br /&gt;
# Click the &amp;quot;Repositories&amp;quot; button on the top bar.&lt;br /&gt;
# Click the &amp;quot;+&amp;quot; button in the lower-left corner, and choose &amp;quot;Checkout or Clone Repository&amp;amp;hellip;&amp;quot;.&lt;br /&gt;
# In the rollout sheet that appears, enter &amp;lt;code&amp;gt;https://github.com/TremZ/Unvanquished.git&amp;lt;/code&amp;gt; into the &amp;quot;Location&amp;quot; field, and click &amp;quot;Next&amp;quot;.&lt;br /&gt;
# Enter &amp;quot;Unvanquished&amp;quot; into the &amp;quot;Name&amp;quot; field, ensure that the &amp;quot;Type&amp;quot; combo box is set to &amp;quot;Git&amp;quot;, and click &amp;quot;Clone&amp;quot;.&lt;br /&gt;
# You will be prompted where to save the repository. Choose a location and click &amp;quot;Clone&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
====ToroiseGIT====&lt;br /&gt;
&lt;br /&gt;
# Make and enter a new Folder to store the source code in&lt;br /&gt;
# Right click the inside of the folder -&amp;gt; Git Clone...&lt;br /&gt;
# In the Url textbox enter: &amp;lt;code&amp;gt;https://github.com/TremZ/Unvanquished.git&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click ok.&lt;br /&gt;
&lt;br /&gt;
====Command Line====&lt;br /&gt;
Open the MsysGit terminal and type:&lt;br /&gt;
 $ git clone https://github.com/Tremz/Unvanquished.git&lt;br /&gt;
&lt;br /&gt;
==Compiling==&lt;br /&gt;
&lt;br /&gt;
Please see [[Compiling the source|this page]] for more information.&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Compiling_the_source&amp;diff=98</id>
		<title>Compiling the source</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Compiling_the_source&amp;diff=98"/>
		<updated>2012-03-16T21:09:45Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
The preferred way of building Unvanquished on Mac OS X is to use Apple's [https://developer.apple.com/xcode/ XCode] along with [http://www.cmake.org/cmake/resources/software.html CMake]; CMake is used to generate an XCode project file that is then used to compile the code. &amp;lt;!-- TODO: is it possible to build using gcc? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, follow the instructions on [[Getting_the_source##Mac_OS_X_2|this page]] to acquire the source code.&lt;br /&gt;
&lt;br /&gt;
Next, perform the following:&lt;br /&gt;
&lt;br /&gt;
# Run CMake.&lt;br /&gt;
# Enter the location of the source code.&lt;br /&gt;
# Enter the location in which you would like to build the source code. This may be the same directory.&lt;br /&gt;
# Click &amp;quot;Configure&amp;quot;. You will be prompted as to which generator you would like to use. If you have Xcode installed, choose that.&lt;br /&gt;
# Wait while the configuration process runs.&lt;br /&gt;
# '''''TODO: explain which libraries will likely have to be set'''''&lt;br /&gt;
# Click &amp;quot;Generate&amp;quot;.&lt;br /&gt;
# Close CMake and open Xcode.&lt;br /&gt;
# Open the project file created by CMake, which should be in the build directory you specified.&lt;br /&gt;
# Click the build button.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
The preferred way of building Unvanquished on Windows is to use Microsoft Visual Studio.&lt;br /&gt;
The free Express version of the software works fine.&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
# Open src/engine/Daemon.sln in Visual Studio&lt;br /&gt;
# In the two text boxes in the toolbar, select &amp;quot;Release&amp;quot; in the first one and Win32 or Win64 in the second one&lt;br /&gt;
# Use Build -&amp;gt; Build Solution to compile the code&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===Debian &amp;amp; Ubuntu===&lt;br /&gt;
&lt;br /&gt;
====Dependencies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- TODO: this may be incomplete --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install libcurl4-gnutls-dev libfreetype6-dev libglew1.5-dev \&lt;br /&gt;
   libgmp-dev libjpeg8-dev libncurses5-dev libogg-dev libopenal-dev \&lt;br /&gt;
   libpng12-dev libsdl1.2-dev libvorbis-dev zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
====Configuring the code with CMake====&lt;br /&gt;
&lt;br /&gt;
After you have [[Getting the source|acquired the source code]], you can proceed to compile. Unvanquished uses CMake, so you must have that installed. &lt;br /&gt;
&lt;br /&gt;
=====Using ccmake (curses-based front-end)=====&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install cmake-curses-gui&lt;br /&gt;
&lt;br /&gt;
Note that in Ubuntu, &amp;lt;code&amp;gt;cmake-curses-gui&amp;lt;/code&amp;gt; is in Universe, which you may have to enable with &amp;lt;code&amp;gt;software-properties-gtk&amp;lt;/code&amp;gt;. Make sure to reload the software sources with &amp;lt;code&amp;gt;sudo apt-get update&amp;lt;/code&amp;gt; afterwards.&lt;br /&gt;
&lt;br /&gt;
Next, configure the codebase.&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;var&amp;gt;/path/to/unvanquished&amp;lt;/var&amp;gt;&lt;br /&gt;
 $ ccmake .&lt;br /&gt;
&lt;br /&gt;
Alternatively, you may want to build the engine in another directory.&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;var&amp;gt;/path/to/unvanquished&amp;lt;/var&amp;gt;&lt;br /&gt;
 $ mkdir build&lt;br /&gt;
 $ cd build&lt;br /&gt;
 $ ccmake ..&lt;br /&gt;
&lt;br /&gt;
Once in &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt;, use the following keys:&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt; to configure. If an error occurs during this phase, make note of it and press &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;e&amp;lt;/span&amp;gt; to dismiss it.&lt;br /&gt;
* Use the up and down arrow keys to navigate the compilation options.&lt;br /&gt;
* Press &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;Enter&amp;lt;/span&amp;gt; to enable or disable boolean options (i.e., on/off) or to edit textual options.&lt;br /&gt;
** Press &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;Esc&amp;lt;/span&amp;gt; when editing a textual option to cancel the change.&lt;br /&gt;
&lt;br /&gt;
Once you have finished the configuration process, press &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt; again, then &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt; to generate the makefile.&lt;br /&gt;
&lt;br /&gt;
=====Using cmake-qt-gui (graphical front-end)=====&lt;br /&gt;
&lt;br /&gt;
This graphical front end for cmake has its own package you must install:&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install cmake-qt-gui&lt;br /&gt;
&lt;br /&gt;
Once installed, run with &amp;lt;code&amp;gt;cmake-gui&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Cmake-qt-gui.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Set the path where you have the source code downloaded.&lt;br /&gt;
# Set the path where you would like to build the engine. This may be the same directory if you wish.&lt;br /&gt;
# Click 'Configure'.&lt;br /&gt;
# Click 'Generate'.&lt;br /&gt;
&lt;br /&gt;
=====Unnecessary libraries=====&lt;br /&gt;
&lt;br /&gt;
Regardless of which front-end to cmake you use, you may want to disable some libraries that are not strictly necessary:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MYSQL_LIBRARIES&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;MYSQL_INCLUDE_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;USE_OPENAL&amp;lt;/code&amp;gt; &amp;amp;mdash; If this is disabled, SDL is used instead for sound.&lt;br /&gt;
* &amp;lt;code&amp;gt;USE_CODEC_VORBIS&amp;lt;/code&amp;gt; &amp;amp;mdash; Disabling this will cause certain sound effects (those using the &amp;lt;code&amp;gt;.ogg&amp;lt;/code&amp;gt; format) not to play. At present, this has only a minor impact on gameplay, but more and more sounds will likely use the format in the future.&lt;br /&gt;
* &amp;lt;code&amp;gt;USE_CURSES&amp;lt;/code&amp;gt; &amp;amp;mdash; Disabling this will cause the external (not in-game) console to not use curses; it will not be scrollable and will be similar to the console in the original Tremulous. This does in no way affect gameplay.&lt;br /&gt;
&lt;br /&gt;
====Compiling====&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;var&amp;gt;/path/to/uvanquished&amp;lt;/var&amp;gt;&lt;br /&gt;
 $ make -j4&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;-j&amp;lt;/code&amp;gt; switch to make allows you to speed up the compilation process by running it in multiple threads; set the number following this to the number of cores your processor(s) have.&lt;br /&gt;
&lt;br /&gt;
====Acquiring the Game Files====&lt;br /&gt;
&lt;br /&gt;
The game files are not in the Git repository, and must be downloaded separately.&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;var&amp;gt;path/to/Unvanquished&amp;lt;/var&amp;gt;&lt;br /&gt;
 $ cd main&lt;br /&gt;
 $ wget http://sourceforge.net/projects/unvanquished/files/Assets/pak0.pk3/download&lt;br /&gt;
 $ wget http://sourceforge.net/projects/unvanquished/files/Assets/pak0.pk3/download&lt;br /&gt;
 $ wget http://sourceforge.net/projects/unvanquished/files/Map%20Pack/maps.7z/download&lt;br /&gt;
&lt;br /&gt;
Now you can proceed to [[running the game]].&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
	<entry>
		<id>https://staging-wiki.unvanquished.net/index.php?title=Compiling_the_source&amp;diff=97</id>
		<title>Compiling the source</title>
		<link rel="alternate" type="text/html" href="https://staging-wiki.unvanquished.net/index.php?title=Compiling_the_source&amp;diff=97"/>
		<updated>2012-03-16T21:09:25Z</updated>

		<summary type="html">&lt;p&gt;Fuma: /* Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
==Mac OS X==&lt;br /&gt;
&lt;br /&gt;
The preferred way of building Unvanquished on Mac OS X is to use Apple's [https://developer.apple.com/xcode/ XCode] along with [http://www.cmake.org/cmake/resources/software.html CMake]; CMake is used to generate an XCode project file that is then used to compile the code. &amp;lt;!-- TODO: is it possible to build using gcc? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, follow the instructions on [[Getting_the_source##Mac_OS_X_2|this page]] to acquire the source code.&lt;br /&gt;
&lt;br /&gt;
Next, perform the following:&lt;br /&gt;
&lt;br /&gt;
# Run CMake.&lt;br /&gt;
# Enter the location of the source code.&lt;br /&gt;
# Enter the location in which you would like to build the source code. This may be the same directory.&lt;br /&gt;
# Click &amp;quot;Configure&amp;quot;. You will be prompted as to which generator you would like to use. If you have Xcode installed, choose that.&lt;br /&gt;
# Wait while the configuration process runs.&lt;br /&gt;
# '''''TODO: explain which libraries will likely have to be set'''''&lt;br /&gt;
# Click &amp;quot;Generate&amp;quot;.&lt;br /&gt;
# Close CMake and open Xcode.&lt;br /&gt;
# Open the project file created by CMake, which should be in the build directory you specified.&lt;br /&gt;
# Click the build button.&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
&lt;br /&gt;
The preferred way of building Unvanquished on Windows is to use Microsoft Visual Studio.&lt;br /&gt;
The free Express version of the software works fine.&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
# 1. Open src/engine/Daemon.sln in Visual Studio&lt;br /&gt;
# 2. In the two text boxes in the toolbar, select &amp;quot;Release&amp;quot; in the first one and Win32 or Win64 in the second one&lt;br /&gt;
# 3. Use Build -&amp;gt; Build Solution to compile the code&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===Debian &amp;amp; Ubuntu===&lt;br /&gt;
&lt;br /&gt;
====Dependencies====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- TODO: this may be incomplete --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install libcurl4-gnutls-dev libfreetype6-dev libglew1.5-dev \&lt;br /&gt;
   libgmp-dev libjpeg8-dev libncurses5-dev libogg-dev libopenal-dev \&lt;br /&gt;
   libpng12-dev libsdl1.2-dev libvorbis-dev zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
====Configuring the code with CMake====&lt;br /&gt;
&lt;br /&gt;
After you have [[Getting the source|acquired the source code]], you can proceed to compile. Unvanquished uses CMake, so you must have that installed. &lt;br /&gt;
&lt;br /&gt;
=====Using ccmake (curses-based front-end)=====&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install cmake-curses-gui&lt;br /&gt;
&lt;br /&gt;
Note that in Ubuntu, &amp;lt;code&amp;gt;cmake-curses-gui&amp;lt;/code&amp;gt; is in Universe, which you may have to enable with &amp;lt;code&amp;gt;software-properties-gtk&amp;lt;/code&amp;gt;. Make sure to reload the software sources with &amp;lt;code&amp;gt;sudo apt-get update&amp;lt;/code&amp;gt; afterwards.&lt;br /&gt;
&lt;br /&gt;
Next, configure the codebase.&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;var&amp;gt;/path/to/unvanquished&amp;lt;/var&amp;gt;&lt;br /&gt;
 $ ccmake .&lt;br /&gt;
&lt;br /&gt;
Alternatively, you may want to build the engine in another directory.&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;var&amp;gt;/path/to/unvanquished&amp;lt;/var&amp;gt;&lt;br /&gt;
 $ mkdir build&lt;br /&gt;
 $ cd build&lt;br /&gt;
 $ ccmake ..&lt;br /&gt;
&lt;br /&gt;
Once in &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt;, use the following keys:&lt;br /&gt;
&lt;br /&gt;
* Press &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt; to configure. If an error occurs during this phase, make note of it and press &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;e&amp;lt;/span&amp;gt; to dismiss it.&lt;br /&gt;
* Use the up and down arrow keys to navigate the compilation options.&lt;br /&gt;
* Press &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;Enter&amp;lt;/span&amp;gt; to enable or disable boolean options (i.e., on/off) or to edit textual options.&lt;br /&gt;
** Press &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;Esc&amp;lt;/span&amp;gt; when editing a textual option to cancel the change.&lt;br /&gt;
&lt;br /&gt;
Once you have finished the configuration process, press &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt; again, then &amp;lt;span class=&amp;quot;hotkey&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt; to generate the makefile.&lt;br /&gt;
&lt;br /&gt;
=====Using cmake-qt-gui (graphical front-end)=====&lt;br /&gt;
&lt;br /&gt;
This graphical front end for cmake has its own package you must install:&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install cmake-qt-gui&lt;br /&gt;
&lt;br /&gt;
Once installed, run with &amp;lt;code&amp;gt;cmake-gui&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Cmake-qt-gui.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Set the path where you have the source code downloaded.&lt;br /&gt;
# Set the path where you would like to build the engine. This may be the same directory if you wish.&lt;br /&gt;
# Click 'Configure'.&lt;br /&gt;
# Click 'Generate'.&lt;br /&gt;
&lt;br /&gt;
=====Unnecessary libraries=====&lt;br /&gt;
&lt;br /&gt;
Regardless of which front-end to cmake you use, you may want to disable some libraries that are not strictly necessary:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;MYSQL_LIBRARIES&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;MYSQL_INCLUDE_DIR&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;USE_OPENAL&amp;lt;/code&amp;gt; &amp;amp;mdash; If this is disabled, SDL is used instead for sound.&lt;br /&gt;
* &amp;lt;code&amp;gt;USE_CODEC_VORBIS&amp;lt;/code&amp;gt; &amp;amp;mdash; Disabling this will cause certain sound effects (those using the &amp;lt;code&amp;gt;.ogg&amp;lt;/code&amp;gt; format) not to play. At present, this has only a minor impact on gameplay, but more and more sounds will likely use the format in the future.&lt;br /&gt;
* &amp;lt;code&amp;gt;USE_CURSES&amp;lt;/code&amp;gt; &amp;amp;mdash; Disabling this will cause the external (not in-game) console to not use curses; it will not be scrollable and will be similar to the console in the original Tremulous. This does in no way affect gameplay.&lt;br /&gt;
&lt;br /&gt;
====Compiling====&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;var&amp;gt;/path/to/uvanquished&amp;lt;/var&amp;gt;&lt;br /&gt;
 $ make -j4&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;-j&amp;lt;/code&amp;gt; switch to make allows you to speed up the compilation process by running it in multiple threads; set the number following this to the number of cores your processor(s) have.&lt;br /&gt;
&lt;br /&gt;
====Acquiring the Game Files====&lt;br /&gt;
&lt;br /&gt;
The game files are not in the Git repository, and must be downloaded separately.&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;var&amp;gt;path/to/Unvanquished&amp;lt;/var&amp;gt;&lt;br /&gt;
 $ cd main&lt;br /&gt;
 $ wget http://sourceforge.net/projects/unvanquished/files/Assets/pak0.pk3/download&lt;br /&gt;
 $ wget http://sourceforge.net/projects/unvanquished/files/Assets/pak0.pk3/download&lt;br /&gt;
 $ wget http://sourceforge.net/projects/unvanquished/files/Map%20Pack/maps.7z/download&lt;br /&gt;
&lt;br /&gt;
Now you can proceed to [[running the game]].&lt;/div&gt;</summary>
		<author><name>Fuma</name></author>
	</entry>
</feed>