Environmental Sounds!
Moderators: Bob the Hamster, marionline, SDHawk
Environmental Sounds!
Hello! And thank you for taking the time to look at this thread!
I was wondering if there's any way to place in a looping environmental sound that gets progressively louder when the hero gets closer to it?
An example would be... a waterfall, you can hear it from the distance, and it gets louder as you approach it... Is there a simple copy/paste example that someone can kindly provide through hamster speak? I'd really appreciate it! Thanks again for the help!
I was wondering if there's any way to place in a looping environmental sound that gets progressively louder when the hero gets closer to it?
An example would be... a waterfall, you can hear it from the distance, and it gets louder as you approach it... Is there a simple copy/paste example that someone can kindly provide through hamster speak? I'd really appreciate it! Thanks again for the help!
Unfortunately it's not yet possible to set the volume of a sound effect, so you can't even script this (IIRC, the music volume, which you can set via script, doesn't affect sound effects). But that's definitely something I want, in fact I'll try to add it in the next few days. And I want to be able to place environmental sound sources in the map editor so that the volume attenuation and left/right panning is handled automatically. I just need to figure out how to handle large (non-point-source) sound sources like a river.
I'm not happy with the way sound effects currently work, which doesn't allow playing the same sound effect multiple times at once. Ironically that was how sound effects worked when they were first implemented -- you had to specify channels on which to play them -- but that interface is deprecated, because manually managing channels was too awkward. I need to figure out a better way.
Last edited by TMC on Thu Jan 05, 2012 1:44 pm, edited 1 time in total.
- Pepsi Ranger
- Liquid Metal Slime
- Posts: 1419
- Joined: Thu Nov 22, 2007 6:25 am
- Location: South Florida
I seem to recall fading sound sources being one of the arguments for implementing zones.
Mewmew, if fading sound effects isn't implemented in the next few days, what you could do, and this will suck but it'll work, is create several consecutive zone rings around your source (or walls, if your source is a river or something elongated), and then attach a "read zone" command to an each-step script that checks which zone you're standing in, and plays a specific sound that you have assigned to that zone. The reason it will work is because you can have each zone play the same sound at a different volume level. The reason it will suck is because you'll have to manually rerecord those sounds at different volume levels, import each version of the sound effects, and script each version of the sound to stop playing as each new version is triggered. You'll also run the risk of the sound effect "skipping" as each new volume level will likely reset the sound effect.
But, volume fading will get implemented eventually. TMC has been talking about it since before zones were introduced. He's also, incidentally, been talking about scripts getting triggered upon entering and exiting zones, which he still hasn't had a chance to do, but has been saying he'll do for months now. (That's an elbow to the side, TMC, as I'm sure you've figured out.)
Mewmew, if fading sound effects isn't implemented in the next few days, what you could do, and this will suck but it'll work, is create several consecutive zone rings around your source (or walls, if your source is a river or something elongated), and then attach a "read zone" command to an each-step script that checks which zone you're standing in, and plays a specific sound that you have assigned to that zone. The reason it will work is because you can have each zone play the same sound at a different volume level. The reason it will suck is because you'll have to manually rerecord those sounds at different volume levels, import each version of the sound effects, and script each version of the sound to stop playing as each new version is triggered. You'll also run the risk of the sound effect "skipping" as each new volume level will likely reset the sound effect.
But, volume fading will get implemented eventually. TMC has been talking about it since before zones were introduced. He's also, incidentally, been talking about scripts getting triggered upon entering and exiting zones, which he still hasn't had a chance to do, but has been saying he'll do for months now. (That's an elbow to the side, TMC, as I'm sure you've figured out.)
Place Obligatory Signature Here
Wow... thank you for all the replies! I see that it isn't quite implemented yet... Thanks for the thorough explanation, Pepsi! Unfortunately, I have no idea what zones are... and not brave enough to test it. XD
It's no biggy if there's no simple way to do it for now, I can manage without it, but thanks for the replies!
It's no biggy if there's no simple way to do it for now, I can manage without it, but thanks for the replies!
It's been three weeks? Felt like a week!
Update: after getting seriously distracted by other features, I think that I will finally get this done "in the next few days".
This might all sound like overkill, but I think that if I implement it, people will use and appreciate it. Unlike some of my other overkilled features.
Update: after getting seriously distracted by other features, I think that I will finally get this done "in the next few days".
Next few weeks.Pepsi Ranger wrote:TMC has been talking about it since before zones were introduced. He's also, incidentally, been talking about scripts getting triggered upon entering and exiting zones, which he still hasn't had a chance to do, but has been saying he'll do for months now. (That's an elbow to the side, TMC, as I'm sure you've figured out.)
Zone triggers are good for non-directional sound effects (or music) which play while you're in a zone. But more sophisticated environmental sound effects, such as a point source which becomes much quieter when you leave the room (and is also attenuated by distance) could be modelled as a point source plus a zone. And what about a moving source (e.g. NPC footsteps) that is diminished when you're not in the same room/zone as it?Pepsi Ranger wrote:I seem to recall fading sound sources being one of the arguments for implementing zones.
This might all sound like overkill, but I think that if I implement it, people will use and appreciate it. Unlike some of my other overkilled features.
Last edited by TMC on Thu Jan 26, 2012 6:08 am, edited 1 time in total.
- MirceaKitsune
- Red Slime
- Posts: 43
- Joined: Mon Jan 23, 2012 7:50 pm
- Location: Romania, Bucharest
- Newbie Newtype
- Reigning Smash Champion
- Posts: 1873
- Joined: Mon Oct 15, 2007 9:44 pm
to NewbiePower:
yes, this seems to be what Pepsi Ranger essentially said.
to TMC:
Setting point sources (or NPC sources, as in your walking example) for sound seems like an amazing idea, and not overkill at all. Unless you mean overkill for the coding and/or runtime memory eating, which I guess might be possible...? Is there a limit to how many sounds can be playing at once? Should they automatically be normalized and/or compressed so things don't get bizarrely loud? I don't know anything about how this works, I'm just spouting stuff off that pops into my head.
to Pepsi:
I was the one (or maybe one of the ones) who mentioned using zones for sound effects and/or music, but this idea for sources sounds much better, AND more intuitive.
yes, this seems to be what Pepsi Ranger essentially said.
to TMC:
Setting point sources (or NPC sources, as in your walking example) for sound seems like an amazing idea, and not overkill at all. Unless you mean overkill for the coding and/or runtime memory eating, which I guess might be possible...? Is there a limit to how many sounds can be playing at once? Should they automatically be normalized and/or compressed so things don't get bizarrely loud? I don't know anything about how this works, I'm just spouting stuff off that pops into my head.
to Pepsi:
I was the one (or maybe one of the ones) who mentioned using zones for sound effects and/or music, but this idea for sources sounds much better, AND more intuitive.
I am Srime
- Pepsi Ranger
- Liquid Metal Slime
- Posts: 1419
- Joined: Thu Nov 22, 2007 6:25 am
- Location: South Florida
Ambient sounds came up in the IRC discussion TMC and I had when he was getting the idea to implement zones to make my insane boxing of sections (which I used mainly for sounds, though also for minor cosmetic effects like sprite changes and whatnot) more sensible. So, he's been considering how to use zones to control sound effects since before zones were made public knowledge. The fading of sounds, I'm certain, was part of the discussion, since I recall the jagged river in my massively huge forest map being a pain to script for sound proximity without zones, and the novelty of hearing the river grow louder as the player approaches was part of the consideration. I seem to recall that a lack of volume control for sound effects was also thrown into the discussion at some point, and the reason the conversation about proximity didn't get very far that day.to Pepsi:
I was the one (or maybe one of the ones) who mentioned using zones for sound effects and/or music, but this idea for sources sounds much better, AND more intuitive.
But yeah, he's been talking about it for awhile. Just not publicly. I'm glad that a solution for it is finally underway.
Place Obligatory Signature Here
msw, I didn't mean that point sources were overkill, but rather the more complex stuff, like having a (zone based?) emulation of sounds quietening when you're in a different room from the source or there's some other obstacle in the way. I'm just not sure how to do that: a single zone isn't sufficient if your map can't be split into "inside" and "outside".
EDIT:
You two, Jabber informs me that he would like to take credit for the idea as well!
EDIT:
You two, Jabber informs me that he would like to take credit for the idea as well!
music_sdl currently has a limit of 8 sound effects, which I think is fairly reasonable (maybe raise it a bit), and music_native/2 apparently has no limit. I would just stop the sound effect that's been playing for longest when the limit is reached. I've never heard the normalising/compressing idea before; does anyone else do that?Is there a limit to how many sounds can be playing at once? Should they automatically be normalized and/or compressed so things don't get bizarrely loud?
Last edited by TMC on Fri Jan 27, 2012 2:07 pm, edited 2 times in total.

