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.

Ambient Sound Sequence?

Postby RastaManGames » Sun Dec 30, 2018 9:43 am

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
Syberian Doom Fan
Joined: 13 Mar 2014
Location: Russian Federation, Krasnoyarsk
Discord: RastaManGames#4168

Re: Ambient Sound Sequence?

Postby Enjay » Sun Dec 30, 2018 9:56 am

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 allExpand view
//this sets up the random sound called "ambience"
$random ambience { amb01
         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
User avatar
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
Joined: 15 Jul 2003
Location: Scotland

Re: Ambient Sound Sequence?

Postby Gez » Sun Dec 30, 2018 10:02 am

See Ambient sound and Sound sequence. You may be interested especially in HereticAmbience.
Joined: 06 Jul 2007

Re: Ambient Sound Sequence?

Postby Graf Zahl » Sun Dec 30, 2018 12:40 pm

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
Joined: 19 Jul 2003
Location: Germany

Re: Ambient Sound Sequence?

Postby RastaManGames » Sun Dec 30, 2018 2:25 pm

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).
User avatar
Syberian Doom Fan
Joined: 13 Mar 2014
Location: Russian Federation, Krasnoyarsk
Discord: RastaManGames#4168

Return to Mapping

Who is online

Users browsing this forum: No registered users and 0 guests