Can't find explanative tutorials on custom sound

Started by KommissarReb, October 29, 2020, 07:18:02 AM

Previous topic - Next topic
October 29, 2020, 07:18:02 AM Last Edit: October 29, 2020, 03:19:15 PM by KommissarReb
I've been trying to find good tutorials on how to add custom sounds, but I'm starting to lose hope after trying to click on the tutorials at the bottom of this page http://www.gametoast.com/viewtopic.php?f=1&t=27970#top only for them to 404, or the tutorial Ginev posted years ago.

And yes, I looked at the sound tutorials posted by Phobos and psych0fred http://www.swbfgamers.com/index.php?topic=5813.0 but felt more confused than enlightened. psych0fred's tutorials seem to explain what different things are, but not how to add custom sounds to a custom map. I found this from this topic, but the download also 404'd.

Are there any custom sound tutorials/explanations that can teach people how to add custom sounds in layman's terms that I haven't found yet?  :( Are there any video tutorials on YouTube? I'm seriously considering making a YouTube video series demonstrating everything I know about BF1 2004 modding so all this modding knowledge doesn't get lost to time.
In the Soviet Army, it takes more courage to retreat than advance.

http://secretsociety.com/forum/downloads/Sound%20Engine%20Guide.txt
(I'm 99% sure this document has a page here as well).

As far as getting lost to time, this site isn't going anywhere, and Secret Society isn't going anywhere either. If you're just thinking about preservation, then don't worry about it. I have planned for a while now to do videos but I just have never had the time, but more for an ease of use purpose, not preservation.

Sound is a fickle beast, and though the tutorial you found is ok, it doesn't really go step-by-step, and many people never get it to work, which is why there aren't many tutorials on it.  There is a good one on GameToast but I can't find it at the moment.
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

October 29, 2020, 12:15:05 PM #2 Last Edit: October 29, 2020, 02:07:25 PM by Led
KommissarReb,  while I am still learning myself how to add sound (mostly for the units and weapons) what I found useful was psychofred's Datachainisle project.   It features custom sounds, so you can download that to examine the files, and then slowly replace some of his custom sounds with your own to test that your effects work. 

I believe all sound files need to be 16-bit mono unsigned (I read that in one of the documents during my  experimenting for my Battle of Endor map). 

You put the .wav files into the sound/effects folder, then edit the .asfx to give the path where the munger can find your wave file e.g.
effects\SeismicCharge.wav    -resample pc 22050

You then edit the .snd file to add an entry for the sound e.g.


SoundProperties()
{
    Name("probedroid_engine");
    Pitch(1.0);
    PitchDev(0.00);
    Gain(0.8);
    GainDev(0.0);
    ReverbGain(1.0);
    Bus("soundfx");
    Looping(1);
    Pan(0.0);
    MinDistance(6.0);
    MuteDistance(50.0);
    MaxDistance(50.0);
    RollOff(1.0);
    Mode3D(1);
    Bias(0.0001);
    Priority(0.7);
    SampleList()
    {
    Sample("probot_loop", 1.0);
    }
}

One sound property can support multiple wave samples which the game engine would then randomly pick to play back.  So for example, if you had three probot wave files then you could edit the SampleList() to say:

    SampleList()
    {
    Sample("probot_loop1", 0.4);
    Sample("probot_loop2", 0.3);
    Sample("probot_loop3", 0.3);
    }



Note the second parameter has to add up to 1.0 (100%) because this parameter specifies the probability that the given wav file will be played (so 40% for loop1, then 30% for the loop2, then 30% for loop3).



October 29, 2020, 04:12:24 PM #3 Last Edit: October 29, 2020, 04:24:21 PM by KommissarReb
Quote from: Napseeker on October 29, 2020, 12:15:05 PM
KommissarReb,  while I am still learning myself how to add sound (mostly for the units and weapons) what I found useful was psychofred's Datachainisle project.   It features custom sounds, so you can download that to examine the files, and then slowly replace some of his custom sounds with your own to test that your effects work.
I wanted to download Datachainisle to reverse-engineer what psych0fred did, but the link 404'd. I just noticed when I linked that file in my original post I deleted an important letter in the hyperlink. Anyway, in the past I looked at the assets of Sereja's maps because I knew he got custom sounds to work really well. But I didn't know I had to edit the .snd files (I didn't know I could).
Quote from: Napseeker on October 29, 2020, 12:15:05 PM
I believe all sound files need to be 16-bit mono unsigned (I read that in one of the documents during my  experimenting for my Battle of Endor map). 

You put the .wav files into the sound/effects folder, then edit the .asfx to give the path where the munger can find your wave file e.g.
effects\SeismicCharge.wav    -resample pc 22050

You then edit the .snd file to add an entry for the sound e.g.


SoundProperties()
{
    Name("probedroid_engine");
    Pitch(1.0);
    PitchDev(0.00);
    Gain(0.8);
    GainDev(0.0);
    ReverbGain(1.0);
    Bus("soundfx");
    Looping(1);
    Pan(0.0);
    MinDistance(6.0);
    MuteDistance(50.0);
    MaxDistance(50.0);
    RollOff(1.0);
    Mode3D(1);
    Bias(0.0001);
    Priority(0.7);
    SampleList()
    {
    Sample("probot_loop", 1.0);
    }
}

One sound property can support multiple wave samples which the game engine would then randomly pick to play back.  So for example, if you had three probot wave files then you could edit the SampleList() to say:

    SampleList()
    {
    Sample("probot_loop1", 0.4);
    Sample("probot_loop2", 0.3);
    Sample("probot_loop3", 0.3);
    }



Note the second parameter has to add up to 1.0 (100%) because this parameter specifies the probability that the given wav file will be played (so 40% for loop1, then 30% for the loop2, then 30% for loop3).
So let's say I wanted to add a blaster sound (which probably wouldn't have samples) and it was called "littleblaster04.wav" I have littleblaster04.wav in my effects folder, I have "effects\littleblaster04.wav -resample pc 22050" located in krcar.asfx (krcar is my mapname), and krcar.snd has this:
SoundProperties()
{
    Name("littleblaster04");
    Pitch(1.0);
    PitchDev(0.00);
    Gain(0.8);
    GainDev(0.0);
    ReverbGain(1.0);
    Bus("soundfx");
    Looping(1);
    Pan(0.0);
    MinDistance(6.0);
    MuteDistance(50.0);
    MaxDistance(50.0);
    RollOff(1.0);
    Mode3D(1);
    Bias(0.0001);
    Priority(0.7);
    SampleList()
    {
        Sample("littleblaster04", 1.0);
    }
}


Also "littleblaster04" was one of Gifthecks sounds which I checked in audacity to make sure that it is 22050 ghz, and it is. What else would I need to do to get this to work if the imp_inf_pistol.odf uses this as a firing sound?
In the Soviet Army, it takes more courage to retreat than advance.

I think that's it...  at least off the top of my head, I don't remember any other steps other than editing your weapon ODF to read

FireSound             =  "littleblaster04"

Oh and believe I was wrong about the format of the wav, it should be signed, not unsigned.

One strange thing that I have had happen to me as I am testing my own map right now, is that even though I edit the volumes of every .wav to be the same, I noticed that during the gameplay, that some wav files play at the correct volume, while other wav sounds play at very low volume.  I have yet to understand why this is happening.


Yeah if it's correctly referenced in the asfx and the snd file, all you should need to do is then add the sound to your odf exactly as Napseeker has it (or whereever it is needed). 

I think by default most of your sound converters are going to pick signed 16 bit (uncompressed) wav format, so that shouldn't be too much of an issue (at least it hasn't when I use FFMpeg).  As far as the volumes go, if all the .snd files references are the same, you probably are going to have to go back and edit - I don't know if it's compression or what, but sometimes that happens.  You might also want to adjust the priority of the noises but that shouldn't have too much overall effect, but some can be pushed down if you have too much going on.
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

The only thing I can think of is that I didn't make a custom munged common.lvl or core.lvl for sounds. I remember reading this one topic that said you have to do that to get sounds working. Is that true? Do you guys have the Datachainisle files, or know where I can get them?
In the Soviet Army, it takes more courage to retreat than advance.


Checked out Datachainisle. For the life of me I can't figure out what's wrong. I don't know if there's something I need to do with one of the files in the World1 folder for sounds. I munged Datachainisle and custom sounds worked fine.

Maybe someone could try munging my files and tell me what I'm not doing right? Because as far as I didn't forget to do anything. https://www.dropbox.com/s/2necvl8yjoz3pib/krcar.zip?dl=0
In the Soviet Army, it takes more courage to retreat than advance.

November 01, 2020, 04:20:41 AM #9 Last Edit: November 01, 2020, 04:29:28 AM by wsa30h
did you try the gifthecks visually improved assets the sounds munge correctly in that for me. i will munge the sounds for you and see if they work. edit ok after looking at it i think you need to add the new sounds into krcar.snd file look at serejas sounds to see how it is done.
mods and maps in progress:<br />--Bf1 expanded edition 3.0 version
-- bf1 tcw battles
-- bf1 seasons mod season 1
-- bf2 expanded edition tbh

Quote from: wsa30h on November 01, 2020, 04:20:41 AM
did you try the gifthecks visually improved assets the sounds munge correctly in that for me. i will munge the sounds for you and see if they work. edit ok after looking at it i think you need to add the new sounds into krcar.snd file look at serejas sounds to see how it is done.

I used Giftheck's sounds, but IDK about "Visually Improved Assets". Also I did add the new sounds into krcar.snd before uploading it, didn't I?

If that isn't the issue, what else could I have forgotten?
In the Soviet Army, it takes more courage to retreat than advance.