Let's say there is a multiplayer 2D game and a 2D spatial sound system, in which sound volume decreases, when distance to the sound position increases. E.g. explosion happens. Should player hear it if it's outside the camera's viewport zone? Basically, how big should a max distance to sound position should be? How is it handled in other 2D games?

  • \$\begingroup\$ The most basic way is panning the sound: if the explosion is out of reach of the screen, pan it so that you hear it more from the left ou right. Any decent game engine has panning when playing a sound. \$\endgroup\$ – DH. Jan 14 '16 at 15:56
  • \$\begingroup\$ yeah, no problem with panning. I wonder about volume \$\endgroup\$ – Gintas_ Jan 14 '16 at 15:57

I would say it works best if you can hear things that are just outside the screen too. This helps in creating the illusion that the world continues outside the screen. Try to set it up so that the volume is linearly connected to the distance from the player.

volume = distance/maxAudibleDistance

maxAudibleDistance would be for example 75% of your screen size, assuming your character is always in the center of the screen. Then you could hear explosions faintly if they happen 25% distance outside your screen.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.