Difference between revisions of "Music and sounds"

From Unvanquished
Jump to: navigation, search
(Licensing: Creative Commons does not recommend that the Sampling license be used anymore. To avoid duplicate content, link to the Contributors page.)
(CC-Sampling Plus is not suitable for a game, we are not sampling them but redistributing them unmodified, also even CC discourage this license which is a license mistake)
Line 1: Line 1:
==Licensing==
+
==Overview==
  
Please read the section on licensing in the [[Contributing|contributing guide]].
+
TODO
  
==When not to use stereo==
+
==Licensing==
  
Sounds that are played with spatialization—i.e., those which are played in the game world—should be mono. It is acceptable to use stereo sounds for the menu and similar.
+
The following licenses are suitable for music and sounds:
  
==Sound replacement progress==
+
* [http://creativecommons.org/licenses/by-sa/2.0 CC-BY-SA] (v2.0 or newer)
 
+
Please see the [[Sound_Progress|full article]].
+
  
 
==Configuration files==
 
==Configuration files==
Line 15: Line 13:
 
===Buildables===
 
===Buildables===
  
There are 14 animations (animation types) per buildable (buildable type): ''construct1'', ''construct2'', ''idle1'', ''idle2'', ''idle3'', ''attack1'', ''attack2'', ''spawn1'', ''spawn2'', ''pain1'', ''pain2'', ''destroy1'', ''destroy2'', and ''destroyed''. Note that not all of these are used for a given buildable and the spawn2 and destroy2 sounds are never used; see the [[Exporting_Models#MD5_4|model exporting guide]] for more information. Each buildable has a sound configuration file, located at ''sound/buildables/<var><buildable></var>/sound.cfg'', that describes two properties for each buildable animation:
+
There are 14 animations per buildable type: ''construct1'', ''construct2'', ''idle1'', ''idle2'', ''idle3'', ''attack1'', ''attack2'', ''spawn1'', ''spawn2'', ''pain1'', ''pain2'', ''destroy1'', ''destroy2'', and ''destroyed''. Each buildable type has a sound configuration file, located at ''sound/buildables/<var><buildable_type></var>/sound.cfg'', that describes 2 properties for each buildable animation:
* whether a unique (buildable-specific) sound is associated with the given buildable animation, and
+
* whether the buildable animation has an associated sound, and
* whether the animation's sound is to be played in a loop.
+
* whether the sound is to be played in a loop.
Such a file should contain a <em>1</em> for a <em>yes</em> answer and a <em>0</em> for a <em>no</em> answer, for the above 2 questions, in the given order, for each buildable animation. Technically, this means that the file should contain 28 integers (2 per animation). However, by convention, 1 line is used for each animation, and comments are added for guidance about which animation a pair of numbers refers to.
+
Such a file should contain a <em>1</em> for a <em>yes</em> answer and a <em>0</em> for a <em>no</em> answer, for the above 2 questions, in the given order, and for each buildable animation, in the above given order. Technically, this means that the file should contain 28 integers (2 per animation). However, by convention, 1 line is used for each animation, and comments are added for guidance about which animation a pair of numbers refers to.
 
+
{{Note|header = Engine Developer Note|disregardby = sound designers|content =
+
 
+
Filenames for sounds for buildable animations are enumerated in the <code>cg_buildableSoundNames</code> array in {{SourceFile|src/gamelogic/game/bg_public.h}}. Buildable sound files are loaded in CG_InitBuildables() in {{SourceFile|src/gamelogic/cgame/cg_buildable.c}}.
+
}}
+
  
 
So each line in a buildable sound configuration file is formatted as follows:
 
So each line in a buildable sound configuration file is formatted as follows:
  <var><unique></var> <var><loop></var> //<var><filename></var>
+
  <var><has_sound></var> <var><loop></var> //<var><filename></var>
  
 
An example of a full buildable sound configuration file is:
 
An example of a full buildable sound configuration file is:
Line 46: Line 39:
 
</pre>
 
</pre>
 
Again, the comments only help human readers, and are indifferent to the game (do <em>not</em> reorder the lines!).
 
Again, the comments only help human readers, and are indifferent to the game (do <em>not</em> reorder the lines!).
 
If, for a particular buildable, a unique sound is associated with a particular animation, then the game will look for the buildable-specific ''sound/buildables/<var><buildable></var>/<var><animation></var>.wav'' audio file, and otherwise (and also if the buildable-specific audio file cannot be found) the game will use the default ''sound/buildables/<var>team</var>/<var><animation></var>.wav'' (based on the team of the buildable).
 
  
 
==Sound filenames==
 
==Sound filenames==
  
A list of all the sound filenames currently in use is available on the [[Sound_Progress|sound progress]] page.
+
The structure <code>cg_customSoundNames</code> in [https://github.com/TremZ/Unvanquished/blob/master/src/gamelogic/gpp/src/cgame/cg_players.c src/gamelogic/gpp/src/cgame/cg_players.c] contains a list of some sounds.
 
+
* The structure <code>cg_customSoundNames</code> in [https://github.com/Unvanquished/Unvanquished/blob/master/src/gamelogic/cgame/cg_players.c src/gamelogic/cgame/cg_players.c] contains a list of some sounds.
+
* Sounds for weapons are controlled by the [[Exporting_Models#Weapons_2|weapon configuration file]].
+
* A number of sounds are loaded in <code>CG_RegisterSounds()</code> in [https://github.com/Unvanquished/Unvanquished/blob/master/src/gamelogic/cgame/cg_main.c src/gamelogic/cgame/cg_main.c].
+
 
+
==Resources==
+
 
+
* [http://www.youtube.com/watch?v=ZPRTrrbdPew Action Movie Sound Design] A video explaining some of the thought process that goes behind designing sound for action sequences, which translates fairly well into games.
+

Revision as of 21:25, 16 October 2017

Overview

TODO

Licensing

The following licenses are suitable for music and sounds:

Configuration files

Buildables

There are 14 animations per buildable type: construct1, construct2, idle1, idle2, idle3, attack1, attack2, spawn1, spawn2, pain1, pain2, destroy1, destroy2, and destroyed. Each buildable type has a sound configuration file, located at sound/buildables/<buildable_type>/sound.cfg, that describes 2 properties for each buildable animation:

  • whether the buildable animation has an associated sound, and
  • whether the sound is to be played in a loop.

Such a file should contain a 1 for a yes answer and a 0 for a no answer, for the above 2 questions, in the given order, and for each buildable animation, in the above given order. Technically, this means that the file should contain 28 integers (2 per animation). However, by convention, 1 line is used for each animation, and comments are added for guidance about which animation a pair of numbers refers to.

So each line in a buildable sound configuration file is formatted as follows:

<has_sound> <loop> //<filename>

An example of a full buildable sound configuration file is:

1 0 //construct1.wav
0 0 //construct2.wav
1 1 //idle1.wav
0 0 //idle2.wav
0 0 //idle3.wav
0 0 //attack1.wav
0 0 //attack2.wav
0 0 //spawn1.wav
0 0 //spawn2.wav
0 0 //pain1.wav
0 0 //pain2.wav
1 0 //destroy1.wav
1 0 //destroy2.wav
0 0 //destroyed.wav

Again, the comments only help human readers, and are indifferent to the game (do not reorder the lines!).

Sound filenames

The structure cg_customSoundNames in src/gamelogic/gpp/src/cgame/cg_players.c contains a list of some sounds.