Luke’s Devblog

Protoplay London 2008 and XNA 360 Garbage

November 5, 2008 · Leave a Comment

I spent all day Tuesday and Wednesday this past week at the London Games festival.  I was there with the other participants of Dare to be Digital 2008 (and Owen), to recreate the glory that was Protoplay.  Unfortunately we were located inside Spitalfields market in the middle of winter, so frostbite did become a serious issue during the second day.  Despite this I think we still paid a notable tribute to the glory that is Protoplay. 

It was great seeing all the guys again and on the second day we managed to blag press passes to the Eurogamer and Games Careers fair.  It was the usual affair chatting with HR departments and a few developers.  I had a good chat with the Beatnik guys, they’re currently making the XNA based title PlainSight, and they very easily persuaded me to take part in the UK TIGJam which I’ve now got tickets for.  i also got my butt kicked on Street Fighter 4 (but it was close dammit!). 

Seeing people playing and enjoying Planet Panic! at protoplay, as well as having time over the past couple of months to distance myself from the project, I felt compelled to get the game further exposure.  A suitable method of doing so (and one that we had considered when choosing XNA as our framework) was to upload the game to the Xbox Community Arcade.  Now this should be easy due to the fact that the Xbox 360 supports XNA right?  Well no, not exactly.  I attempted to play it on the 360 and it ran absolutely terribly. During the Planet Panic initial development we chose to give priority to the platform we would be demonstrating the game on at Protoplay, which was the PC, therefore we had no idea of the performance (or lack of!) we were getting on the 360.  So all optimisations I have made have been retrospective.  The CLR that is used by XNA on both the PC and Xbox 360 uses a garbage collector.  When developing for the PC the garbage collections by the CLR aren’t noticeable, but on the 360 they can cause you to lose whole frames!

Garbage collection in the game wasn’t that bad before optimisation, as we were surprisingly stringent and recycled our objects often, with GC occurring roughly once every 10 seconds.  (This was established using the Xbox 360 performance monitor).

There are further unique limitations to using XNA on the 360 that must also be considered including a lack of function inlining and poor handling of floating points(!?).  However many of these features among others were far too ingrained in the project and were not going to come out very easily.  So to start with I made some more practical coding optimisations, that I’ll definitely continue to make in the future, not only in XNA but in all future projects (mostly in tight loops).  These included using LengthSquared() then squaring the radii, instead of Length() in bounding volume collisions, refraining from using operator overloads that can cause unnecessary overheads, as well as reducing the number of collision checks each frame.   Carrying out just these as well as other resource saving bits, has given the framerate a noticeable boost, making the game very much playable and smooth on the Xbox 360.

However my optimisation gusto has dropped significantly after finding out that due to only being in possession of a MSDNAA trial Creators Club licence and not the premium, I will not be able to publish the game on the community arcade.  Unfortunately I don’t have the funds available to splash out on the premium account at the moment, so all further optimisation have been put on hold to focus on my other projects.

Some XNA/360 optimisation links I’ve had in my tabs:

Where is the bottleneck?

Profiling tools (This blog is generally awesome)

Garbage Collecion

Categories: Uncategorized

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment