How do I prevent sound effects from overlapping

Get help using Construct 2

Post » Mon Jun 02, 2014 2:20 pm

Hi,

I have been building a variation of a simple match-3 game for a while. Now I have managed to make a system with all the typical additions - like creation of specialty ball and boosters and such. But I now have encountered a problem with the sound effects. When different events occur at the same time, the respective sound effects overlap and make weird noises. Now what can I do to stop this?

Thanks in advance.
B
4
Posts: 28
Reputation: 280

Post » Mon Jun 02, 2014 3:42 pm

Audio tags

Some actions affect audio parameters such as the volume for sounds which are already playing. However there can often be many sounds playing at once in a game. In order to identify which sounds you want to affect, sounds are played with an associated tag. This is any string that identifies the sound. For example, the player's weapon sound effect could be played with the tag "PlayerWeapon" and an enemy's weapon with the tag "EnemyWeapon". Then, the tag can be used in the Set Volume action to specify which sound to set the volume for. Tags are case insensitive.

Multiple sounds can also play at once using the same tag. In this case actions like Set Volume affect all the sounds playing with that tag.
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Mon Jun 02, 2014 8:14 pm

I have been using tags for sound effects.

My specific issue is two different events can happen simultaneously, in which case the associated sound effects with different tags play at the same time and together make weird noise artifacts. In fact, sometimes, more than one instance of the same event can happen at the same time, in which case, the same sound effect clashes with itself and causes trouble.

I was wondering if there is some way to work around it?
B
4
Posts: 28
Reputation: 280

Post » Tue Jun 03, 2014 9:49 am

Bump.
I really need the answer. My game is almost finished- this is one of the very last hurdles. :oops:
B
4
Posts: 28
Reputation: 280

Post » Tue Jun 03, 2014 1:37 pm

One trick you could try is to not play the sound immediately, but set a variable to indicate the the sound should be played, then make one of your last events a check for this flag. You could have one for each type of sound, or just one in total. You'd need an extra variable to hold the type/name of the sound you want played in the 'just-one' case.
ImageImageImage
B
71
S
22
G
247
Posts: 3,753
Reputation: 137,552

Post » Tue Jun 03, 2014 3:39 pm

@ blackhornet - Thanks for your idea. I think it works, so far as I have tried. :D

(who knew a simple match-3 game could be this complicated!)
B
4
Posts: 28
Reputation: 280


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Lisa999, RandomlyMooN and 7 guests