Defining an Ambient Sound?

edited 2013 May 8 in Addons for DOOM
Hello there

There is the JDAP for several years which adds a few ambient sounds.
Withing is a definition file .JDAPv6.ded

code for ambient sounds looks like this

###---Declaring sounds and assigning them IDs-----
Sound {
  ID = "torch1";
  Flags = shift2 | dontstop |repeat
  Priority = 140;
  Max channels = 12;
  Ext = "Data\jDoom\Sounds\Ambience\red_torch.wav";
}

So, what does torch1 stand for? where and how is this defined in the game.
Is torch1 the exact name of an ingame object or a texture?
How could I define a new ambient sound, say for another object/texture.
Take the techpillar for example or a Starport texture.

And does the engine define the radius/volume of a sound, if at all?
This code alone looks like theres something missing.

If anyone could actually give me a practical tip.
I like to create/advance a new Ambient Sound pack
My main interest is to create a generic ambient sound for Starport based maps (i.e. muffled machinery , sounds that faintly remind a passing spaceship, some monstrous gnarling and snarling etc)
So actually triggering sounds at a random frequency would prove even more useful than a pre-rendered track. To make sure being present in each map, the playerstart actor could be an interesting object to define those sounds. The episode system could take care of loading a different list of sounds for each episode. They are still present in Doom 2, just unnoticed by the player. Just as the Sky texture changes, one set of ambient sounds would be enough per episode.
Thanks a lot - How would I start doing something like this?

Comments

  • edited 2013 May 6
    Hopefully this comes across well; I had some difficulty writing it:

    Dday has no legietmete way to define map specific ambient sounds on already made maps.

    Though one could kludge it by taking advantage of the fact that particle generators can be placed via co-ordinates, have a map field (i.e make the generator only appear on one specific map) and one can make a particle play a sound at reasonably controllable points.

    The JDAP, IIRC (it's been many many years since I touched it and I don't have it these days) uses a variant of the above mentioned generator kludge to 'attach' ambient sounds to different flats (one can also attach a generator to flats or mobjs. but for mobjs it's better to do it the below way).

    It also adds sounds to mobjs, such as the torches by modifying the state and mobj defs for the original Doom mobjs. Unlike flats above, this is not a kludge.

    In short, three different approaches for adding ambient sounds to already made maps.

    Moving on, what you are looking at is a 'sound definition'. This is something I can point you at the wiki for: http://www.dengine.net/dew/index.php?title=Sound

    Doom and by extension Dday, has no option to control the radius and/or volume of a sound with the exception of removing all distance from a sound (with the nodist flag mentioned in the above wiki link).
  • Hello
    Thanks a lot this already helps me some. I should've just looked further down the .ded file looking for torch1 where it's called by the particle generators.

    Now if you own the wisdom to help me a little further from this point:
    *Could I define several samples (.wav's) to one sound definition
    *Create a particle generator that spawns one particle (and it's randomly selected sound) each 1-60 seconds
    *attach this particle generator to the player start object - alternatively a texture that is most likely to be present but not too often thorough a map, i.e. Sky texture or a door

    I'm just looking for a way to have the particle/sound generator present in every map without having several instances or more than a handful, a different set of sounds per episode/generic style without the need to code a definition for each single map.

    As already noted. The sky texture would be an ideal solution - IF - the particle generator actually knows about the current Sky texture in use.
    Door textures would work because they are most certainly present and few in numbers and probably match the general style of level (Industrial/Stone etc)
    Another method would be a level exit object if theres any
    All those methods would virtually work with the no distance flag for the sounds
  • edited 2013 May 6
    I don't believe the map field in a generator def allows more than one map. So one would need to duplicate the definition for every map, if you go the route of using co-ordinate based particle generators (which IMO isn't any issue).

    No randomness is possible beyond the spawning of the physical particle (i.e you can set a random vector for the particle etc) and one can't attach multiple sounds (i.e lumps, wavs etc) to the same sound def.

    The sky textures are not physical flats on a map and so can't be used to attach a generator to. In game, they all become the F_SKY1 flat, to put it simply.

    All sounds either have to be point based (i.e the source being the particle, wheter it comes from a mobj, flat or is coordinate based), with no control over volume and radius (this is just like Vanilla Doom) or they can play at full volume, with the nudist (no distance) flag set in the sound def.

    Regarding timing the spawning rate, you can control how many particles are spawned a tic; you can have decimal values and values like 0.5, which should in theory mean one particle will be spawned every two tics and so on. There are 35 tics a second though, so if you want one particle to spawn every 60 seconds, your going to need some very big numbers).

    http://www.dengine.net/dew/index.php?title=Generator
  • I've just studied particle behavior for the past 2 hours.
    I understand the system now, but there are some problems:

    Starting from the teleporter particle generator I tried assigning it to door textures and it wouldn't spawn anything. Are particle generators on walls even possible?

    Then I moved to Flats and it worked. The problem is particles are distributed per sector and not a uniform spacing. Avoiding exactly that, I used the | density flag (see rain generator example).
    But then game performance came to a unplayable stall. The performance would return to playable using a Spawn rate = .00001; as low as that.
    Now particle distribution is still unbalanced - particles in a tight sector (staircase steps) behave normally (living for a second or two), while particles in a wide open space flash up for a millisecond and then disappear.
    That wouldn't be a problem since I'm going for the sound, but I fear the sound behaves just as they show up visually. Why is performance 20x worse using density? It lags on a few particles when the rain generator creates a few hundred per second using density

    *EDIT*
    WELL now hold on a second, I've just settled for using the Map initiaters. It's not that complicated after all.

    About randomizing. I don't know how well those syntax and flags are implented. But Spawn Rnd adjusts spawn rate between given value and zero. That one is fixed per generator?
    Allright then I could use Rnd syntax for the particle's first state and apply the sound to the second state. The sound will start at the second state and the first takes a random amount of Tics to pass - OH MY GOD we just got a random sound timer - right?
  • Heres a super early alpha-beta (zero)!
    I've compressed the sounds just to be under 2Mb
    Just load the .zip as addon, it works for the whole first episode.
    Make sure to turn the music down to 20%

    phew, that was an exhausting 5 hours (:|

    oh cheese, now attachements doesn't even work. Heres a link!
    http://www.gamefront.com/files/23276745/ambientsounproject.zip
  • I'm not personally a fan of the sounds having no distance (I'd prefer them to sound like they are coming from a nearby computer or liquid for instance), but It's good that you got it to work properly.

    You are right that you can't attach generators to walls, only floors, but you can use textures as flats in Dday. To avoid any confusion, I have edited my above posts to remove all reference to 'textures'.

    Glad I could help :)
  • Of course a lava/slime pool would have a limited distance sound.
    The thing that I'm doing is a generic ambient sound scape for the levels.
    Not ambience sounds for objects. Thats what I actually expected from the JDAP.
    But I will also update/change slime/lava/torch sounds and maybe some computers etc.
    So I'm actually taking the initial idea and try to advance it.

    The advantage of no distance sounds is that you get a direction but no actual location of the sound. If a starship would pass by and the player realizes that it spawns in the center of a room, the illusion would be destroyed.

    It works pretty well, see my alpha demo
  • I've updated the good a bit. It now looks like this.
    ## BuddhaMasters DOOM Starport and Hell ambient sound project
    ##--------------------------------------------------------
    ## Thanks to JDAP for reference code
    ## Thanks to Vermil for helping me out and aiding direction
    ## with particle generators
    ## Various sounds by FreeSounds
    ##--------------------------------------------------------
    
    Sound {
      ID = "hangarsound";
      Flags = shift4 | dontstop | nodist
      Priority = 140;
      Max channels = 18;
      Ext = "Data\jDoom\Sounds\Ambience\hangar.wav";
    }
    
    ###----------sound GENERATORS----------------
    ##extra notes
    #1 seconds equals 35 tics
    #350 tics 10s# 700 tics 20s# 1050 tics 30s# 1400 tics 40s# 2100 tics 60s#
    #Spawn rate# nr particles per tic, 1 particle per s is 0.0285, each 5s is 0.00571, each 10s is 0.00285
    #I dont get Radius but sounds start spawning bidirectional at values some 50000, seems pretty dam huge
    #Particles# num particles by this gen, use to limit nr sounds simultaenous
    
    #sound0
    Generator {
      Map = "E1M1"
      Flags = blendadd | static | rndpitch | rndyaw
      Speed = 3;
      Spawn age = -1;
      Max age = -1;
      Particles = 15;
      Spawn rate = 0.01;
      #Spawn Rnd = 0.01;
      Vector Rnd = 2;
      Spawn radius = 90000;
      Min spawn radius = 10000;
    
        #Stage {Type= line Flags= "dietouch" Tics= 350 Rnd 0.0000001}
        Stage {Type= line Tics= 175}
        Stage {Type= line Tics= 66 sound= "hangarsound" volume= .8}
    }
    #Copy Generator { flat = "floor4_8";}
    #Copy Generator { flat = "floor5_1";}
    Copy Generator { Map = "E1M2" }
    Copy Generator { Map = "E1M3" }
    Copy Generator { Map = "E1M4" }
    Copy Generator { Map = "E1M5" }
    Copy Generator { Map = "E1M6" }
    Copy Generator { Map = "E1M7" }
    Copy Generator { Map = "E1M8" }
    Copy Generator { Map = "E1M9" }
    

    Notes:
    *Use Particles to limit max number sounds simultaneous to this value
    *Use Spawn Rate to set a minimum possible time duration between two simultaneous sounds
    *Use Tics (first Stage) to define the maximum possible time duration between a sound
    *Set Rnd (first Stage) to 1 to randomize between zero and the maximum duration (Tics)

    - - - - - - - - - - - - - - - - - - - - - -
    The weirdest problem I'm still having is the spawn location of each particle.
    I don't place the particle generator at a specific location in the map, I just expect it to spawn at map center (within the world coordinates), setting it do dead-center makes no difference anyway.
    The particles/sounds spawn at the window facing right in the Hangar (E1M1) level, where armor is located right at the beginning.
    ZIJa4p8.jpg
    No matter how big the spawn radius or particle direction, 75% of the sounds are coming from this general direction!

    Only setting spawn radius to a really huge value like 90000
    scatters the spawn location up a bit. Setting the radius any higher does not help or even makes it worse. I don't know how big E1M1 is in world units. But it sure ain't more than 10'000 units? And the map center must be somewhere close to the map, most likely the first door you enter somewhat to the left.
Sign In or Register to comment.