Jump to content

How To Adding Sounds to the Game


Recommended Posts

  • Premium

Today I'm going to explain how to add and modify the different sounds that exist in the game.

First of all we have the soundtrack; the music that is played in each map or when we choose it from the music menu. This is pretty straightforward as we just have to copy mp3 files to the bgm folder and they will be read automatically.

In order to add the mp3 file as default sound on a map, you would edit locale/whatever/settings.lua and find lines looking like this

add_bgm_info(125, "chasing_dragon.mp3", 0.5)

Where the first value is the map index, second the filename and third the volume. Pretty straightforward.

The next option the game offers us in the accoustic department is adding a sound to a motion, such as a skill or an emotion. In order to do this, we just need to find the msa file which we want to add a sound to. We will go to the folder of the mob, npc or character in question, find the motion we want through the motlist (if it's not a character), and then; create the respective folder under sound if it doesn't exist. For example, for adding a sound to the motion npc/bakchon/01.msa we would make the folder sound/npc/backchon/ and in it a text file name 01.mss with this format:

 

ScriptType        CharacterSoundInformation

SoundDataCount    2
SoundData00       0.396000 "sound/monster/ice_snow_golem/drop_1.wav"
SoundData01       0.000000 "sound/monster/ice_snow_golem/fall_1.wav"

SoundDataCount: number of sounds

SoundData00 etc is just used to list the sounds in order and finally the number represents the time, in seconds, that the sound will wait to be played once the motion starts. Of course if the time is higher than the motion duration, the sound is never going to work.

The third option for adding sounds is doing it in the msa files themselves through MOTION_EVENT_TYPE_SOUND. I'm not going to comment this because it's never used by YMir and the mss methos is just easier.

Finally, we can add sounds to an specific place in a map, such as water running under a bridge. To do this, we have to create a .pra file in the property folder/pack with the following information:

YPRT
778119171
ambiencesoundvector        "sound/ambience/water_underbridge.wav"
propertyname        "water_underbridge"
propertytype        "Ambience"
maxvolumeareapercentage        "0.300000"
playinterval        "0.000000"
playintervalvariation        "0.000000"
playtype        "LOOP"

YPRT: just an identifier so the game knows its a property file (Ymir PRoperTy)

The number is supposed to be the CRC of the file, but you can use whatever you want as long as it's unique. If you change this number later,  the asset will disappear from the maps where you used it so be careful.

  • ambiencesoundvector: filename of a WAV or MP3 file
  • propertyname: just a name to identify it, can be anything.
  • propertytype: in this case Ambience and be careful with case, it's an uppercase A at the start!
  • maxvolumeareapercentage: which percentage (0 to 1) of the radius around the placement of the sound is played at 100% volume. I would set this to 1 for non-looping sounds as they only play once when you enter the defined area and won't play again till you leave and re-enter it.
  • playinterval: how frequently a sound of type STEP plays
  • playintervalvariation: random variation on the previous interval.
  • playtype: ONCE, STEP or LOOP

Once in World Editor, we can add our sounds as any other object; except we will set their Size, or the radius around the placement where it will be played, with the AreaAmbienceSize control in WE. If maxvolumeareasize is less than 1, the sound will get quieter from that % of the radius and end up being totally silent at the edge of the total radius.

As I mentioned, all the sounds in the game can be either MP3 or WAV. A comment about WAV files. Most WAV files we can find on the internet will not work with Metin2 straight away. We can use MP3 instead, but we are adding unnecessary overhead to the game, so if you want to use WAV files in Metin here's how.

- Download and install the free Audacity Sample Editor. https://www.audacityteam.org/download/windows/

- Open the original WAV file with it. You may need to press CTRL+A to select the whole sample.

- Metin2 doesn't play stereo WAVs so if your WAV is stereo head to the Track menu and choose > Mix > Mix stereo down to mono.

- Choose Resample... in the same menu and then 22050

- In the top left select "Project Rate" and change it to 22050

- Finally go to the File menu and click on Export and then WAV. Choose 16 bit PCM as format and done.

  • Metin2 Dev 4
  • Angry 1
  • Good 1
  • Love 21
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.