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.
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.
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?
I really need the answer. My game is almost finished- this is one of the very last hurdles.
Develop games in your browser. Powerful, performant & highly capable.
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.
blackhornet - Thanks for your idea. I think it works, so far as I have tried.
(who knew a simple match-3 game could be this complicated!)