I added the all essential pause button which helps taking screenshots. Normally it’s supposed to display the word “Paused” and slightly dim the screen, I’ll add that in a Release build since it’s very simple to do. Here I’m showing off my damage indicators (the number 3) and the fancy font used for it. After doing a lot of research I decided I don’t even want to mess around with the horrific world of font licensing, so opted to stick with the safe free fonts that Microsoft has so kindly supplied with the XNA development studio. Arashi’s bokken slash kind of obscures the transparency effect the kittri has but if you look really closely you can see the monster fades out when damaged as well. Also, just to show I’m not lying, I let Arashi take some damage to show off the hit point bar ;p
Now as you may have noticed my update is kind of late, and with good reason: sound in XNA is a pain in the butt. As always, audio seems to be the toughest thing to get to work well in my game development. First of all, raw .WAV files in the standard PCM encode (which is what Windows uses by default), is the only format that XACT (XNA’s audio manager) works with. Now, as you can probably guess, that means the audio files for BGM (background music) are HUGE as they are uncompressed. And to make matters worse, compression is not a default option in the XACT audition tool (another layer of development, which I’ll talk about in a second). So here I got a 30 MB file just for the first stage, and the maximum file size for the completed game has to be 150MB!
XACT is fairly robust, but it is not actually part of Visual Studio and functions as a utility of XNA development studio (it is not integrated at all in the development, in fact, its projects are totally isolated from the game project). This is kind of a hassle for people just starting out because the directories are never automatically lined up and the file names you need to reference aren’t 100% intuitive. Take caution when using XACT and don’t rush it. I actually recommend MSDN’s help file online for XACT because I found it far more useful than any demo on the XNA community forum or even with a google search. And I don’t recommend MSDN often since it usually overcomplicates stuff.
Now for the ironic part, I actually am using the MediaPlayer class built into the XNA framework’s Media library, because it decodes MP3 files (which are much more efficient spacewise). What’s even more amusing is for some reason this format plays much smoother than the uncompressed .WAV on my PC, so the background music doesn’t skip with MP3s. I also have it just playing preloaded sound effects in memory, because I don’t even want to bother with XACT at this point for sound “cues”. I’m having trouble finding good free sounds though… and I’ve run into one more problem, voice acting. I only need a limited amount of it for the combat voices (think Street Fighter), but I’m obviously not going to be able to do every voice in the game…
Anyways, this was a bit of a rant, but needless to say I’m about ready to actually start designing the first playable level. Of course, that is a ways off, as I will be adding assets and more gameplay elements along the way, but now I have a base game to work from.
Err, if you’re using XACT 3 you can use the xWMA format, and it uses Xaudio 2 also (much newer than DirectSound.)
Theory is one thing, but once you sit down to actually use XACT it’s not nearly as user friendly as it sounds. As for xWMA format I don’t have anything at the moment that compresses to it, and CPU performance was bad while using XACT.
Understandable. XACT is meant as a high level 3d sound processing library, not a general sound library…I don’t think I’d want to use it until I knew more.
I’d think you can use XAudio 2 directly in XNA, but I haven’t looked into it enough.
Of course, you already know I don’t speak from experience here. 🙂
You’re right about both facts there, XACT is actually ideal for true 3D sound but in a 2D game like this one it’s fairly overkill. Stereo panning is enough and that can be accomplished just using the base SoundEffect by setting a value from -1 (Left) to 1 (Right) to the panning property after the wav file has been loaded into it. I’m not sure what the XNA.Framework.Audio class actually uses to process low level sound instances, I just know that SoundEffect and MediaPlayer are very easy to use as is and can only assume it uses the most recent standard in audio processing.