Ambient Sound Sequence?

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Post Reply
User avatar
RastaManGames
Posts: 375
Joined: Wed Mar 12, 2014 11:13 pm
Graphics Processor: nVidia with Vulkan support
Location: Russian Federation, Krasnoyarsk

Ambient Sound Sequence?

Post by RastaManGames »

I have 45 sounds and i need to do tricky thing:
In interval from 1 to 2 mins 1 of 45 sounds must be played in specific spots of my map with specific radius.
How can i do that? For this moment, i just put 45 ambient sound things in one spot, but (of course) sometimes more than 1 ambient sounds are played... So... This method are dull and ambient sounds are mixed into hellish cacophony.
I need to learn about sound sequences or i can (somehow) do that trick just using ACS?
Or there is any good method to do that without hard scripting? Because map is really big and i do not want to load in-game processor too much.
Also sorry for my really awful English... :oops:
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Ambient Sound Sequence?

Post by Enjay »

Do you need the sounds to be played in a specific sequence, or do you just need one of the sound to be picked at random? If it's the second option, you can define a random sound in SNDINFO, allocate all 45 sounds to the random sound and then allocate the random sound to an ambient sound thing with suitable parameters.

e.g. from the SNDINFO in my Heretic Thief mod:


I called a sound "ambience" (probably should have gone for a better name) allocated sounds called amb01-amb29 to it (these corresponded to sound lumps with the same names - again, not best practice) and then I defined ambient sound 12 to play the sound "ambience" at a random interval (from 10 to 30 seconds) in surround sound. So, all I had to place in the map was a single sound item for sound number 12.

Code: Select all

//this sets up the random sound called "ambience"
$random ambience { amb01
		   amb02
		   amb03
		   amb04
		   amb05
		   amb06
		   amb07
		   amb08
		   amb09
		   amb10
		   amb11
		   amb12
		   amb13
		   amb14
		   amb15
		   amb16
		   amb17
		   amb18
		   amb19
		   amb20
		   amb21
		   amb22
		   amb23
		   amb24
		   amb25
		   amb26
		   amb27
		   amb28
		   amb29 }
		   
//This allocates sound lumps to all the entries in the ambience sound
amb01	amb01
amb02	amb02
amb03	amb03
amb04	amb04
amb05	amb05
amb06	amb06
amb07	amb07
amb08	amb08
amb09	amb09
amb10	amb10
amb11	amb11
amb12	amb12
amb13	amb13
amb14	amb14
amb15	amb15
amb16	amb16
amb17	amb17
amb18	amb18
amb19	amb19
amb20	amb20
amb21	amb21
amb22	amb22
amb23	amb23
amb24	amb24
amb25	amb25
amb26	amb26
amb27	amb27
amb28	amb28
amb29	amb29

//this sets up an ambient sound definition that can then be placed in a map
$ambient 12 ambience SURROUND RANDOM 10.0 30.0 1.0
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: Ambient Sound Sequence?

Post by Gez »

See [wiki]Ambient sound[/wiki] and [wiki]Sound sequence[/wiki]. You may be interested especially in [wiki]HereticAmbience[/wiki].
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Ambient Sound Sequence?

Post by Graf Zahl »

I think this can better be done with ACS's sound playing functions. There you have total control over which sound will be played where.
The automated playing thing are not really the best solution here
User avatar
RastaManGames
Posts: 375
Joined: Wed Mar 12, 2014 11:13 pm
Graphics Processor: nVidia with Vulkan support
Location: Russian Federation, Krasnoyarsk

Re: Ambient Sound Sequence?

Post by RastaManGames »

First i try Enjay's method... :wub:
By the way, ACS method include timer with ticks and some cycles?
I know programming little bit, but i don't understand the basic core of this method...

UPD: Thank you very much, dudes! Enjay's method are working fine! :geek:
I remember also nameless mod (idk who author of that creation), where in every level playing some dark ambient music and after few seconds some various random scary sounds (like metal screeching, wood breaking, stone moving and etc.) are playing near player (i think it's surround).
Post Reply

Return to “Mapping”