Page 1 of 2

Issue with switching stock sounds

Posted: Thu Sep 24, 2020 11:26 pm
by kiprobin
I am adding Teancum's converted T4B rebel tank. The engine sound in the provided odf is the imperial hovertank engine sound (interceptorTank_engine_parameterized), but this doesn't sound very tread like, so I was trying to change the engine sound, the turn on sound, and the turn off sound to that of the gunship (all_fly_gunship_engine_parameterized, all_fly_gunship_turn_on, and all_fly_gunship_turn_off respectively). All of the gunship sounds are already loaded and working on the map. However, when I simply replace "interceptorTank_engine_parameterized" with "all_fly_gunship_engine_parameterized" and so on, munge, then run and get in the tank, you can hear that the gunship engine sound is in fact working, but then the game soon crashes. I made no other changes, and after switching it back and remunging, it works, so it is definitely this sound change and nothing else that is causing the crash. There isn't anything of note in the error log that could be related as far as I can tell. Does anyone have any idea what might be going on and/or what could be done to get the gunship sounds working?

Re: Issue with switching stock sounds

Posted: Fri Sep 25, 2020 9:46 pm
by Marth8880
Very strange, especially considering there's practically no functional differences between interceptorTank_engine_parameterized and all_fly_gunship_engine_parameterized, other than the latter having a ParameterGraph controller for health, which I know for a fact works with hover vehicles.

What happens if you try a different flyer's parameterized engine sound?

Re: Issue with switching stock sounds

Posted: Sat Sep 26, 2020 5:42 pm
by kiprobin
I tried it with the xwing sound, same thing. You could clearly hear the sound work, then once I moved, it crashed. Also, here is the sound section of the vehicle's odf that Teancum included with the vehicle if it helps. All I have been changing is the engine sound name and nothing else, though if it matters I did change some of the weapon sounds and those work fine. Could it be something to do with the VOUnitType?

EDIT It also does the exact same thing with the combatspeeder sounds. I even copied and pasted the whole sound section from the combatspeeder odf and completely replaced the t4b's sound section, and the same thing happens: it works, then crashes after a few seconds. I am completely baffled

VOUnitType = 51
EngineSound = "interceptorTank_engine_parameterized"
HurtSound = ""
DeathSound = "imp_weap_ord_exp_lg"
VehicleCollisionSound ="com_veh_collision_lg"
TurnOnSound = ""
TurnOffSound = ""
ImpMusic = "imp_vehicle"
AllMusic = "all_vehicle"
CisMusic = "cis_vehicle"
MusicSpeed = ".15"
MusicDelay = "3.0"
GroundedSound = ""
GroundedHeight = ""

Re: Issue with switching stock sounds

Posted: Sat Sep 26, 2020 7:46 pm
by Marth8880
Are you absolutely sure it's related to you changing the EngineSound? It could just be chance that it's not crashed with the old one. If I were you I'd double-check.

Re: Issue with switching stock sounds

Posted: Sat Sep 26, 2020 7:55 pm
by kiprobin
Yes. After each crash after I change the engine sound, I change it back, remunge, and verify that it works with the imp fighter tank engine sound stated in the odf, just like teancum released it. It's worth noting, however, that I don't have the imp fighter tank sounds loaded though, so if I did, it still might crash in it's unaltered state. I also tried doing a manual clean before munging the new engine sound to see if it might be something wrong with the munge, it didn't work. I think teancum got engine sounds working in his Boz Pity conversion; I'll go take a look at the source files and see if I can find out how he did it

EDIT the source files don't include the side folders unfortunately, so I gain no information from it. Is there some way I could just get it to play some non parameterized sound continuously whenever you're in the tank?

Re: Issue with switching stock sounds

Posted: Sun Sep 27, 2020 7:41 am
by Sporadia
kiprobin wrote:
Sat Sep 26, 2020 5:42 pm
Could it be something to do with the VOUnitType?
No. The VOUnitType is like a label which tells other characters on the battlefield what dialogue to use when they see your tank coming. So a VOUnitType of 51 might get the reaction "Oh look, tank" whereas an incorrect VOUnitType might get the reaction "Kill the jedi!" etc.


Are you trying to load your sounds from a stock sound lvl? If so, which one? If you're loading two sound lvls, which two?
Have you ever heard (ie with the sound loaded) it working with interceptorTank_engine_parameterized? Which sound lvl did you use then?

Re: Issue with switching stock sounds

Posted: Sun Sep 27, 2020 12:53 pm
by kiprobin
I haven't heard it working with the interceptor tank sound, bc I didnt load that sound in my map. I did, however, load the gunship sounds with my ABC sound folder in dataABC>sounds>worlds>abc or whatever the exact location is. I am also load the stock both sound lvl for the Walker sounds, but the gunship sounds I loaded from the ABC ( or in my case LT2) sound lvl. You can hear the sound work before it crashes each time, whether it's the gunship sound I want, or the xwing or combatspeeder sounds I tried to see if it would work. The sound is there, it just crashes after a few seconds, then when I change it back to the interceptor tank sound (which isnt loaded) and remunge it works fine, just without engine sounds

Re: Issue with switching stock sounds

Posted: Sun Sep 27, 2020 5:40 pm
by Sporadia
Ok, there's quite a few things that I'd be tempted to try and I don't know if any of them will work. First thing I suggest for now is that you temporarily comment out the lines where you load the hoth sounds from the mission lua. Just to test your ABC sound lvl on its own, and make sure it isn't conflicting with the other sound lvl. If this stops the crashing, then you should probably look into munging all your level's sounds into a single sound lvl. If it doesn't fix the problem (I'm kind of expecting it not to) then there's a good chance the problem is in your ABC sound lvl.

How is your ABC sound lvl set up? Am I right thinking that you have an ABC.sfx (maybe need to be .asfx, that's another thing to double check later) which contains the wav files that are used for the gunship engine sounds? I think they're republic gunships wav files:

Code: Select all

..\..\cw\effects\eng_repGunship_hi_lp.wav         -resample xbox 22050 pc 22050
..\..\cw\effects\eng_repGunship_low_lp.wav        -resample xbox 16000 pc 22050
..\..\cw\effects\eng_repGunship_mid_lp.wav        -resample xbox 16000 pc 22050
You can check them all by digging through the config files for all_fly_gunship which is in data_ABC\Sound\gcw.

Then you have an ABC.req or ABCgcw.req which has all_fly_gunship under its "config" section?

Do you have any other sounds in your ABC sound lvl? Have you got those working? I think it might shed some light on what's happening if you try loading other sound effects from ABC.lvl like changing some weapon sounds.

Don't focus on the imperial tank sounds if you've not been loading them in, because the game won't recognise the name of a sound you're not loading. ie every time you've tested EngineSound = "interceptorTank_engine_parameterized", you could have just done EngineSound = "", and it would mean the same thing. That's not an indication that the imperial tank sounds work. From what you've said so far, I'm assuming every time you've given this tank a sound from ABC.lvl, it's crashed the game shortly afterwards (which could also be every time you've used any sound from ABC.lvl at all, or every time this tank was given an engine sound at all). Even if the problem does turn out to be how the sound is parameterised, I want to rule some of this other stuff out.

PS The template files for the SPA sound lvl are your friend.

Re: Issue with switching stock sounds

Posted: Sun Sep 27, 2020 6:13 pm
by kiprobin
Yes, my other loaded sounds are working. Many different weapon sounds, vehicle sounds (including combatspeeder sounds, xwing sounds, gunship sounds, etc., all of which work fine on the xwing, combatspeeder, etc., it only crashes it when I load them on the t4b.) There's nothing wrong with the ABC lvl sound file, everything works fine, though I'll def try making it an asfx file rather than an sfx file if you think that will help. I'll also try putting it into one lvl like you said too. We'll see what happens. Thanks for your help yet again sporadia!

Re: Issue with switching stock sounds

Posted: Sun Sep 27, 2020 6:28 pm
by Marth8880
I wonder if the t4b's odf has some parameter or something that somehow causes crashes when using parameterized engine sounds? Can't imagine what that could possibly be, but would be good to know about :o

Re: Issue with switching stock sounds

Posted: Sun Sep 27, 2020 7:08 pm
by Sporadia
If you've got the same sounds working on different vehicles then I don't think my last suggestions will achieve very much. Except testing it without the hoth sounds temporarily which is still worth doing. Try looking at imp_hover_fightertank.snd in data_ABC\Sound\gcw. Comparing that to all_fly_gunship.snd, the flyer SoundProperties() use Inherit("flyer_eng_low_template"); instead of Inherit("vehicle_eng_low_template");. Some of the ParameterGraph() sections have different names. And, the flyer has an extra sound layer for when it takes damage. I don't know which of those things is a problem, if any. But I guess you can make an ABC.snd, add it to the req, then set up the gunship sounds in there to be more like the hovertank sounds (logic being, that will set them up for a hover type vehicle). ie put this in ABC.snd then use t4b_engine_parameterized in your odf:

Code: Select all

// ---- Engine ----

SoundProperties()
{
    Name("t4b_engine_low_idle_property");
    Group("vehicles");
    Inherit("vehicle_eng_low_template");
    SampleList()
    {
      Sample("eng_repgunship_low_lp", 1.0);
    }
}

SoundProperties()
{
    Name("t4b_engine_med_idle_property");
    Group("vehicles");
    Inherit("vehicle_eng_hi-mid_template");
#ifplatform ps2 xbox
    RollOff(5.0);
#endifplatform ps2 xbox
    SampleList()
    {
      Sample("eng_repgunship_mid_lp", 1.0);
    }
}

SoundProperties()
{
    Name("t4b_engine_high_idle_property");
    Group("vehicles");
    Inherit("vehicle_eng_hi-mid_template");
    SampleList()
    {
      Sample("eng_repgunship_hi_lp", 1.0);
    }
}


ParameterGraph()
{
    Name("t4b_engine_low_idle_speed");
    ControlPoint(-1.0, 0.8);
    ControlPoint(0.0, 0.8);
    ControlPoint(0.4, 1.0);
    ControlPoint(1.0, 1.0);
}

ParameterGraph()
{
    Name("t4b_engine_low_idle_acceleration");
    ControlPoint(-1.0, 0.5);
    ControlPoint(0.0, 0.6);
    ControlPoint(0.4, 0.9);
    ControlPoint(1.0, 1.0);
}

ParameterGraph()
{
    Name("t4b_engine_med_idle_speed");
    ControlPoint(-1.0, 0.5);
    ControlPoint(0.0, 0.5);
    ControlPoint(0.6, 1.1);
    ControlPoint(1.0, 1.3);
}

ParameterGraph()
{
    Name("t4b_engine_med_idle_acceleration");
    ControlPoint(-1.0, 0.5);
    ControlPoint(0.0, 0.6);
    ControlPoint(0.4, 0.9);
    ControlPoint(1.0, 1.0);
}

ParameterGraph()
{
    Name("t4b_engine_high_idle_speed");
    ControlPoint(-1.0, 0.5);
    ControlPoint(0.0, 0.5);
    ControlPoint(0.4, 0.7);
    ControlPoint(1.0, 0.9);

}

ParameterGraph()
{
    Name("t4b_engine_high_idle_acceleration");
    ControlPoint(-1.0, 0.5);
    ControlPoint(0.0, 0.6);
    ControlPoint(0.4, 0.9);
    ControlPoint(1.0, 1.0);
}


SoundLayered()
{
    Name("t4b_engine_layered");
    Layer("t4b_engine_low_idle", "t4b_engine_low_idle_property", 0.0);
    Layer("t4b_engine_med_idle", "t4b_engine_med_idle_property", 0.0);
    Layer("t4b_engine_high_idle", "t4b_engine_high_idle_property", 0.0);
}

SoundParameterized()
{
    Name("t4b_engine_parameterized");
    SoundLayered("t4b_engine_layered");

    Layer()
    {
        Name("t4b_engine_low_idle");
        ParameterGraph("speed",        "t4b_engine_low_idle_speed", "pitch");
        ParameterGraph("acceleration", "t4b_engine_low_idle_acceleration","gain");
        ParameterGraph("turnontime",   "engine_turnon_gain",      "gain");
        ParameterGraph("turnofftime",  "engine_turnoff_gain",     "gain");
        ParameterGraph("turnontime",   "engine_turnon_pitch",     "pitch");
        ParameterGraph("turnofftime",  "engine_turnoff_pitch",    "pitch");
    }
    Layer()
    {
        Name("t4b_engine_med_idle");
        ParameterGraph("speed",        "t4b_engine_med_idle_speed", "pitch");
        ParameterGraph("acceleration", "t4b_engine_med_idle_acceleration","gain");
        ParameterGraph("turnontime",   "engine_turnon_gain",      "gain");
        ParameterGraph("turnofftime",  "engine_turnoff_gain",     "gain");
        ParameterGraph("turnontime",   "engine_turnon_pitch",     "pitch");
        ParameterGraph("turnofftime",  "engine_turnoff_pitch",    "pitch");
    }
    Layer()
    {
        Name("t4b_engine_high_idle");
        ParameterGraph("speed",        "t4b_engine_high_idle_speed", "pitch");
        ParameterGraph("acceleration", "t4b_engine_high_idle_acceleration","gain");
        ParameterGraph("turnontime",   "engine_turnon_gain",      "gain");
        ParameterGraph("turnofftime",  "engine_turnoff_gain",     "gain");
        ParameterGraph("turnontime",   "engine_turnon_pitch",     "pitch");
        ParameterGraph("turnofftime",  "engine_turnoff_pitch",    "pitch");
    }
}
And if that doesn't work, try this one with the hovertank control points (I don't know what control points are, so this is a shot in the dark):

Code: Select all

// ---- Engine ----

SoundProperties()
{
    Name("t4b_engine_low_idle_property");
    Group("vehicles");
    Inherit("vehicle_eng_low_template");
    SampleList()
    {
      Sample("eng_repgunship_low_lp", 1.0);
    }
}

SoundProperties()
{
    Name("t4b_engine_med_idle_property");
    Group("vehicles");
    Inherit("vehicle_eng_hi-mid_template");
#ifplatform ps2 xbox
    RollOff(5.0);
#endifplatform ps2 xbox
    SampleList()
    {
      Sample("eng_repgunship_mid_lp", 1.0);
    }
}

SoundProperties()
{
    Name("t4b_engine_high_idle_property");
    Group("vehicles");
    Inherit("vehicle_eng_hi-mid_template");
    SampleList()
    {
      Sample("eng_repgunship_hi_lp", 1.0);
    }
}


ParameterGraph()
{
    Name("t4b_engine_low_idle_speed");
    ControlPoint(-1.0, 0.5);
    ControlPoint(0.0, 0.5);
    ControlPoint(0.5, 0.5);
    ControlPoint(1.0, 1.0);
    ControlPoint(1.2, 1.2);
}

ParameterGraph()
{
    Name("t4b_engine_low_idle_acceleration");
    ControlPoint(-1.0, 0.6);
    ControlPoint(0.0, 0.6);
    ControlPoint(0.5, 0.9);
    ControlPoint(1.0, 1.0);
}

ParameterGraph()
{
    Name("t4b_engine_med_idle_speed");
    ControlPoint(-1.0, 0.5);
    ControlPoint(0.0, 0.5);
    ControlPoint(0.5, 0.5);
    ControlPoint(1.0, 1.0);
    ControlPoint(1.2, 1.2);
}

ParameterGraph()
{
    Name("t4b_engine_med_idle_acceleration");
    ControlPoint(-1.0, 0.6);
    ControlPoint(0.0, 0.4);
    ControlPoint(0.5, 0.9);
    ControlPoint(1.0, 1.0);
}

ParameterGraph()
{
    Name("t4b_engine_high_idle_speed");
    ControlPoint(-1.0, 0.5);
    ControlPoint(0.0, 0.5);
    ControlPoint(0.5, 0.5);
    ControlPoint(1.0, 1.0);
    ControlPoint(1.2, 1.2);

}

ParameterGraph()
{
    Name("t4b_engine_high_idle_acceleration");
    ControlPoint(-1.0, 0.6);
    ControlPoint(0.0, 0.6);
    ControlPoint(0.5, 0.9);
    ControlPoint(1.0, 1.0);
}


SoundLayered()
{
    Name("t4b_engine_layered");
    Layer("t4b_engine_low_idle", "t4b_engine_low_idle_property", 0.0);
    Layer("t4b_engine_med_idle", "t4b_engine_med_idle_property", 0.0);
    Layer("t4b_engine_high_idle", "t4b_engine_high_idle_property", 0.0);
}

SoundParameterized()
{
    Name("t4b_engine_parameterized");
    SoundLayered("t4b_engine_layered");

    Layer()
    {
        Name("t4b_engine_low_idle");
        ParameterGraph("speed",        "t4b_engine_low_idle_speed", "pitch");
        ParameterGraph("acceleration", "t4b_engine_low_idle_acceleration","gain");
        ParameterGraph("turnontime",   "engine_turnon_gain",      "gain");
        ParameterGraph("turnofftime",  "engine_turnoff_gain",     "gain");
        ParameterGraph("turnontime",   "engine_turnon_pitch",     "pitch");
        ParameterGraph("turnofftime",  "engine_turnoff_pitch",    "pitch");
    }
    Layer()
    {
        Name("t4b_engine_med_idle");
        ParameterGraph("speed",        "t4b_engine_med_idle_speed", "pitch");
        ParameterGraph("acceleration", "t4b_engine_med_idle_acceleration","gain");
        ParameterGraph("turnontime",   "engine_turnon_gain",      "gain");
        ParameterGraph("turnofftime",  "engine_turnoff_gain",     "gain");
        ParameterGraph("turnontime",   "engine_turnon_pitch",     "pitch");
        ParameterGraph("turnofftime",  "engine_turnoff_pitch",    "pitch");
    }
    Layer()
    {
        Name("t4b_engine_high_idle");
        ParameterGraph("speed",        "t4b_engine_high_idle_speed", "pitch");
        ParameterGraph("acceleration", "t4b_engine_high_idle_acceleration","gain");
        ParameterGraph("turnontime",   "engine_turnon_gain",      "gain");
        ParameterGraph("turnofftime",  "engine_turnoff_gain",     "gain");
        ParameterGraph("turnontime",   "engine_turnon_pitch",     "pitch");
        ParameterGraph("turnofftime",  "engine_turnoff_pitch",    "pitch");
    }
}
EDIT: I guess the next thing to try after this, might be to actually load the imperial hovertank sounds to check that they work like in the odf you download.

Re: Issue with switching stock sounds

Posted: Sun Sep 27, 2020 7:48 pm
by kiprobin
I tried not loading the hoth sound lvl, but that caused literally all sounds not to work, even the ones I had loaded in the ABC lvl (which were working before when I had the hoth lvl loaded, even though those sounds aren't in the hoth lvl). I don't know exactly what that means though. I thought about messing with the parameters of the gunship snd files, but the fact that it crashed with the hovertank sounds (which teancum clearly meant to be the sounds used, as it's what he put in the odf when he converted it), I didn't think that would help. I then loaded the imperial hovertank sounds, and it crashed, just like before. I then removed all sound lines from the t4b, so it played no engine sound (which worked fine with a quick test, just without sounds), then put an actual imp hover tank in there, which also caused the game to crash. I then removed the hovertank sounds, but left the hovertank in the map, and it worked fine, just without sounds.
All this leads me to believe that I just hit the sound limit or something. I have a massive amount of vehicles and weapons with custom sounds, so I think I may just have hit a limit and there's nothing I can do (why else would it crash if the imp hovertank is the only thing using the imp hovertank sounds?). I've got a lot of vehicles and it's a very active, loud map, so one missing engine sound won't be the end of the world. Thanks so much for your help though, I really do appreciate it

Re: Issue with switching stock sounds

Posted: Sun Sep 27, 2020 8:02 pm
by Sporadia
You can test for that. Open the debug console and type mem, it tells you how much sound memory the mission is using. This is the first time I've heard of the sound limit causing a crash though, normally it just stops sounds being loaded when there isn't enough space. Also it's a bad sign that removing the hoth sound lvl affected sounds you think are in ABC.lvl, because they should be independent from each other. It was always supposed to stop the hoth sounds from loading, but if ABC.lvl is truly working, then it should load those few extra ABC sounds on its own. What did you do to set up the sound munge? Did you change the batch files using a tutorial, or are you using the improved batch files (eg Marvel4's, which I will always recommend)? What happens if you test with kashyyyk's sound lvl on its own, since that already contains the hovertank sounds?

Re: Issue with switching stock sounds

Posted: Sun Sep 27, 2020 8:39 pm
by kiprobin
I think I did the improved munge files, but that was so long ago and I may be remembering wrong. I got the sounds working for my Rhen Var map back in May (my first map ever), then just copied the sound folder into each new map I made, renamed it and all requisite files, and set it up in the lua, and it has worked for me so far. I use mostly the same vehicles each time, and have been adding custom weapon sounds recently through a separate tutorial I found, though that's not through the ABC lvl, it's a separate asfx file. The one time since I've tried to set up sound again for my CW version of Wobani, I couldn't get it to work and ended up giving up on it, because I hate all this sound stuff, I'm bad at it, and it's frustrating. I ran it with the kas lvl loaded, and the combatspeeder sounds worked but infantry sounds still didn't. The mem test said I still have around 680,000 in space left out of 33,000,000 or so capacity, so you're right that that's not the issue. I still don't understand what's going on with the ABC lvl though, bc it def works when I had the hoth lvl loaded too. Xwing sounds, awing sounds, combatspeeder sounds, tiefighter sounds; all these things work fine and are not in the hoth lvl to my knowledge, but are in my ABC lvl, so how else if not through the ABC lvl would they be getting in game? I think I'm just screwing things up again somehow, idk. It's such an inconsequential sound; engine sounds on one tank that I have only one of on a map with many, many vehicles and turrets and about 200 bots. No one's gonna miss the engine sound except right when the match starts. I really appreciate your help, Sporadia and Marth8880, but I don't think I'm gonna manage to get it

Re: Issue with switching stock sounds

Posted: Mon Sep 28, 2020 9:47 am
by Sporadia
kiprobin wrote:
Sun Sep 27, 2020 8:39 pm
I still don't understand what's going on with the ABC lvl though, bc it def works when I had the hoth lvl loaded too. Xwing sounds, awing sounds, combatspeeder sounds, tiefighter sounds; all these things work fine and are not in the hoth lvl to my knowledge, but are in my ABC lvl, so how else if not through the ABC lvl would they be getting in game?
I could probably have explained better the point behind some of these tests. Back when I said to remove the hoth sound lvl, the whole point was to see if ABC.lvl worked on its own. It wasn't supposed to fix the problem, because you lose all of the hoth sound effects. I just wanted to confirm that the sounds in ABC.lvl work when you only load ABC.lvl. At the time I was actually worried that the config files might be conflicting between ABC.lvl and hot.lvl, but then you discovered that ABC.lvl doesn't work at all when you load it on its own. Going to make this its own line:

If you can't use the sounds from your ABC sound lvl when you load that sound lvl on its own, then your ABC sound lvl is not working.

I don't have the first idea why it seems to work when you load the hoth sound lvl alongside it. But I don't really need to, because the fact that ABC.lvl doesn't work on its own shows that ABC.lvl has a problem somewhere.
kiprobin wrote:
Sun Sep 27, 2020 8:39 pm
I ran it with the kas lvl loaded, and the combatspeeder sounds worked but infantry sounds still didn't.
So for this test, yeah you lose every sound that isn't loaded in the stock Kashyyyk missions, so you will lose some sounds and I guess in this case you lost the infantry sounds. But that's not the point of the test. The idea was just to see if the imperial hovertank sounds still crashed when you load them from this sound lvl, instead of from ABC.lvl. You can kind of skip this now, because of the next thing I'm going to say.
kiprobin wrote:
Sun Sep 27, 2020 8:39 pm
The mem test said I still have around 680,000 in space left out of 33,000,000 or so capacity, so you're right that that's not the issue.
This number's never going to be 0. Basically what happens when you run out of space, is the game just fills up what it can, then starts skipping files which don't fit. So you always have a bit of free space left over, even if it's skipped a few files. 700 thousand out of 33 million is only like 2% free space. To me that looks too small, and if you haven't already hit the sound limit then you soon will. If you ever load a stock mission and do the same test, you will notice that they only fill about 2/3 of the sound memory (so free space might be 5 or 10 million). That's the sort of benchmark you should be aiming for. Because you're at this limit then there's only one sensible thing to do, and that's to munge every single sound that your mission uses (stock or not) into a single lvl file. I would recommend that at this stage, even if your mission wasn't crashing. But hopefully in doing so, you can also get to the bottom of what's crashing.


So... there's no nice tutorial on how to do the whole thing (and if there was, it would be huge). You're going to want to do this in stages (there are a few tutorials on how to do the individual stages, however). So I'll start with a few steps, and when you do them post it here and I'll move on to the next thing. First thing to understand is that you can divide all the stock sound effects into global sounds, and non-global sounds. And then each of those is divided into effects, and streams. Stage one will be munging all your global effects. I'm going to start using DEF.lvl instead of ABC.lvl, because you might as well start from the beginning. This will also recap a lot of things you already know, I just want to explain everything at once.


EDIT: This next section has been updated because it originally contained incorrect information about when to use .sfx and .asfx.

Adding the global effects from Hoth (EDIT: use .sfx)
Note: There is a tutorial by Rends on the sticky which covers all the same stuff as this section, in a bit more detail. That's actually where I learned it. But in Rends' tutorial they only add a few sounds, and then load that new sound lvl before loading a different stock sound lvl (to get all the other mission sounds). What I actually want to explain is a more general way to use all the same techniques, to get every single sound effect that your mission uses into your new DEF.lvl, until eventually it becomes the only sound lvl you need.

Note2: This is only about hoth sounds for now.

First things first, you need to create the folder data_DEF\Sound\worlds\DEF if it doesn't exist already. It doesn't really matter if DEF is the same mod as the mission you want the sounds for, or a different mod. And in that folder you should start by making DEF.req and optionally DEFgcw.req. I'm going to assume that you do make DEFgcw.req, and if you don't make one then you can figure out what the differences are on your own.

In DEF.req, you need an empty streams section (streams are a later stage), and you need to point to your DEFgcw sublevel. So start with this:

Code: Select all

ucft
{
    REQN
    {
        "str"
        "align=2048"
    }
    REQN
    {
        "lvl"
        "DEFgcw"
    }
}
Note: Every time you see "align =2048", it's important that you use that.

Then in DEFgcw.req, start with an empty sound bank section, and empty config section. Which looks like this:

Code: Select all

ucft
{
    REQN
    {
        "bnk"
        "align=2048"
    }
    REQN
    {
        "config"
    }
}
Next, you can start looking at the template files for hoth's sound lvl (located in data_DEF\Sound\worlds\hot). If you open hot.req, you can see that it has the sublevel "hot1gcw" (under the "lvl" header). That's the one you want to look at. Then you should open hot1gcw.req to see what that sublevel contains. Under the "bnk" header, you can see "hot1gcw", which represents hot1gcw.sfx. Ignore the "config" header for now.

hot1gcw.sfx names the wav files for every sound effect, global or non-global, which the sublevel will load. I'm saying effect, not stream because the streams are listed somewhere else. At the moment, you're only trying to add the global effects, so you need to be able to tell which ones they are. I'll colourize the first line to highlight different parts of it:

..\..\global\effects\saberon.wav saberon -resample ps2 16000 xbox 22050 pc 22050

In green, you have the resampling commands for different consoles. In blue, you have an alias which you can use in an odf or .snd file instead of writing the wav file name. I don't have too much to say about those. But in yellow, you can see the folders which the sound effect is stored in (before in pink, you see the wav file itself). Those folders are the key. Some wav files are located into global locations like:

Code: Select all

..\..\global\effects\
..\..\global\streams\
which is the location of sounds munged into sound\\global.lvl. This is a global sound lvl that the game engine can access in any mission without you asking to load it. Other examples include:

Code: Select all

..\..\cw\effects\
..\..\gcw\effects\
which locate sounds that were munged into sound\\cw.lvl and sound\\gcw.lvl respectively. There's also a sound\\shell.lvl which I'm pretty sure is a global location, but I've never used it.

So the above is what the global sound effects look like in a .sfx. Here's examples of what the non-global sounds could start with:

Code: Select all

effects\
streams\
..\..\hot\effects\
..\..\hot\streams\
..\..\yav\effects\
Some of these effects start with planet names, showing that the wav files are munged into sound\\hot.lvl or sound\\yav.lvl. Those are non-global locations, which is all you need to know for now. (It actually completely changes where those wav files get munged if you put in a non-global location. Non-global sounds are really munged directly into DEF.lvl, requiring an audio rip. Not important for now.) Also you can see effects\ on its own. That's the directory of whatever sound lvl you're looking at, so in this case effects\ is the same as ..\..\hot\effects\, in DEF's .sfx it will mean ..\..\DEF\effects\ etc. So that's non-global too.

So the next step is to go back to data_DEF\Sound\worlds\DEF and make a DEFgcw_hoth.sfx file. You can call it what you want, but basically you're making a .sfx file which will only contain the global effects from hoth. EDIT: Global effects are put in a .sfx files.

Next, go back to hoth's .sfx file and copy over all the global effects. Do not copy any non-global effects at this stage! If you start putting non-global effects in without the audio rips then it will cause munge problems. (Also, your non-global effects will eventually need to go in a separate .asfx file when that comes up). Also, only do the hoth sounds for now. The hovertank and other sounds which weren't in hoth to begin with can be added later.
EDIT: This paragraph was updated because it originally contained mistakes.

Put "DEFgcw_hoth" under the "bnk" section of DEFgcw.req if you haven't already.

That handles the wav files, but not the stock config files. So the next thing you have to do is reopen hot1gcw.req and copy the "config" section. Since you're going to put all these sounds back into your mission, you might as well copy the whole "config" section over to DEFgcw.req. I don't think it's an issue for the config files to reference sounds you're not loading yet. You can delete some things if you want like if you know you won't use "all_fly_snowspeeder" in your mission.

Under the "config" header, you can see all the .snd files, .mus files and .ffx files which the sublevel is using. Some of these config files are global, and you only need to name then your DEFgcw.req for them to work. There are other ones which you will have to copy over (and potentially rename) from the template files in data_DEF\Sound\worlds\hot. Just make sure you only copy them from the hoth sound folder; you don't ever need to copy the ones in the global sound folder or gcw sound folder.

And that's how you take all the global effects from hoth and put them in DEF.lvl. Next you can munge, & finally test that your batch files/munge is working. If you are using Marvel4's files, you will get a text file appear called configmunge.txt and levelpack.txt in your data_DEF\Sound\worlds\DEF folder which will contain any munge error information. Ignore errors in the regular mungelog. So give that a test and check you can hear all the sounds that you've added so far.


Adding the extra global effects (xwing/hovertank, EDIT: use .sfx)
This is for the xwing and hovertank sounds, and any other global effects which weren't in hoth to begin with. Do the same thing as what you did for the hoth sounds, but it's more organised to make a new .sfx file and put these sounds in there. Note: Your global effects go in .sfx files, your non-global effects will go in .asfx files.
EDIT: This paragraph was updated because it originally contained mistakes.


Adding the non-global effects (EDIT: use .asfx)
I don't have to explain this one, because giftheck just made a tutorial:
http://www.gametoast.com/viewtopic.php?f=27&t=34435
Non-global stock effects are added the same way as new custom effects. Just make sure you use .asfx. Copy the non-global sounds from hoth's req file or whatever one you need, and any config files. You will need an audio rip of these sounds.

I'm stopping here for now. Streams would be next though.

Re: Issue with switching stock sounds

Posted: Mon Sep 28, 2020 1:47 pm
by kiprobin
I've completed the process for adding hoths global sounds. I'm at work on break and wont be able to test until later tonight, but do I need to add the stock non global sounds from hoth if i dont need to? The only non global sounds I found in the hot1gcw.sfx were for the orbital bombardment and for the tauntaun. Since I use neither of those, shouldn't i just not load them and save some sound space, or will that mess up the Munge somehow? Thanks so much for the help for the millionth time Sporadia, you're the absolute best! You clearly put a lot of work and time into that tutorial and I really, really appreciate it

Re: Issue with switching stock sounds

Posted: Tue Sep 29, 2020 10:00 am
by Sporadia
Sure. If you don't want to use any non-global effects then there's no reason why you need them. I just wanted to make it clear that your non-global effects would go in a separate .asfx file, and you'd need a copy of the actual wav file in data_DEF\Sound\worlds\DEF\effects to munge with them. Also there's other stuff to know about how those wav files would be formatted etc. Non-global effects are exactly the same as custom effects.

Re: Issue with switching stock sounds

Posted: Tue Sep 29, 2020 3:08 pm
by RevanSithLord
This needs stickied right away!

Re: Issue with switching stock sounds

Posted: Tue Sep 29, 2020 8:15 pm
by kiprobin
I got all the hoth sounds working in this way, but when I repeated the process for my non hoth sounds (xwing, combatspeeder, etc.) those sounds didn't load. All I did was copy the entire contents of my old ABC.sfx file from back when I was still loading the hoth lvl (I backed it up in case I didn't end up using your method) and placed them in an .asfx file. I then loaded that .asfx file in the ABCgcw.req in the bnk section, right under where the working sfx file for the hoth sounds is. I also of course added the xwing and ywing, etc., under config. Hoth sounds still work fine, but I'm not getting any of the sounds I loaded in the .asfx file. I ran a clean before remunging, and the same thing happended. Any ideas what I might have done wrong?

Re: Issue with switching stock sounds

Posted: Wed Sep 30, 2020 7:27 am
by Sporadia
Sorry, I think I might have got this wrong, looking back at the files from when I did this. Try putting your additional global effects into your .sfx, rather than having them in their own .asfx. I know that's different to what I wrote before, but it looks like I was remembering wrong because that's not what I did when I look at my example files (from when I was learning this). And I have a document that I wrote for myself the first time I was doing this, but I stopped writing it when I was starting to have .asfx trouble (because in my first attempt I used .sfx for everything, and it didn't work, but I only started seeing problems near the end when I was adding a lot of extra sounds). Then I got bored and didn't write down my solutions to anything so I'm trying to do some of this from memory. Working out when to use .sfx and .asfx is something I was experimenting with for a while because there was a lot of weirdness, and sometimes the .sfx will break the .asfx and vice versa (Edit: I'm not saying that's happening in this case. It's just another thing I remember seeing that when sound banks have problems, they can break each other instead of just themselves).

But it actually looks like I decided in the end that the global effects all need to go in the same .sfx file. And it may or may not be important that they all go in the same one. You definitely put non-global effects in a .asfx though. Because non-global effects munge wav files directly into DEF.lvl, making DEF.lvl noticably bigger (Edit: increases by 100s of KB), whereas global effects point to sounds stored in other sound lvls. And I remember distinctly that you shouldn't munge a wav file using a .sfx, that might be where I'm getting the idea that .sfx has a size limit. I have a feeling that I remember it for a different reason though. I'm going to try adding extra sounds to a planet again myself now to see what's going on, because I don't remember.

Also check configmunge.txt and levelpack.txt for munge errors whenever you can.

EDIT: I've done some practicing today and I can confirm that you use .sfx for all global effects, and .asfx for all non-global effects. Sorry I got that wrong before. I also tested an easier way of loading streams which I discovered by accident once, but haven't tested until today. I'll put that at the end. I don't know why I chose to put all my global effects into the same .sfx file before. If there was a reason for it, I didn't run into the problem today. Today I just put all of Mustafar's global effects into DEFcw_mus1_g.sfx, and all of Mustafar's non-global effects into DEFcw_mus1_ng.asfx. Then I added extra x wing, tie fighter and wookie foley sounds into DEFcw_add_g.sfx. And I added gamorrean guard sounds (which are non-global) into DEFcw_add_ng.asfx. Did all the config stuff too. Changed the super battle droid's weapon sounds to the x wing blaster and proton torpedo to test, and added the gamorrean (which uses wookie foley). I had to change the .ffx file to get the foley to work properly. But I managed to load everything, (with streams etc too) by organising my effect files this way. So it looks like you can have as many .sfx files as you want, and as many .asfx files as you want. But your global effects must go in .sfx, and non-global effects must go in .asfx.

Streams
Global streams are pretty easy. All your sound lvl needs to contain is the right config files and your global streams will work. Every thing else is done in the mission lua, or some things you set up on your map up in Zeroeditor like soundspace regions. I'm only going to explain how to load streams here, not how to set them up.
You load global streams from your mission lua with OpenAudioStream() eg:

Code: Select all

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
Then you use other lua commands to make the streams play in specific circumstances. I'm going to gloss over that stuff too.

Non-global streams, it turns out, are just as easy. I used to think that you had to load non-global streams the same way you add custom streams (because that's how it is for effects). No you don't. If you put this in your lua:

Code: Select all

OpenAudioStream("sound\\hot.lvl", "hot1gcw")
Then it will load all the non-global streams listed in hot1gcw.stm, which is really in sound\\hot.lvl. And, it doesn't matter that you don't have ReadDataFile("sound\\hot.lvl") in your lua. All the stock streams just seem to work anyway. EDIT: But make sure you have the right config files in DEF.lvl, which is why ReadDataFile("dc:sound\\DEF.lvl;DEFgcw") will still be important.

There is something else to know, however. Normal streams are listed in .stm files. Streams which use surround sound are listed in .st4 files. These are like the stream equivalents to .sfx files. It's not unusual for a sound lvl to have a .stm file and .st4 file with the same name. ie hot1gcw.stm is a real file, hot1gcw.st4 is also a real file in the same sound lvl.
So if you put this in your mission lua:

Code: Select all

OpenAudioStream("sound\\hot.lvl", "hot1gcw")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")
It looks like you're typing the same line twice. But the first line will load streams in hot1gcw.stm. Then the second line will load streams from hot1gcw.st4 (I think .stm comes before .st4, but I don't know the order for sure). So those 2 lines actually do different things.

If this doesn't work for all the non-global streams, or if you want to mix up which stock streams you're using, then it's better to add them like you would custom streams. All you'd need to do for that is put the streams in a .stm file or .st4 file inside of DEF.lvl. Then you name those files under "str" in the req file. I'm not going into detail, you can look at the template files if you want to see how they do it. Are streams formatted in stereo or mono? I don't remember but you can use sample rates up to 44KHz for streams (typical for long ambient streams), some stock streams only use 36KHz if they're just supposed to be high quality sound effects (If I remember right, Jabba's laugh is a short 36KHz stream, not an effect. EDIT: I don't know why I remember this being 36KHz in hindsight, I've seen something that was at some point).

EDIT: I've also fixed the mistakes in my post above in case anybody else tries to follow it.