XACT Fade in, Fade out
Posted on September 27th, 2009 in Colony Defense, GameDev | 2 Comments »
I’ve have a banner weekend polishing up Colony Defense. Everything was smooth sailing except for one little thing. I could not get XACT to act the way I thought it should when trying to fade out a music track. As it turns out, the way I thought it would work was way off base. It’s really pretty simple and I’m posting this in hopes that someone else will get some use out of it. When you create a music category, limit it’s instance to 1. Set the fade in and out times to whatever you want. Now, in code, just play a piece of music any time you want. If a track is currently playing it will “automagically” fade out and the new music will fade in. Where I was getting tripped up was I kept stopping the current track before I played the next one. This gave the effect of an abrupt stop on the current track and an immediate, full volume start of the new track. Other than doing some RPC variable craziness, the way this works turns out to be a very nice way of not having to worry about whats currently playing. It “just works”.
Dan
Click 

2 Responses
???? I’m looking at the xact project right now, and it has all of this already implemented….. Is this post just for informing future programmers, or did you have to build a new project?
Lol… You had it EXACTLY the right way in the project file. The problem was my dim ass understanding of the way it was supposed to work
I didn’t have to do a thing to the project, I just needed to rework my code to take advantage of what you had already set up. Works like a charm now!