Jump to content

XML:SNDD: Difference between revisions

72 bytes removed ,  28 March 2021
m
copy-edit
m (correcting prev/next types in nav header)
m (copy-edit)
Line 2: Line 2:
{{finish}}
{{finish}}
{| border=0 cellspacing=20 cellpadding=0 style="margin-left:auto; margin-right:auto"
{| border=0 cellspacing=20 cellpadding=0 style="margin-left:auto; margin-right:auto"
| More OSBD .grp / .amb information could be useful and .imp is completely left out so far.
| Needed: More OSBD .grp / .amb information could be useful, and .imp is completely left out so far.
 
The xml code on this page is based on onisplit '''v0.9.61.0'''
|}
|}


__TOC__
{{TOClimit|2}}
 
 
: '''''How do I get sounds into Oni?'''''
 
'''In order to make your sounds available on both sides - pc and mac - you need to create them twice (one time from a wav source and another time from an aif/aifc/afc source).'''


==General information==
*The XML on this page is based on OniSplit '''v0.9.61.0'''.
*In order to make your sounds work on both Windows and Mac, you need to create them twice (one time from a WAV source and another time from an AIFF source).


==Source file creation==
==Source file creation==
Line 57: Line 53:
Note the double ".aif" suffix applied to the outputted files. If you are replacing existing Oni sounds, this is necessary due to Oni's sound resources possessing a ".aif" suffix as part of their <u>actual resource names</u> (yes, even the WAV-encoded sounds in Windows Oni). So if you import them with a name like "SNDDgears.aif", the file suffix gets changed to ".oni" upon import by OniSplit, and you end up with a resource simply titled "SNDDgears" in-game. Oni will be looking for a sound titled "SNDDgears.aif", and won't find it. Hence, we title the AIFF file "SNDDgears.aif.aif" so that OniSplit yields "SNDDgears.aif.oni" upon importing, which in turn produces the resource named "SNDDgears.aif" that Oni desires.
Note the double ".aif" suffix applied to the outputted files. If you are replacing existing Oni sounds, this is necessary due to Oni's sound resources possessing a ".aif" suffix as part of their <u>actual resource names</u> (yes, even the WAV-encoded sounds in Windows Oni). So if you import them with a name like "SNDDgears.aif", the file suffix gets changed to ".oni" upon import by OniSplit, and you end up with a resource simply titled "SNDDgears" in-game. Oni will be looking for a sound titled "SNDDgears.aif", and won't find it. Hence, we title the AIFF file "SNDDgears.aif.aif" so that OniSplit yields "SNDDgears.aif.oni" upon importing, which in turn produces the resource named "SNDDgears.aif" that Oni desires.


If you're using Windows, you may find out that your newly-converted '''ima4''' AIFF files will not play. This does not mean the files themselves are broken — they will actually play on Macs, but not in Windows, despite having been created in Windows. The reason for this remains to be investigated.
If you're using Windows, you may find that your newly-converted '''ima4''' AIFF files will not play. This does not mean the files themselves are broken — they will actually play on Macs, but not in Windows, despite having been created in Windows. The reason for this remains to be investigated.


==Oni file creation==
==Oni file creation==
===via Vago===
===Via Vago===
Installation:
Installation:
* Oni/AE/[[Anniversary_Edition/Installer#Tools|AEInstaller2.exe > Tools > Manage Tools]]
* Oni/AE/[[Anniversary_Edition/Installer#Tools|AEInstaller2.exe > Tools > Manage Tools]]
Line 68: Line 64:
* Tools > Sound Wizard
* Tools > Sound Wizard


 
===Via batch file===
===via batch file===
'''SNDD for Windows'''
'''SNDD for Windows'''
  onisplit -create output_PC_files input/*.wav
  onisplit -create output_PC_files input/*.wav
Line 82: Line 77:
  pause
  pause


 
===Via command line===
===via command line===
For those who want to do it on their own.
For those who want to do it on their own.


Line 90: Line 84:
: -create output_directory_'''PC''' input_directory/'''*.wav'''
: -create output_directory_'''PC''' input_directory/'''*.wav'''
: -create output_directory input_directory/*.xml
: -create output_directory input_directory/*.xml
For fast xml text changes and naming give them all ''yourfile'' as name if you have only one sound:
For fast XML text changes and naming, give them all ''yourfile'' as the name, if you have only one sound:
: <font color=#AAAAAA>SNDD</font>yourfile<font color=#AAAAAA>.oni</font>
: <font color=#AAAAAA>SNDD</font>yourfile<font color=#AAAAAA>.oni</font>
: <font color=#AAAAAA>OSBD</font>yourfile<font color=#AAAAAA>'''.grp'''.oni</font>
: <font color=#AAAAAA>OSBD</font>yourfile<font color=#AAAAAA>'''.grp'''.oni</font>
: <font color=#AAAAAA>OSBD</font>yourfile<font color=#AAAAAA>'''.amb'''.oni</font>
: <font color=#AAAAAA>OSBD</font>yourfile<font color=#AAAAAA>'''.amb'''.oni</font>


==OSBD information==
==OSBD information==
OSBD files are stored globally (in level0_Final).
OSBD files are stored globally (in level0_Final).


'''when use what'''
'''When to use what'''


* OSBD*.'''amb'''
* OSBD*.'''amb'''
Line 120: Line 113:




'''details on music'''
'''Details on music'''
: OSBD_newmusic.amb.oni (The main file, links to the group, intro and ending files)
: OSBD_newmusic.amb.oni (The main file links to the group, intro and ending files)
: OSBD_newmusic.grp.oni (Contain links to the music files)
: OSBD_newmusic.grp.oni (Links to the music files)
: OSBD_newmusic_in.grp.oni (Links to intro part of the music - Optional)
: OSBD_newmusic_in.grp.oni (Links to intro part of the music — optional)
: OSBD_newmusic_out.grp.oni (Links to the ending of the music - Optional)
: OSBD_newmusic_out.grp.oni (Links to the ending of the music — optional)
: SNDD_newmusic1.oni (The individual music files - Its best to break up the music into segments of perhaps 30 secs to a minute each - Oni may crash or become sluggish if you use a single file for the music -- EdT) (What are the limits? --[[User:Paradox-01|Paradox-01]])
: SNDD_newmusic1.oni (The individual music files; it's best to break up the music into segments of perhaps 30 secs to a minute each Oni may crash or become sluggish if you use a single file for the music)


Music parts between intro and outro are played in a random order.
Breaking the main loop of the music into parts allows Oni to more smoothly transition to the ending part when necessary; the amount of time that a track will play cannot be predicted, after all, since players will take varying amounts of time to clear that segment of the level.


Why would Bungie have wanted random parts? A fair guess can be made with the songs' purpose: giving fights more ''atmosphere''. But every player finishes the enemies in a different time: one wins in 2 minutes, the other in 6 minutes, etc. So 1) modular parts seem perfect to delay the outro part when it's necessary and 2) a random order adds more variety (making the loop less boring).
The parts of the music between intro and outro are played in a randomized order, probably to add more variety to the loop.


grp files have a <Weight> tag under <Permutation>. [[wikipedia:Permutation|Permutation]] should have something to do how music parts get repeated. However, it's not clear what influence <Weight> has on the repetitions. Is it like TRAC's <Weight> used for probability?
Note that .grp files have a <Weight> tag under <Permutation>. "[[wikipedia:Permutation|Permutation]]" should have something to do how music parts get repeated. However, it's not clear what influence <Weight> has on the repetitions. Is it like TRAC's <Weight>, used for probability?


===OSBDfile.imp.xml===
===OSBDfile.imp.xml===
What is an impulse? Looking at the XML it seems unique in its spacial features: <Volume><Angle> / <Volume><MinAttenuation> / <ImpactVelocity> / <MinOcclusion>
What is an impulse? Looking at the XML, it has these special features: <Volume><Angle> / <Volume><MinAttenuation> / <ImpactVelocity> / <MinOcclusion>. This is because impulses are the preferred choice for moving sound sources. A few more facts:
 
*They cannot be stopped by BSL once triggered to play.
Hypothesis:
*AIs can hear them.
# Impulses are preferably used by moving sources.
*The minimum and maximum volume angle seem to be always 360 degrees. These properties might be a development artifact, since sound should propagate through space in all directions, and the area of effect is mostly determined by their volume distance.
# They cannot be stopped by BSL once triggered to play.
# AI can hear them
# Minimum and maximum volume angle seems to be always 360 degrees. Maybe artifact properties since sound should propagate through space in all directions and area of effect is mostly made by their volume distance.
# File structure is always the same.
 


{| class="wikitable" width=100%
{| class="wikitable" width=100%
|width=120px| '''tag'''
|width=120px| '''Tag'''
|width=100px| '''type'''
|width=100px| '''Type'''
| '''description'''
| '''Description'''
|-
|-
| <ImpulseSound>
| <ImpulseSound>
Line 160: Line 148:
|valign="top"| flag
|valign="top"| flag
| When are these different flags used?
| When are these different flags used?
: Low (default impact related? (ONIE concrete) + shell (ammunition)?)
: Low (default for impacts? (ONIE concrete) + shell (ammunition)?)
: Normal (AI, animation and impact related?)
: Normal (AI, animation and impact related?)
: High (OSBDtrigger_hit.imp.xml only?)
: High (OSBDtrigger_hit.imp.xml only?)
Line 175: Line 163:
| <Min>
| <Min>
| float
| float
| between min radius (distance) and sound origin the sound volume is equally strong
| From the sound's origin point out to Min radius (distance), the sound volume is equally strong.
|-
|-
| <Max>
| <Max>
| float
| float
| between max and min radius (distance) there's a transition of the sound volume, greater distance than max makes the sound unhearable
| Between Min and Max radius (distance) the sound volume decreases; a greater distance than Max makes the sound inaudible.
|-
|-
| <Angle>
| <Angle>
| -
| -
| Space angle? Does this work like the <Distance> tag?
| Spatial angle? Does this work like the <Distance> tag?
|-
|-
| <Min>
| <Min>
Line 213: Line 201:
|
|
|}
|}


===OSBDfile.amb.xml===
===OSBDfile.amb.xml===
In case you want to create a simple sound file you can basically copy the code and change the red marked stuff in the examples.  
In case you want to create a simple sound file, you can basically copy the examples below and change the portions marked in red.  
: OSBDfile.grp.xml, OSBDfile.amb.xml, BINACJBOSound.xml are showing the code from the [http://mods.oni2.net/node/177 '''nyan cat mod'''].
: OSBDfile.grp.xml, OSBDfile.amb.xml, BINACJBOSound.xml are showing the markup from the [http://mods.oni2.net/node/177 '''Nyan Cat mod'''].
 


{| class="wikitable" width=100%
{| class="wikitable" width=100%
|width=120px| '''tag'''
|width=120px| '''Tag'''
|width=100px| '''type'''
|width=100px| '''Type'''
| '''description'''
| '''Description'''
|-
|-
| <AmbientSound>
| <AmbientSound>
Line 240: Line 226:
|valign="top"| flag
|valign="top"| flag
|
|
: InterruptTracksOnStop - this flag must be set if you want to use BSL command ''sound_music_stop''
: InterruptTracksOnStop this flag must be set if you want to use the BSL command ''sound_music_stop''
: PlayOnce
: PlayOnce
: CanPan
: CanPan
Line 308: Line 294:
|
|
|}
|}


An example:
An example:
Line 339: Line 324:
     </AmbientSound>
     </AmbientSound>
  </Oni>
  </Oni>


===OSBDfile.grp.xml===
===OSBDfile.grp.xml===
{| class="wikitable" width=100%
{| class="wikitable" width=100%
|width=120px| '''tag'''
|width=120px| '''Tag'''
|width=100px| '''type'''
|width=100px| '''Type'''
| '''description'''
| '''Description'''
|-
|-
| <SoundGroup>
| <SoundGroup>
Line 361: Line 345:
| <Flags>
| <Flags>
| flag
| flag
| PreventRepeat - forces to play different sounds if there are more than one permutations
| PreventRepeat - Oni will play different permutations of the sound, if there is more than one permutation
|-
|-
|valign="top"| <NumberOfChannels>
|valign="top"| <NumberOfChannels>
|valign="top"| int32
|valign="top"| int32
| Here you tell Oni if your sound file is mono or stereo. Windows' 44.1 kHz is an exception.
| Here you tell Oni if your sound file is mono or stereo. 44.1 kHz sounds in Windows are an exception.


{|class="wikitable" width="100%"
{|class="wikitable" width="100%"
Line 379: Line 363:
|}
|}


;consequences of wrong imports:
;Consequences of wrong imports:
: if grp's <NumberOfChannels> is 1 and sound file is 22.05 kHz, stereo then the sound won't get played
: If the .grp's <NumberOfChannels> is 1 and the sound file is 22.05 kHz stereo then the sound won't get played
: if grp's <NumberOfChannels> is 1 and sound file is 44.1 kHz, mono then the sound will play distorted
: If the .grp's <NumberOfChannels> is 1 and the sound file is 44.1 kHz mono then the sound will play distorted


|-
|-
| <Permutations>
| <Permutations>
| -
| -
| int32 array for the <Permutation> tags.
| int32 array for the <Permutation> tags
|-
|-
| <Permutation>
| <Permutation>
Line 424: Line 408:
| <font color=#AAAAAA>SNDD</font>name<font color=#AAAAAA>.oni</font>, file prefix and suffix aren't used
| <font color=#AAAAAA>SNDD</font>name<font color=#AAAAAA>.oni</font>, file prefix and suffix aren't used
|}
|}


An example:
An example:
  <?xml version="1.0" encoding="utf-8"?>
  <?xml version="1.0" encoding="utf-8"?>
  <Oni>
  <Oni>
Line 453: Line 435:


==BINACJBOSound.xml==
==BINACJBOSound.xml==
This is for area-fixed sounds.
This is for sounds fixed to a certain area.
 


{| class="wikitable" width=100%
{| class="wikitable" width=100%
|width=120px| '''tag'''
|width=120px| '''Tag'''
|width=100px| '''type'''
|width=100px| '''Type'''
| '''description'''
| '''Description'''
|-
|-
| <Objects>
| <Objects>
Line 467: Line 448:
| <SNDG Id="...">
| <SNDG Id="...">
| integer
| integer
| This tag marks the file as a sound list. ID doesn't matter at import time.
| This tag marks the file as a sound list. The ID doesn't matter at import time.
|-
|-
| <Header>
| <Header>
Line 475: Line 456:
|valign="top"| <Flags>
|valign="top"| <Flags>
|valign="top"| flag
|valign="top"| flag
| Ignore it. Those flags were used in the past.
| You can ignore these flags, as they are defunct:
: None  
: None  
: Locked  
: Locked  
Line 484: Line 465:
| <Position>
| <Position>
| float x3
| float x3
| here you tell Oni where you want the sound to be [[OBD_talk:BINA/OBJC|located]]
| Here you tell Oni where you want the sound to be [[OBD_talk:BINA/OBJC|located]].
|-
|-
| <Rotation>
| <Rotation>
Line 504: Line 485:
| <MinRadius>
| <MinRadius>
| float
| float
| between min radius and sound origin (<Position>) the sound volume is equally strong
| From the point of the sound's origin (<Position>) out to Min radius, the sound volume is equally strong.
|-
|-
| <MaxRadius>
| <MaxRadius>
| float
| float
| between max and min radius there is a transition of the sound volume, greater distance than max makes the sound unhearable
| Between Min and Max radius, the sound volume will decrease; greater distance than Max makes the sound inaudible.
|-
|-
| <Box>
| <Box>
| -
| -
| alternative to <Sphere>, a box would be a better choice if you want to limit a sound to a specific room
| You can use this alternative to <Sphere> if you want to limit a sound to a specific room.
|-
|-
| <Min>
| <Min>
Line 522: Line 503:
| X2 Y2 Z2
| X2 Y2 Z2
|}
|}


An example:
An example:
         <SNDG Id="8805">
         <SNDG Id="8805">
             <Header>
             <Header>
Line 543: Line 522:
         </SNDG>
         </SNDG>


==Sound-related BSL commands==
* [[BSL:Functions#sound|Commands listed on wiki]]
* [http://ssg.oni2.net/commands.htm#sound Original list on ssg's website]


==sound-related BSL commands==
sound_music_stop ''soundtrack'' — can only be used if .amb file has the InterruptTracksOnStop flag<br>
* [[BSL:Functions#sound|on this wiki]]
sound_music_stop ''soundtrack'' 1 — music drops to zero volume over 1 second
* [http://ssg.oni2.net/commands.htm#sound on ssg's website]


 
You need a custom function if you want to fade out a soundtrack over more than one second. It could look like this:
sound_music_stop ''soundtrack'' - can only be used if .amb file has the InterruptTracksOnStop flag<br>
sound_music_stop ''soundtrack'' 1 - soundtrack stop after 1 second while it gets quieter
 
You need a custom function if you want to fade out a soundtrack over more than one seconds. It could look like this:


  var float x = 1;
  var float x = 1;
  var int y = 0;
  var int y = 0;
   
   
  # don't test this function with the console, it could happen that the function stops working after 4 cycles
  # Don't test this function with the console or the function might stop working after 4 cycles
  func fade_music
  func fade_music
  {
  {
   # if statement with float values doesn't seem to work therefore the int y
   # An 'if' statement with float values doesn't seem to work, therefore the int y
  y = y + 1
  y = y + 1
  x = x - .01
  x = x - .01
Line 576: Line 553:
  }
  }


 
==OCF thread about making new music==
 
 
==OCF thread about new music==
See [http://oni.bungie.org/forum/viewtopic.php?id=798 here].
See [http://oni.bungie.org/forum/viewtopic.php?id=798 here].


==How to register sounds to characters==
==How to register sounds to characters==
... such as sounds of heavy attacks and taunts.
...such as the sounds of heavy attacks and taunts.
 


'''Let's see how sounds become picked up:'''<br>Schemata:
'''Let's see how sounds become picked up:'''<br>Schemata:
: TRAM -> ONCC -> OSBD.amb -> OSBD.grp -> SNDD
: TRAM -> ONCC -> OSBD.amb -> OSBD.grp -> SNDD
Explanation:
Explanation:
* The character performs a move / attack whereby the TRAM file holds a sound ID (<Vocalization>).
* The character performs a move/attack where the TRAM file holds a sound ID (<Vocalization>).
* A link (OSBD.amb name) in ONCC file becomes looked up based on the sound ID.<br>Note that the ONCC file has also a probability value that decides whether a sound becomes played or not.
* A link (OSBD.amb name) in the ONCC file will be looked up based on the sound ID. Note that the ONCC file has also a probability value that decides whether a sound will be played or not.
* The game engine looks into OSBD.amb and follows the link into OSBD.grp.
* The game engine looks into OSBD.amb and follows the link into OSBD.grp.
* '''OSBD.grp can hold multiple links to SNDD files.''' That's why Konoko can have multiple taunt sounds.
* '''OSBD.grp can hold multiple links to SNDD files.''' That's why Konoko can have multiple taunt sounds.


 
===Step 1: Preparing the TRAM===
===step 1: preparing the TRAM===
'''Search for <Vocalization> in the TRAM file''' and give it an ID according to the following table.
'''Search for <Vocalization> in the TRAM file''' and give it an ID according to the following table.


{|class="wikitable" width="100%"  
{|class="wikitable" width="100%"  
Line 606: Line 577:
|-
|-
| 0
| 0
| <TauntProbability> - '''taunt(s)'''
| <TauntProbability> '''taunt(s)'''
|-
|-
| 1
| 1
| <AlertProbability> - AI being surprised by a sound
| <AlertProbability> AI being surprised by a sound
|-
|-
| 2
| 2
| <StartleProbability> - AI being surprised by an enemy
| <StartleProbability> AI being surprised by an enemy
|-
|-
| 3
| 3
| <CheckBodyProbability> - (AI only?) death taunt (when enemy / player dies)
| <CheckBodyProbability> AI death taunt, played when enemy dies
|-
|-
| 4
| 4
| <PursueProbability> - sound when character lost track of enemy
| <PursueProbability> — Play this sound when AI loses track of enemy
|-
|-
| 5
| 5
| <CoverProbability> - being afraid (E.g. "Dont't hurt me.")
| <CoverProbability> — Play this sounds when afraid (e.g. "Don't hurt me!")
|-
|-
| 6
| 6
| <SuperPunchSound> - '''sound of ######punch_heavy.oni''', super punches don't have sound IDs
| <SuperPunchSound> '''Sound of ######punch_heavy.oni''', super punches don't have sound IDs
|-
|-
| 7
| 7
| <SuperKickSound> - '''sound of ######kick_heavy.oni''', super kicks don't have sound IDs
| <SuperKickSound> '''Sound of ######kick_heavy.oni''', super kicks don't have sound IDs
|-
|-
| 8
| 8
| <Super3Sound> - AI specialty, Mukade use it for his devil star attack (TRAMNINCOMfireball)
| <Super3Sound> AI specialty, Mukade use it for his devil star attack (TRAMNINCOMfireball)
|-
|-
| <font color=#777777>9</font>
| <font color=#777777>9</font>
Line 636: Line 607:
|}
|}


===Step 2: Preparing the ONCC===
Search for <SoundConstants> and set a value between 0 and 100. 100 means "always play this sound".


===step 2: preparing the ONCC===
Let's look at Konoko's settings, with a focus on her taunt sound. In ONCCkonoko_generic.xml, we see this:
Search for <SoundConstants> and set a value between 0 and 100. 100 will make the engine play a sound always the taunt animation is played.
 
Let's compare with Konoko (and in the following steps especially the with her taunt files.)
In ONCCkonoko_generic.xml it looks like this:


             <SoundConstants>
             <SoundConstants>
Line 666: Line 635:
             </SoundConstants>
             </SoundConstants>


 
===Step 3: Preparing the OSBD.amb===
===step 3: preparing the OSBD.amb===
You basically need such a file...
 
Do you see the <BaseTrack1> tag? In this case it holds the link <font color=#AAAAAA>OSBD</font>c17_99_28konoko<font color=#AAAAAA>.grp.oni</font>.
Do you see the <BaseTrack1> tag? In this case it holds the link <font color=#AAAAAA>OSBD</font>c17_99_28konoko<font color=#AAAAAA>.grp.oni</font>.


  <?xml version="1.0" encoding="utf-8"?>
  <?xml version="1.0" encoding="utf-8"?>
Line 701: Line 666:
  </Oni>
  </Oni>


 
===Step 4: Preparing the OSBD.grp===
===step 4: preparing the OSBD.grp===
Since <NumberOfChannels> is only once presented all the SNDD files must have the same number of channels.
Since <NumberOfChannels> is only once presented all the SNDD files must have the same number of channels.


Line 717: Line 681:
|}
|}


 
(It's possible to speed up sounds with <Pitch>, e.g. the Fury's taunt is sped up by 1.14 to ''brighten'' the voice. But in most cases you probably want to keep it as "1".)
(It's possible to speed up sounds with <Pitch>. E.g. Fury's taunt is speeded up by 1.14 to ''brighten'' the voice. But in most cases you probably want to keep it as "1".)


  <?xml version="1.0" encoding="utf-8"?>
  <?xml version="1.0" encoding="utf-8"?>
Line 757: Line 720:
  </Oni>
  </Oni>


 
As you can see, Konoko has multiple sounds to choose from.
As you can see Konoko uses multiple sounds.
* <font color=#AAAAAA>SNDD</font>c17_99_28konoko.aif<font color=#AAAAAA>.oni</font> ("You're gonna get beat by a girl!")
* <font color=#AAAAAA>SNDD</font>c17_99_28konoko.aif<font color=#AAAAAA>.oni</font> ("You're gonna get beat(en) by a girl!")
* <font color=#AAAAAA>SNDD</font>c17_99_29konoko.aif<font color=#AAAAAA>.oni</font> ("Ready to lose?") (You can play sounds in Simple OniSplit GUI (Windows only).
* <font color=#AAAAAA>SNDD</font>c17_99_29konoko.aif<font color=#AAAAAA>.oni</font> ("Ready to lose?") (You can play sounds with (PC) onisplit GUI or (Mac) AETools.
* ''[...]''
* ''[...]''
"aif" is here part of the name, don't get bothered by it.
"aif" is here part of the name, as explained in the "Source file creation" section above.
 
Permutations in .grp files are the reason why Konoko has multiple sounds through one and the same taunt animation.


Permutations in .grp files are the reason why Konoko has multiple sounds that can play during the same taunt animation.


===step 5: everything else what's left===
===Step 5: Everything else that's left===
* [[#Source_file_creation|create your SNDD]] if you haven't yet
* [[#Source_file_creation|Create your SNDD]] if you haven't yet.
* put your files into a package
* Put your files into a mod package.
* test your stuff in-game
* Test your stuff in-game!


{{XML}}
{{XML}}