Creating a sound engine (V2 see below)

Try out my sound engine here!

Hiya Devs!

I’m currently trying to make a sound handler for my new game, but I want sound to bounce off and (if possible) diffuse through walls like in real life.
This is very crucial for my as sound will play a big part in it.

My inspiration comes mainly from Rainbow 6 Siege, as the audio engine in that game is very good.
Also, if you’ve never watched a Smarter Every Day video, and you’re interested in Sound, check out this!
You can determine if audio is above or below you as well as follow audio to arrive at it’s location - even if it means going in the opposite direction - up a flight of stairs and through a series of rooms.

Version 1:

The red block represents where the sound comes from when direct sight to the origin of the sound is lost.

It uses the Path-finding service to determine the closest route to the player, then plays a lower volume version of the original sound at that point.
As you notice though it doesn’t handle sharp changes in the closest point very well - as you can see around 0:13-0:16

I’m kind of stuck on how to sort this issue. I’ve tried making multiple sounds but that causes poor performance and syncing issues.

Any suggestions or insights would be appreciated!

EDIT: Version 2!

This version better simulates where sound is coming from, and you can even trace back a sound to its origin through a complex maze!
It is also a lot more robust than the first version, with no syncing issues, replication problems between multiple clients and it is modular enough to handle multiple sounds from different directions at the same time.

To do:

  • Test the simulation works on multiple level buildings
  • Test in cramped spaces
  • Implement hi/lo pass filters depending if the sound is above or below your character (reverberation through floor)
  • Thoroughly test performance impact (this may be the only downside to this version)

I’m not sure I understand, where and why do RemoteEvents come into play here?

Ah my bad, I forgot to change the name

This is incredibly impressive, I’ve been doing some research on 3D audio for a while to see how I can do something in my own game, and while I’ve fallen down the rabbit hole of binaural audio and Head Related Impulse Responses, I’ve never seen this approach before! Really impressive, and it sounds extremely realistic from what I heard in the tests.

One suggestion I might have is that you should calculate multiple paths that the sound could take, because in the scenario where the player is standing at the beginning of two identical routes, I’d imagine your system might flip flop back and forth on the chosen path based on where the player is. Maybe each path is weighted by it’s distance relative to all the other paths, so all the paths can contribute to the sound.

That approach might be extremely costly to calculate in real time, so maybe you could have the heavyweight work of path calculations done beforehand for every point and just store them for lookup later?

Im really impressed with this, even if its from 2018 i think it’s really cool.

i honestly would love to see it implemented in a horror game of some sort.