Archive for the ‘Software Development’ Category

Friday, October 6th, 2006

Many people discover my blog while searching for XNA & HLSL Tutorials.

To be honest, I’m probably as much a beginner as most of you.  I do know your pain though – it’s damn hard to find an HLSL tutorial pitched at a beginner’s level.  That is why I blogged when I finally discovered some promising resources.

I’m planning to update this blog occasionally with whatever HLSL learning’s I uncover.  They will likely fall short of what you’d call a tutorial.  More likely they’ll be sporadic little journals sharing my HLSL findings as my own understanding grows.

I’ve also been in contact with the operator of the Riemers site. I’ve linked to his HLSL tutorial before and no doubt a few of you are finding it an excellent resource.

He plans to update or include more beginner’s level HLSL tutorials and has welcomed any feedback or ideas from me.  

I’ll be giving him my own wish list at some stage.

If you have any particular ideas or wishes, please leave a comment here, and I’ll be sure to pass them his way.

So what would you like to see in a beginner’s level HLSL tutorial?  Go ahead and comment!

Average Rating: 4.4 out of 5 based on 167 user reviews.

Monday, October 2nd, 2006

With my game (or at least work in progress) now rewritten for the XNA Framework, I thought I’d better look into how to distribute it.

Distributing the game build itself is nothing fancy.

However, an XNA game simply won’t run unless the XNA framework is installed also.  No surprise there.

Here’s the catch

Currently, while XNA is still in it’s Beta 1 phase, there is no easy way to redistribute the XNA framework dll’s along with your game build.

Sure, you could possibly try an identify the required Dll’s and through trial and error eventually get it to run.

But, you’d be violating the XNA beta 1 EULA.

This is just a temporary thing, as I believe a full (non-beta) release of XNA and Game Studio Express is planned before the end of 2006.  Don’t worry.  Microsoft most definitely wants people to be distributing their games.  That’s the whole idea!

The solution!!!

Until the full version comes out the only legal way to get an XNA game running on another machine is a bit annoying.

On the target machine you must first install the following:

  • .NET Framework v2.0 – no surprise there.
  • Microsoft C# Express
  • Microsoft Game Studio Express (beta 1).

Yep, it’s a bit of a pain to be sure.  Still, it is a “beta” remember. Mustn’t grumble. 

More details in these two MSDN threads: here & here.

Anyway, I plan to put up my first XNA build for download soon.  Unfortunately, you’ll need the above  stuff installed, which pretty much rules out all but the most motivated, or those already tinkering with XNA.

Average Rating: 4.4 out of 5 based on 257 user reviews.

Monday, October 2nd, 2006

That’s right, all done. WHOOHOO!!!

What this really means is that I’ve caught up to where I was before XNA came on the scene.  Managed DirectX is a distant memory, but a useful stepping stone nevertheless. 

Far from a complete game, but a playable concept to build on and up!

I’m very happy with the end result. 

  • The code is much more maintainable than before. 
  • So maintainable in fact, that it was relatively simple to throw in the option of the ”Dusk” sky & mood lighting I mentioned earlier.
  • And while subtle, I can tell the graphics look a whole lot nicer too! 

I have not updated the screenshots & build for the XNA version yet.  But stay tuned.

p.s.  JD, I sped up the bullets too!  ;)

Average Rating: 4.5 out of 5 based on 167 user reviews.

Friday, September 29th, 2006

Just a quick update tonight.

Things are progressing very well. I’m nearly back to the point I was at before rewriting for XNA.

Just the shooting to add and some minor glitches to fix.

However, along the way, I couldn’t help but throw in something new. So here’s a quick peak.

Thanks to the joys of Refactoring, XNA, HLSL (shaders) I now have I nice wee system for changing the look of the game for different environments. Click for a comparison screenshot showing the Spitty in bright daylight vs moody dusk. In particular, check out the way the lighting of the model itself is different.

Day
Dusk

Also note the glossy Cockpit. Difficult to appreciate with a still image, but in game you can clearly see it’s of a different material to the rest of the plane. Not transparent, but I don’t think it really needs to be for this game.

I’ve designed things such that I can switch between the two environments with one line of code!!!

Average Rating: 4.5 out of 5 based on 295 user reviews.

Monday, September 25th, 2006

Just a quick update on the Game dev progress.

Rewriting for XNA has been keeping me busy. Up till a couple of nights ago, it had felt very much like back to square one.

I’ve finally got past the initial slowness, and am starting to make forward progress again.

Milestones

  • The seriously stripped down XNA sample code is starting to feel like my own at last. I actually know where to look for stuff now without needing to search unfamiliar code.
  • I’ve integrated my Spitfire model.
  • So far, I’ve got by with the sample HLSL shader. By looking at the sample code, I’ve also worked out how to make the Cockpit look glassy. Not exactly transparent, but more reflective and probably good enough.
  • I’ve converted over my code for the movement, so the Spitty now flys and turns as it did before.

What’s next?

  • Incorporate or rewrite my Skybox code for the background.
  • Ditto for the CloudManager.
  • Then it’ll be time to incorporate some SHOOTING to keep the punters happy.

That’s about all I can think of for now.

Oh, and I have this week off work, so between holiday activities I’m hoping to get some good progress done!

Average Rating: 4.9 out of 5 based on 213 user reviews.

Thursday, September 21st, 2006

If you’re anything like me, you’ve probably got used to the trusty .NET Garbage Collector always being there, and never really needing to know more.  Gone are the days of languages like Delphi (where I learned OO) where you had to explicitly clean up after any object you created.  You learned by necessity to be wary and methodical and avoid those nasty memory leaks.

Now days the Garbage Collector makes life so much easier.  With Business application development, there rarely seems to be any need to even think about all your memory usage and the Garbage Collector.

With Game Development however, it’s important be aware again.  You really want to minimise any reasons for the Garbage Collector to charge in and do it’s business.

Case in point:  My CloudManager class (essentially a Particle System, not that I knew it at the time) used to cause awful stuttering in my game 10-20 seconds after starting the game.  The problem was that the Garbage Collector was kicking in and cleaning up after all those Cloud objects that had since expired, and been culled from the list.  The solution was quite simple really.  I changed the CloudManager to behave like a Pool of clouds.  Once the pool reached its maximum size, the cloud objects would be recycled rather than culled.  Problem solved!!!

Anyway, I’m getting off the point.  The point is Shawn Hargreaves (of XNA team fame) has put up a most excellent wee post about the good ol’ garbage collector.  In particular he talks about how the much anticipated XNA Content Pipeline will deal with GC. 

Of most value, to me personally was his short and sweet explanation of the Garbage Collector from a Game Development point of view. Nice to have small an understanding of these mysterious things.  ;)

Check out “Taking out the trash”.

Average Rating: 4.5 out of 5 based on 226 user reviews.

Monday, September 18th, 2006

I haven’t even studied the last ones yet, but this one looks like a good starter for Pixel Shaders specifically.

Average Rating: 4.4 out of 5 based on 156 user reviews.

Monday, September 18th, 2006

I stumbled on another XNA related blog that caught my eye.

360 Prophecy has put up some downloadable XBOX 360 graphics files, that are sure to come in handy when I really get serious about my game dev.

XBOX 360 Controller graphics

Good stuff, and yet another blog to keep an eye on. ;)

Average Rating: 4.9 out of 5 based on 155 user reviews.

Friday, September 15th, 2006

I mentioned earlier that the new XNA framework requires you to do things with Shaders, where before you didn’t have to.

This is all good, but yet another new thing to learn.

So I’ve been googling quite a lot lately. I can’t believe what a struggle it has been to find a decent beginner level tutorial out there!!!

Last night, I think I may have finally stumbled on a couple. I’ll look into them in the weekend, but they did at least start like a tutorial for beginners like me.

They are not XNA specific, but I don’t think that should matter. HLSL is not new, and it is a DirectX language – not C#.

One of them appears to be an excerpt from a book, and I don’t know how old or how relevant it is to DirectX 9’s HLSL.

Here are the links, on the off chance they prove useful…

There is also this one, but I find it goes too deep too quickly…

Average Rating: 5 out of 5 based on 194 user reviews.

Friday, September 15th, 2006

It’s been a while since I posted an update so here goes:

I’m in the process of converting my code over to use the XNA framework.  This has been pretty slow going I’m afraid.  Mainly because a little voice in my head keeps telling me “Just do it slacker, this’ll be easy”.  This was not the voice of Mr Common Sense - but I still listened to it, and the rest is history.

That’s not to say that XNA is harder than old-skool Managed DirectX that I was still a beginner at.  No, indeed it looks a whole lot easier in many ways.

The reason I’m finding things difficult is simply that I jumped in too deep from the start.  Instead of rattling off some simple “Hello World” apps, I chose to jump right in to the XNA sample game and extract from it’s architecture the nicest bits as a base for my rewritten game.  It’s not that difficult, so seemed sensible at the time. 

Here’s the catch.

In doing so I’ve spent more time getting to know someone else’s code, than learning the technology itself.  When you write code yourself it becomes ingrained in your brain.  When it’s someone else’s code, it simply takes time to become familiar with. No matter how good or well commented it is.

So that’s where I’m at.  I now have a nice base to work from, but it’s still very much back to square one.  I think I’m quite close to being able to render the Spitfire in the centre of the screen.  Kind of sad really.

The moral of the story?

“Little steps… LITTLE STEPS!!!”

Average Rating: 4.7 out of 5 based on 152 user reviews.