3D Sound Emitter Behaviors

Rimrook

  • *
  • Posts: 251
EXAMPLE:
http://www.stencyl.com/game/play/31925

DOWNLOAD:
https://www.dropbox.com/s/eta4zkt1ptvbknc/3D%20Stereo%20Sound%20Emitters%20v01.stencyl?dl=0

KNOWN ISSUES:
• The part of the code that finds an open channel sometimes fails its purpose, making a channel of a sound fail to play.
• Sometimes sound doesn't sync up but I think its a performance issue. Only tested in flash and could be related to the game loading directly into a scene rather than going to the scene from another scene. This theory is untested though.
• Sounds sometimes overlap and cancel each other out. Probably has to do with the free channel check.
• Stereo sound emission doesn't work reliably. The other three work ok with the above issues being the exceptions.

Hope you find it useful, and if you can improve this system, please do and post.

NOTES:
If you need to edit sounds, I use Audicity for all that stuff. Works great, easy to use.

« Last Edit: October 27, 2015, 07:44:22 pm by Rimrook »

mdotedot

  • *
  • Posts: 1548
Hey RimRook,

So you finally published it !
It is still great and very atmospheric. I'm bound to include something like this in my future project!

Great Work!

Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

Donni11

  • *
  • Posts: 2182
Amazing ! Pretty impressive :) !
Peace

Rimrook

  • *
  • Posts: 251
Thanks! I'm glad people like it in such a rough form. At least it seems rough to me because of the caveats.

I would like to encourage people to try to improve it. I'm not doing any stencyl stuff these days and I would love it if the community helped out.

merrak

  • *
  • Posts: 2379
This is really cool! I'll have to play with this some--I think this will open up some neat possibilities. Thanks for sharing it!

riki82

  • Posts: 326
Wow! It's super cool!

SquarePug

  • Posts: 148
Just had a look at the code blocks to achieve this effect - very cleverly done! :D
Website: Satch
Twitter: @satchapps.

SquarePug

  • Posts: 148
This gave me an idea where I wondered if a similar effect could be achieved, but using regions and only a few blocks of code.

Ive put the result in the arcade here: http://www.stencyl.com/game/play/32543

In the end it was quite simple to do. It detects when a player enters the region and then varies the volume based on their position. Using Rimrooks sounds in the original file the regions overlap to try and create an effect of the sound going across as the player moves.

The functionality of it is not perfect, and I havent polished it to up so that the regions are the ideal size. But you get the idea. Limitations are that I have set each sound for its own channel, so you could probably only implement it 3 or 4 times per scene depending on how many other sounds are going on in your game. It also uses quite a few 'always' blocks so if a game already has lag issues then this would worsen it. But if the effect was only needed once or twice in a scene, or only a few times in a whole game then using the regions method may be an alternative. Rimrooks is obviously better though if you want to use the effect more extensively  :)
Website: Satch
Twitter: @satchapps.

Rimrook

  • *
  • Posts: 251
SquarePug I'm glad you played with it a little bit. I had completely forgotten that regions exist because I have the worse luck with them. If they worked better, or I worked better with them, this behavior likely would have been driven by them.

Ideally the concept was to have only 3-4 overlapping ambient sounds in the environment. Emitted mono sounds are nearly unlimited as they play once on whatever channel is open. Most commonly in a game's design is that you have a music track with a general ambiance track and then a few incidental ambient emitters coming from things that need them.