Mute the music bug.

ark626

Moderator
I think i solved why sometimes the music mutes.
JUST my own interpretation of what happens.

What i do => Switch from a map to another with different musik
Then with a bit of timing switching BACK.
Musik stops!

What i think it is
Musik fades out and will go over to the other musik of the second map.
If now something switches back before the change of the BGM is done the selected bgm will drop to nothing because the selected bgm is the first and it fades out but the other bgm was interrupted from being selected trough the second map change.

I think i am also able to reproduce. (did it 3 times and it happend everytime)
 

Teddy

Developer
Staff member
Nice find! Certainly a bug, but sadly this is not the cause of the mysterious bug where the music randomly disappears for no reason :(

This happens exactly for the reason you describe, but the random bug happens whenever it feels like it!
 

ark626

Moderator
I think the music sometimes disappeares IF
the audiochannels are to much used.
If there are to many things that causes noise for example.

a chicken makes noise then your skill makes noise you hit som bushes they make noises the bgm makes noises.
some other birts make noises and so sometimes the music blends out because too much audiochanels are in use?

Is it possible to make a map where many things that are doing noise on the same map with bgm to create?
That could maybee help. (map with 10 chicken some bushes some ghostys etc)
 

ark626

Moderator
One question?
Is the audio fade in fade out using floats and if how are they compared?
Could they be the reason for the Musical blackout?
Is the blackout even in the newest version or has it been fixed already?
 

Teddy

Developer
Staff member
The fades are done in floats but that shouldn't be a problem. Float errors in C# are to my knowledge limited to tiny rounding errors, which in this case doesn't really affect anything! Also, the music tends to disappear in the middle of the song sometimes, when the music volume isn't adjusted at all.

My guess is that the wavebank reference is accidentally lost sometimes, leading to it stopping randomly when the garbage collector decides to take a go at it. I'm going to continue investigating.

The bug is not fixed yet but I've made it so that the music should restart again if it stops playing, which is slightly better than the game going completely silent until you've triggered a new track! Since I can't reproduce the bug on my machine, though, I haven't been able to test this hack yet sadly.
 
Top