After a 6am start, hour or two on the trains and a gentle taxi ride through the rain, I arrive at Rare HQ, just outside the sleepy hamlet of Twycross. It's quite a long drive up the private road, and it's not overgrown hedgerow - it seems that Rare take a fair amount of pride in their grounds, and that when the weather is not "Rain III: Son of Rain: Vengeance," they're quite beautiful to behold.
I get into reception, and, before long, we discover that I'm not actually on the guest list. To my aid come Nick Burton and Kieran Connell - the gents in charge of it all - who fortunately know who I am thanks to previous correspondance. I am signed in and whisked away to the QA lab / mocap theatre / lecture hall.
After lounging around with tea and coffee (and biscuits!) for a half hour or so, we begin. Nick runs through a short powerpoint, runs through the safety procedures, points to our nearest exits, and introduces the various Rare staff that are hanging around the room ready to help us out. Most (I believe) are coders who were on Viva Pinata - once it finished they were given two or three weeks to play with XNA and create the demo games that we were given to look at.
The next couple of hours were freeform lab. CDs were passed around containing C# Express and the build of XNA Game Studio Express we'd be using for the day. After what seemed like an excessively drawn out install, I was away.
Naturally, the first thing I did was to try out the 360 connectivity. I loaded up the "Hello World" project the Rare guys had provided and set about getting it running on the 360. Here's how it all seems to work:
- Before you begin trying to get the software communicating, you need to network the 360 and PC together - specifically, they need to be on the same subnet, they still need Internet access, and firewalls need to permit uninterrupted data transfer between them. When you install GSE it adds the necessary exceptions to the Windows Firewall, but I had a few problems as I don't only use Windows Firewall.
- You run a mini-app on the Xbox360 called the 'XNA Game Launcher.' This is an app that you'll be able to download from Xbox Live Marketplace, though you also need to get an 'XNA Creators Club' subscription. I'm not quite sure how those two interweave - like maybe you can't run the Game Launcher without the subscription as well, or maybe you download the Game Launcher via the subscription... I dunno, it was preinstalled for us. What this does mean is that you need a storage device so that you've got something to download it to - I believe a hard disk is necessary. I speculated to one of the guys that maybe the launcher would fit on a memory stick, but I don't know whether that's a supported scenario.
- The XNA Game Launcher is a simple, three-button app:
- My XNA Games: Lets you choose from games that have already been deployed to your console. Yes, this means that you don't need to use your PC every time you want to play an XNA game - you only need to use the PC to deploy it once, and that copies it to the Xbox to be played whenever you want. I don't know what implications this has for transferring games between machines.
- Connect to Computer: Puts your 360 into 'Reciever' mode. This is how you begin a 360<->PC session; once the 360 is in this mode, you go to your PC and hit deploy/debug/whatever. Usefully, once you put it into this mode it seems to stay in it until you manually take it out again, so you don't need to reactivate it every time you run your game or anything like that.
- Settings: Not much here at the moment, other than your connection key. More on that in a minute.
- Hit 'Generate connection key.' The connection key seems primarily to be how your Xbox can be identified over the network. Unlike devkits, you don't ever give a retail 360 an identifying name - so when GSE goes looking, it doesn't know what to look for. The connection key serves partly as a way to solve that - you generate a key on the 360, then give it to your PC, which can broadcast a UDP message saying "Anyone out there with this key?" There's something deeper going on, though - possibly to do with encrypting the network connection between PC and 360? - as you can't re-view the key after accepting it, you have to generate a new one. So make sure you write it down. Oh, and be wary: I, 1, 0, and O all look verrrry similar on the Xbox display, at least on a regular TV. I suspect whoever tested that part of the system did so on a hi-def TV where the font is more readable. Is and 1s aren't so bad - the 1s have a little sticky-out bit near the top and the Is don't - but 0 and O are not so helpful. Be prepared to swap things around if you have trouble.
- Now that you've written down the connection key, hit 'Accept Key.' Careful, it's not the default selection option.
- Back out of the settings and go to 'Connect to Computer.' The 360 should ping Xbox Live briefly, then sit there waiting for a connection. You're done here for now; time to head over to your PC.
- Fire up Game Studio Express, if you didn't already have it open.
- Go to the 'Options' dialog in the Tools menu. Look for an 'XNA Game Studio' category on the left; if you don't see it, try ticking the 'Show All Settings' box at the bottom. If it's still not there, your install of GSE is broken.
- Open up 'XNA Game Studio' and choose 'Xbox 360' underneath it. You'll be presented with a list of all the 360s you've registered with your computer. Hit 'Add' to add the new one.
- Give the box a friendly name - it doesn't matter what you call it, it's just so you know which one it is in the list - and plug in the connection key.
- Hit OK, and close the Options dialog.
....phew! Not the simplest procedure in the world, but easier than flashing a Sony devkit. The two things that really need to be addressed above all are (a) the readability of the connection key and (b) there needs to be some way to 'test connection' from that Options dialog. It was a pain to set it all up and then not find out the key was wrong until closing it all and doing a deploy.
Anyway, once that's done, you're good to go. I load up one of the sample projects Rare provide, hit F5, and presto - it's running on the TV screen next to me, via the 360. I can debug quite happily - breakpoints, call stack, watch, output, all these things work as normal.
I play with the sample projects a bit, then have a crack at creating my own from scratch (using the 'Create an Xbox 360 Game' project templates that GSE ships with). In particular I wanted to see what it's like to play with some assets, as content is a much bigger issue than technology in any game of significant size.
I create a .DDS texture of a stickman - using DDS because I want transparency, but AFAIK you could use BMP if you want instead - and stick it in a 'Content' folder inside my project folder. Then, back in GSE, I turn on the 'show all files' button in the Solution Explorer, right-click the 'Content' folder and choose 'Include in Project.' That brings the Content folder, and the stickman.dds inside it, into my project. I hit build. The output window shows me that it's done some kind of processing to my DDS and deployed it to the Xbox as necessary... and now it seems that all I need to do to load my DDS as a texture is the following line of code:
Texture2D stickman = content.Load
And that's all. The 'content' object was generated by GSE for me. I think that's pretty cool.
A little while later we broke for lunch at Rare's cafeteria (being as they are in the middle of nowhere, going out for lunch would be a major undertaking). After a short conversation with Richard Geary, the chap who invited me up in the first place, and a slightly-subpar-but-hey bowl of beef stroganoff with rice, it's back to the lab to keep working on my little demo.
About half an hour after that, Nick grabs me and four others and takes us on a whirlwind tour of the studio. I'm not sure how much I can say about this part... beyond vague things like "Working conditions look nice." I certainly wouldn't mind working there.
Nothing much else happened. I didn't manage to get my demo working until about 4:30, and even then it's not worth showing off, so I won't bother. Went to the pub with Richard Geary at about 5 for a quick pint - sadly nobody else turned up - then headed home.
The main reasons I don't have much to show off in terms of my own demo:
- The XNA Framework needs more 2D math stuff. You're pretty well provided for if you're making a sprite-based game that uses bounding boxes for collision, but if you want to do vector math, forget it. My demo was going to be a 2D platformer that used geometrically-defined brushes as world primitives, but it took me too damn long to write the brush intersection and rendering code because I had to re-derive functions for doing things like finding the intersection point of two lines.
- There are no tools for diagnosing problems when you're working on the 360 other than the standard debugger. You don't get PIX, you don't get DirectX Extensions, you don't even seem to get a debug runtime to give you feedback. By comparison, the PC - where you have tools like PIXfW, even if it is a bit of a pain to use with XNA - is much easier to debug on. It seems like you want to avoid doing your development on the 360 where possible; stick to PC, then deploy to the 360 once you've got it working on the PC first.
Anyway, that's far too much text, so I'll stop now.