Background music/sound effects
Moderator: George Gilbert
Forum rules
Please read the Forum rules and policies before posting. You may
to help finance the hosting costs of this forum.
Please read the Forum rules and policies before posting. You may

- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
- Gambit37
- Should eat more pies
- Posts: 13769
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
I've been doing some playing about using looping ambient sounds that I start up in Windows mediaplayuer before playing RTC. I have a great sombre 'cave' type sound with dripping water, a low rumble and the distant squeak of rats.
It is astounding how much difference this makes to the game. Just playing the DM dungeon and entering the HoC with that background ambience is superb. Add to this my carefully placed short musical stings on one-time only floor pads and already it's like a whole new experience..... *drooling thinking of the possibilities*
It is astounding how much difference this makes to the game. Just playing the DM dungeon and entering the HoC with that background ambience is superb. Add to this my carefully placed short musical stings on one-time only floor pads and already it's like a whole new experience..... *drooling thinking of the possibilities*
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
OK - this is now all done for V0.35.
There's a new object WALLITEM_SOUND_AMBIENT that takes a single parameter (the sound ID). This can be triggered with a trigger / relay etc so you get all the probability / delay settings from them. It's probably best explained by an example. Here's a bit of pseudo text file that plays the scream sound at random with an average frequency of once every 30s.
ref1 FLOORITEM_TRIGGER ACTION=(ACTIVATE) TARGET=(ref2)
ref2 WALLITEM_RELAY ACTION=(ACTIVATE) TARGET=(ref2,ref3) OPTIONS=(DELAY:18)
ref3 WALLITEM_RELAY ACTION=(ACTIVATE) TARGET=(ref4) OPTIONS=(PROBABILITY:10)
ref4 WALLITEM_SOUND_AMBIENT SOUND=(SOUND_OTHER_SCREAM)
The whole thing is set off by stepping on trigger ref1 (you could place this at the dungeon entrance). Relay ref2 then triggers itself and ref3 once every 3 seconds. Whenever relay ref3 is triggered it has a 10% chance of triggering the ambient sound - i.e. it gets played (on average) once every 30s.
Looping can be achieved by having a delay that matches the length of the sound on the relay and a 100% probability (you could actually get rid of ref3 from the above example altogether and just have ref2 triggering itself and ref4).
Fading and volume settings can be done in the original sound file and don't need extra options in the text file.
The sound can be stopped by sending an ACTION=(DEACTIVATE) to the object.
There's a new object WALLITEM_SOUND_AMBIENT that takes a single parameter (the sound ID). This can be triggered with a trigger / relay etc so you get all the probability / delay settings from them. It's probably best explained by an example. Here's a bit of pseudo text file that plays the scream sound at random with an average frequency of once every 30s.
ref1 FLOORITEM_TRIGGER ACTION=(ACTIVATE) TARGET=(ref2)
ref2 WALLITEM_RELAY ACTION=(ACTIVATE) TARGET=(ref2,ref3) OPTIONS=(DELAY:18)
ref3 WALLITEM_RELAY ACTION=(ACTIVATE) TARGET=(ref4) OPTIONS=(PROBABILITY:10)
ref4 WALLITEM_SOUND_AMBIENT SOUND=(SOUND_OTHER_SCREAM)
The whole thing is set off by stepping on trigger ref1 (you could place this at the dungeon entrance). Relay ref2 then triggers itself and ref3 once every 3 seconds. Whenever relay ref3 is triggered it has a 10% chance of triggering the ambient sound - i.e. it gets played (on average) once every 30s.
Looping can be achieved by having a delay that matches the length of the sound on the relay and a 100% probability (you could actually get rid of ref3 from the above example altogether and just have ref2 triggering itself and ref4).
Fading and volume settings can be done in the original sound file and don't need extra options in the text file.
The sound can be stopped by sending an ACTION=(DEACTIVATE) to the object.
- Gambit37
- Should eat more pies
- Posts: 13769
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
*cough*
Wow, this is really cool. I actually didn't think you'd implement it, so massive thanks George. I am really looking forward to playing around with this feature.
One question: You solution doesn't seem to distinguish between a looping background sound for the level (which you'd want played at the same volume throughout the level) and single sounds that you'd want associated with a dungeon feature (a running fountain for example that gets quieter as you move away from it). Does your mechanism handle this distinction?
Wow, this is really cool. I actually didn't think you'd implement it, so massive thanks George. I am really looking forward to playing around with this feature.



One question: You solution doesn't seem to distinguish between a looping background sound for the level (which you'd want played at the same volume throughout the level) and single sounds that you'd want associated with a dungeon feature (a running fountain for example that gets quieter as you move away from it). Does your mechanism handle this distinction?
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
I'm in the process of doing that bit...Gambit37 wrote:One question: You solution doesn't seem to distinguish between a looping background sound for the level (which you'd want played at the same volume throughout the level) and single sounds that you'd want associated with a dungeon feature (a running fountain for example that gets quieter as you move away from it). Does your mechanism handle this distinction?
The above is just for ambient sounds. In addition there will be a FLOORITEM_SOUND which will behave in exactly the same way (so trigger it through relays / triggers etc) but will play the sound as if it was coming from the tile it is located on so will change volume as you change distance from it (as opposed to the ambient sound object, which will play throughout the dungeon at the same volume).
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
Localised sounds now done too.
I've also added a LOOP parameter to both the ambient and localised objects so you don't have to continually relay trigger sound effects for background music / wind etc effects. For example
ref1 FLOORITEM_TRIGGER ACTION=(ACTIVATE) TARGET=(ref2)
ref2 FLOORITEM_SOUND_LOCALISED SOUND=(SOUND_OTHER_WATERFALL) LOOP=(TRUE)
By putting ref1 at the entrance to the dungeon, the sound will be started at the start of the game and just keep on going...
As you'd expect, the localised sound is...well...localised. This means that the party would only hear it in a certain area (the size depends on the volume of the audio file and also if there are any walls in the way) and the volume decreases as the party gets further away from the sound item.
I think that's everything now
I've also added a LOOP parameter to both the ambient and localised objects so you don't have to continually relay trigger sound effects for background music / wind etc effects. For example
ref1 FLOORITEM_TRIGGER ACTION=(ACTIVATE) TARGET=(ref2)
ref2 FLOORITEM_SOUND_LOCALISED SOUND=(SOUND_OTHER_WATERFALL) LOOP=(TRUE)
By putting ref1 at the entrance to the dungeon, the sound will be started at the start of the game and just keep on going...
As you'd expect, the localised sound is...well...localised. This means that the party would only hear it in a certain area (the size depends on the volume of the audio file and also if there are any walls in the way) and the volume decreases as the party gets further away from the sound item.
I think that's everything now

- Gambit37
- Should eat more pies
- Posts: 13769
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
I hate to swear, but no other words seem to have the right weight: GG, this is so f*cking cool!!!!!!!!! thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you!!!!!!!!
Now to get hold of v0.35 and start building something nice with the new features....
Now to get hold of v0.35 and start building something nice with the new features....
Excellent! Wow... this is great stuff. I haven't been around for a while, and although I had tons of ideas for my dungeon I just didn't want to put too much time into it knowing that V0.35 would eventually be released.
I can't wait lol. I too have the perfect ambients
and you are right Gambit, it makes a huge difference.
I can't wait lol. I too have the perfect ambients
