Friday, February 19, 2010

Sounding Off

After throwing several kinds of rage at my sound code, I've finally gotten it back to something bordering on working. Music turns on, turns off and generally plays well in the context of what's going on. It turns out that the code I had in place was working just fine. The problem stemmed from the fact that I was trying to call it all over the place. There's a call for the function (and for blood) at the beginning of the program, when you restart, when you pause and a bunch of other places. The issue was that these would all start doing their own little thing no matter what I told them to do. Also, it seemed like the software was calling versions of the music code. So the code would say, "Let's play music!" Then we would all dance. Then the code would say, "Let's play different music!" at which point new music would play, while the old music continued. I can't express enough how terribly wrong that is. The code says on a basic level to play music if there isn't already a song playing. It also says to stop playing music if it's turned off someplace. I then turn the music off right before calling the code. Those two conditions would seem to imply that you can't have two things playing simultaneously, unless they are somehow considering different versions of the same code.
As you can see, it was a very confusing bug.
I gave it the coup de grace by eliminating all of the calls except for the one in the game loop and the one on the Front Menu. It works great now.

-Odd, that story seemed to start off with fire and then kind of petered out at the end there. In case you're wondering why this took me so long to do, it was because I spent all yesterday being a Journalist and writing reviews and editorials for GamerRoad.com. I've been spending some time playing XBLI Games and passing judgement on them. Maybe, just maybe, having a review on the internet will bring somebody some kind of recognition. Although I do seem to review things kind of stupid. If you've ever read my critiques and thought to yourself, "Hey, I wish there were 600 more words like this," then, well, there you go.

No comments: