Starquake Update 05/09/2012: Back in the saddle
After what has literally seemed like eons, I finally got around to putting some time into my XNA Starquake remake. With so many things going on, I simply haven’t felt the inclination to sit down and do anything to it. However, today I was inspired when listening to the rather excellent Retro Asylum podcast showÂ â€“Â hosted by my good friend, fellow retro gamingÂ maniac and all round top bloke, Andy Godoy.
This week, Andy and his co-host Glenn 83100 (I think that’s his droid designation…) were reviewing an excellent remake of Atic Atac by Rob Remakes. From what I can gather,Â this isÂ Rob’s first foray into games programming with Blitz Plus and very good it is too. Hearing the kind words that Andy and Glenn had for Atic Atac got me thinking about my remake and I began to feel a bit guilty, remembering how I’d shown Andy and Glen the work-in-progressÂ nearly 18 months ago.
Since then, apart from a few small bug fixes, to my shame,Â not a lot has happened. Tonight, that finally came to an end and I finished writingÂ Starquake’s loading splash screen routine. You can see the result of tonight’s ‘heavy labour’ below:
The actual loading picture is still a work-in-progress and I’ll no doubt playÂ aroundÂ with it some more in the coming weeks â€“Â it would be nice, for example, to actually have Blob somewhere in the loading image… The creation of the splash screen was pretty straightforward. I already had code in the game to provide a percentage of resources loaded and a message to tell you what is actually loading, so that was easy enough to rewire.
What proved to be a mite more troublesome was trying to incorporate a new bitmap font into the application. I’d previously used aÂ utilityÂ called XNAFont from the wonderful XNA resource Ziggyware.Â Sadly, due to a rather nasty and persistent hacking attack around 2009, Ziggyware is no more. Unfortunately, I hadn’t made a copy of the original utility so I had no choice but to find another option.
Luckily help was just around the corner, and with the aid everyone’sÂ favourite search engine,Â I quickly tracked down a very nice little utility called SpriteFont 2. While the title of this app may not be inspirational, the design of it certainly is. It is aÂ splendidÂ example of beautifully designed and crafted Windows Presentation Foundation which has been used to create both an attractive and functional interface. The instructions on the website are curt and concise â€“Â any XNA developer will be able to grasp how to use the output font texture very quickly.
There is one caveat, however, and that’s relating to the background colour. By default this is set to magenta and I would suggest you leave it that way, which is something I learnt the hard way. I stupidly changed it to transparent, which then caused me about 10 minutes of grief trying to figure out why, when I added the resource to XNA, it was complaining that it couldn’t generate glymphs for the fonts.
The reason was very simple: owing to a lack of background colour, it couldn’t work out the size of each character â€“Â doh! So a little tip,Â leave the background colour well alone,Â the default setting is just fine. One thing they do miss out in the instructions, which again will be frankly obvious to seasoned XNA developers, is that you do need to call Begin and End before drawing the font using the SpriteBatch. ThisÂ makes sense really and is in line with all other SpriteBatch operations, but I think it’s worth pointing out just in case any newbies get confused. The instructions on the page should therefore read: [Draw method] batch.Begin(SpriteBlendMode.AlphaBlend); batch.DrawString(font, “Hello world!”, new Vector2(20, 20), Color.White); batch.End();
So thereÂ you have it, Starquake is firmly back on theÂ road and about time too. My stance on a release date very much reflects Valve software’s “when it’s done” but I can honestly sayÂ it’s well on the way!