Background music/sound effects

Messages are moved here (should anyone ever want to see them again) once they are no longer applicable to the current version (e.g. suggestions that have been implemented or bugs that have been fixed).

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Thinking, yes. It' on my list of things to do - whether it gets done for V0.35 is another matter though.
User avatar
Gambit37
Should eat more pies
Posts: 13769
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Okey dokey. Just knowing you're thinking about it makes me sleep better at night. :wink:

I have some great ideas of how to use this feature...
User avatar
Gambit37
Should eat more pies
Posts: 13769
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

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*
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

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.
User avatar
Gambit37
Should eat more pies
Posts: 13769
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Good lord! *faints through sheer excitement*
User avatar
Gambit37
Should eat more pies
Posts: 13769
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

*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. :D :D :D

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?
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

I guess you would have several ambient sounds that you trigger as you get closer and closer to the source
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

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?
I'm in the process of doing that bit...

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).
User avatar
Gambit37
Should eat more pies
Posts: 13769
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

*faints again*
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

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 :wink:
User avatar
Gambit37
Should eat more pies
Posts: 13769
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

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....
User avatar
Lee
Artisan
Posts: 182
Joined: Wed Mar 16, 2005 8:09 pm
Location: Montréal
Contact:

Post by Lee »

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 :D and you are right Gambit, it makes a huge difference.
Post Reply