A request to the devs: Particle sound volume randomization

edited 2013 May 9 in General
Hello

I'm creating a new Ambient/Background sound pack.
Based on the initial idea of the JDoom Ambient Pack (JDAP) I'm using particle generators to spawn the sounds.
Since there is already a Volume syntax, would it be possible to add a Volume Rnd Syntax and if further possible a pitch randomization at values of -/+ 30% or more?

I don't know about the Doomsday initial coding language, but since there is already a Volume value for sounds it would be fairly easy to add random. In C++ It would look something like this:
Play Sound {
  Rnd Volume = Random Number;

  Play Sound(Volume *Rnd Volume)
}

Comments

  • I tried to use Particle generators for environmental sounds, had some success, but found they got cut off when lots of other sounds are playing. I ended up doing it another way.

    So if you do get this working, it would be cool to see an example :)
  • Yes, I have a early alpha working for my Ambient sound pack.
    You can download the alpha in the thread DOOM->Add ons->Defining a ambient Sound

    I just use a very slow particle generator defined for each map with a huge radius. Then I use the second particle state and define a random tic lenght in the first stage to have random time frequency between each sound.

    The volume/pitch randomization would help prevent the sound scape becoming boring
  • Indeed, I'd not previously noticed there was a volume control in generator defs (it's not something one naturally associates with generator defs) and I'd forgotten there was a link volume field in sound defs, as linked sounds are not needed for modern Dday mods (hence you tend to forget about their existence).

    But why is there not a standard volume control in sound defs?

    Yeah, the link volume field can be manipulated to function as one, but a standard volume control would simplify things a little bit. I'm assuming the code is basically all there on account of the above two mentioned volume controls.
  • Cool, will check the alpha out, like how you did sounds at random times.

    Having a volume control in sound defs would be good. At the moment I am actually editing the sound file it self and changing the volume, then re-saving.
  • edited 2013 May 8
    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.
  • A Doom map is built on a hardcoded grid. All co-ordinates are based off this grid.

    However, a mapper doesn't have to build the physical map anywhere near 0,0,0 on the grid and can build it 10,000's of units away from that point if they wish.

    That wall you highlight is almost perfectly south of 0,0,0 on the grid, by about 3000 units.
  • Any idea why the particles/sounds are still coming from this general direction even when Spawn Radius is as huge as 90'000?
    At such size the scattering would be so uniform, even by coincidence they would never spawn at similar location
  • You'd have to ask Deng team about that.

    But I note you have no spawn co-ordinates for your generator in your def?

    If defs with no spawn co-ordinates default to 0,0,0, a minimum spawn radius of 10,000 means your particles will never spawn inside the actual map (the entire E1M1 map is within 10,000 unit's of 0,0,0).
  • Well, not sure if im missing the point here, but I have managed to add environmental sounds to a map by creating new 'Thing' objects.

    I can pop them in were ever I want a sound in a map and the sound comes from that location. So as I walk away the sound fades. Only problem I have with this method is I cant seem to be able to adjust the volume, so I need to actually edit the sound file its self.

    Anyway, here is the code if its any interest. I guess its just a different way of doing things? Though I am very interested in the 'Particle' method, seems thats the best way to do it and has more functions to make it more versatile. However, I did find that when a sound was playing it got cut off once I started shooting bad guys and lots of sounds started playing. The engine can only play so many sounds at any one time.
    Sound {
      ID = "Fan_one";
      Ext = "Sounds\Fan_1.wav";
      Link pitch = -1;
      Link volume = -1;
      Priority = 70;
      Max channels = -1;
    }
    
        Thing {
          ID = "SND_Fan_1";
          Name = "SND_Fan_1";
          DoomEd number = 8495;
          Spawn state = "ENV_SND_Fan_1_1";
          Pain sound = "Fan_one";
          Pain chance = 1000;
          Spawn health = 1000;
          Mass = 25;
          Radius = 32;
          Height = 64;
          Flags = "mf_noblockmap mf_nosector mf_local";
        }
    
        State {
          ID = "ENV_SND_Fan_1_1";
          Sprite = "BLNK";
          Frame = 0;
          Tics = 1;
          Next state = "ENV_SND_Fan_1_2";
        }
    
        State {
          ID = "ENV_SND_Fan_1_2";
          Sprite = "BLNK";
          Frame = 0;
          Tics = 122.9;
          Action = "A_Pain";
          Next state = "ENV_SND_Fan_1_1";
        }
    

    However, using this method you need to actually 'place' the 'Thing' in the map, while in the other method you have made it emit from a texture and so no map editing needed, easy for an add-on.
  • Indeed, using a thing or better yet the Sound XG Class, are better ways of adding ambient sounds to maps (though XG hasn't been fully restored since the rewrite, so is largely in functional atm, though a couple of improvements to that were made for 1.10). But both require editing the actual map, which wasn't an option with Buddhamasters mod.
Sign In or Register to comment.