Difference between revisions of "Music and sounds"

From Unvanquished
Jump to: navigation, search
(add more permissive suitable licenses)
(Configuration files: rewrite some DevHC words since he is unreachable for relicensing)
 
Line 23: Line 23:
 
  <var><has_sound></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:
+
This is an sound configuration file example for a buildable:
 
<pre>
 
<pre>
 
1 0 //construct1.wav
 
1 0 //construct1.wav
Line 40: Line 40:
 
0 0 //destroyed.wav
 
0 0 //destroyed.wav
 
</pre>
 
</pre>
Again, the comments only help human readers, and are indifferent to the game (do <em>not</em> reorder the lines!).
+
 
 +
Do not reorder the lines because it's how the game knows what is what. The comments are for humans only!
  
 
==Sound filenames==
 
==Sound filenames==
  
 
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/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.

Latest revision as of 14:36, 22 January 2018

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>

This is an sound configuration file example for a buildable:

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

Do not reorder the lines because it's how the game knows what is what. The comments are for humans only!

Sound filenames

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