• Add Review
  • Subscribe
  • Nominate
  • Submit Media
  • RSS

3D Sound

Hey all! I'm thinking of ways to add environmental sound to my engine. This is for all you so-called artistic movie zealots, or those of you who are more movie than game, as this adds some nice immersion to even a 2D game. I tease, but I myself have sometimes wished RPG Maker 2003 was better at handling environmental sounds.

Example

This was evident when I find some good royalty free environment tracks and sounds to create "silent" tension at transitional scenes. Back in the prototypical NovaForce when it was on RPG Maker 2003, I had a scene where Karen ran out and slowed down at the edge of a cliff facing the nearby forest (after exiting the cave and shrine). It was a very very short scene, but it had forest sounds and it signaled the player out of dungeon delving and to see the current state of the main character. No Golden Sun syndrome here, everything in the scene could explain that much with just "I'm lost" as one of the only lines of internal dialog ever written. It's important to minimize the time the player cannot move and play as much as possible.

Sound

Go ahead and skip this part if you already know the physics of sound. I'm actually going to explain this to you since I think it's a useful thing to know for anything where you play sounds. Most of the time, it really does work to just play a sound. However, sound is one of the most overlooked things in game design. Here's the basics of sounds that I know.

You might already know that in a 2D game, sound will pan across the screen as the object emitting the sound pans. The further away it is, the more silent it is as well.

However, I noticed an important flaw with this in RPG_RT.exe versus 20XX. In RPG_RT.exe, if you have a ton of events playing a single sound at random times, the sound just gets reset and replayed every time a single event plays it. What results is you hearing the first milliseconds of the sound repeated fast and as loud as though it were being played by one object only.

Now, in my engine, you hear this deafening roar of the sound- like a landslide. Even though each individual sound is being played at about 10% volume, all the sounds add together to create this loud noise. You are adding waves together, and you can recreate this trashing using water if you're still cloudy about the idea of how waves work (because it's almost literally the same thing). The speakers pound against the air just like you would hit the surface of water.

Finally, one option I need to provide is the ability to offset each sound randomly for the time it begins looping as an environmental sound. If you've ever pounded your feet against bleachers along with an entire class, you'll realize the problem. If you all pound sporadically, the sound is loud and rumbling. However, if you all pound at the same time as precisely as you can, you hear a single sound that becomes much louder than that. If you have a wall of torches that make burning sounds, you will hear a very loud and clipped (volume so high the sound is crappy) single version of whatever file you use. This is why it's important to also vary looping environmental sounds.


I may also add a command that lets you select reverb and effects for a map. This is for things like caves and underwater where the sound effects are strange. Who knows? But I will guarantee at least "3D" sounds. Giving you the ability to play these sounds is useless if you don't understand what sound is, though.

Posts

Pages: 1
Holy mother load of...seriously I wanted to make enviromental sounds for my game, but as I tried doing it in rm2k3, I realised it would be near impossible,plus you can play only one music at a time. This is so friggin awesome!!! I am definately waiting with mah game until this comes out. You sir are like a sun in a tornado ridden day.
dragonheartman
Developer, Starless Umbra / Heroes of Umbra
2966
Perhaps there's a library you could include to compress sound output. Just to be safe?
author=dragonheartman
Perhaps there's a library you could include to compress sound output. Just to be safe?


What are you talking about?
I am not sure if this is possible from an engine standpoint, but could it be made so that a sound plays louder the closer to are you either x,y or the event itself? This would be useful for water drops in caves, or torches burning on walls, or other highly localized sounds. It'd make a big difference, I think, having certain environmental sounds automatically get incrementally louder or quieter based on your distance. I know this is possible in Rm2k3 already for a limited set of scenarios, using hero x,y vs. event x,y, but for more than one event (like drops in a cave) it becomes too time consuming/difficult to implement.

It could also be used for larger maps where a sound was only playing in one part of it; ie crowd noises/mock battles (with npc soldiers jumping at npc ghouls) and stuff getting automatically more quiet as you go to the other end of a city.
dragonheartman
Developer, Starless Umbra / Heroes of Umbra
2966
author=WolfCoder
author=dragonheartman
Perhaps there's a library you could include to compress sound output. Just to be safe?
What are you talking about?
You mentioned issues with sounds clipping if the environmental sounds weren't varied. Hard compression/limiting could prevent clipping. Maybe I misunderstood the underlying problem.
I am not sure if this is possible from an engine standpoint, but could it be made so that a sound plays louder the closer to are you either x,y or the event itself?


Didn't you read the blog post here? This is precisely what the idea of a "3D" sound in a 2D game is and the function of the command.

You mentioned issues with sounds clipping if the environmental sounds weren't varied. Hard compression/limiting could prevent clipping. Maybe I misunderstood the underlying problem.


In real life, wall torches each make a unique sound. In the engine, if you use a single file for each torch with no variation at what time each sound begins looping, it's unnaturally perfectly in line and you head one really loud annoying sound. A good way to fix this is to just vary the starting time by a few milliseconds. But you would still get a louder and louder sound the more torches are close to you in real life and in this engine.

The clipping occurs because the speakers can't produce sound that loud when the sound in real life should get louder and louder. This is like some sort of HDR problem and you could try methods of doing this in sound, but ultimately you would just use a louder speaker. You could just play the sound softly and go up for sounds that need to be really loud, which is easy to do in a video game.

Funny I just said that in an engine that claims "it can go up to 11".
dragonheartman
Developer, Starless Umbra / Heroes of Umbra
2966
0dB is the limit man! It's an interesting problem and I dabbled into music production a bit when I learned about soundwaves and how they are applied to creating music. One way or another your blog posts remind me of the things I'd be thinking about if I had the time, patience, or skill to program a project of this magnitude.
author=WolfCoder
Didn't you read the blog post here? This is precisely what the idea of a "3D" sound in a 2D game is and the function of the command.


That's what I assumed you meant by 3D sound at first, but this entire post seems to be about implementing multiple instances of the same sound at once (and therefore fixing some mysterious error in 20XX). I'm not going to lie, I admit I missed the second paragraph under "sound", but it seems like the insinuation was that RM2k3 already had this feature, which is doesn't.

If it's already been added, then how is implemented? A syscall within the sound playing event?
but it seems like the insinuation was that RM2k3 already had this feature, which is doesn't.


I've actually done it in RPG_RT.exe before as I said, using tricks as always. Still, it would be nice if I could just play event sound.

If it's already been added, then how is implemented? A syscall within the sound playing event?


I didn't add it yet but yeah. Place the call right before the play sound command for best results.
Pages: 1