I'm just starting to teach myself C# and am looking for a project to get my teeth into. I've got a few game ideas floating about, so would I be mad to try to get to grips with XNA and C# at the same time ?
I should add that I'm a glorified code monkey for a living (C/C++/Java) and usually pick up things pretty quick. Although, I've done tons of Windows code I've little experience of DirectX, most of my game tinkerings have been with OpenGL upto now (although I'm not sure that's relevant ?).
If you know C++ already you shouldn't have any trouble at all.
The main thing you'll need to learn are the differences between C++ and C#, and they're pretty straightforward.
The real benefit though is the ease of getting game assets up and running with XNA. It's incredibly simple. I spent ages in C++ building a 3D game engine from a book, and writing a model format, and incorporating OpenAL, and failing to work up the chutzpah to ever tackle DirectInput properly. Within a couple of days of first using XNA I had a very rough 3D game, with both keyboard and gamepad input (with rumble on the pad) and a few sound effects. Things like fogging, which I wouldn't even know where to start in my old engine, I got working just by rooting around with the Intellisense system. It took 2 minutes from finding the function, to having a sickly purple haze enveloping the horizon. I didn't even want fog at the time, I just added it because I'd stumbled upon the functions.
It was quite galling really. I've got several nice-looking but unfinished projects written in C++, my own 3d model format, and some nice engine routines that are the results of a good few years work on and off, and I don't ever want to go near most of the stuff again because XNA is so much easier to use.
Mark wrote:If you know C++ already you shouldn't have any trouble at all.
The main thing you'll need to learn are the differences between C++ and C#, and they're pretty straightforward.
The real benefit though is the ease of getting game assets up and running with XNA. It's incredibly simple. I spent ages in C++ building a 3D game engine from a book, and writing a model format, and incorporating OpenAL, and failing to work up the chutzpah to ever tackle DirectInput properly. Within a couple of days of first using XNA I had a very rough 3D game, with both keyboard and gamepad input (with rumble on the pad) and a few sound effects. Things like fogging, which I wouldn't even know where to start in my old engine, I got working just by rooting around with the Intellisense system. It took 2 minutes from finding the function, to having a sickly purple haze enveloping the horizon. I didn't even want fog at the time, I just added it because I'd stumbled upon the functions.
It was quite galling really. I've got several nice-looking but unfinished projects written in C++, my own 3d model format, and some nice engine routines that are the results of a good few years work on and off, and I don't ever want to go near most of the stuff again because XNA is so much easier to use.
Just what I wanted to hear . I've done similarly in the past and just can't face doing it again. I've been using blitzmax recently for my tinkerings but this looks like a better idea even if I don't currently have a 360.
I take it the performance is good as I assume a lot of this is just a friendly veneer over native code ?
Go for it - It's really, really easy to get stuff up and running with XNA. I'm from an OpenGL background too and the Shader stuff was all new but you don't have to touch it directly if you just want to do simple (2d sprite based) stuff as they've handily created a BasicEffect class to hide it all.
The major difference you'll face coming from C++ is the value / reference datatypes and the GC. Reference types create garbage, value types (structs, most builts in types, enum) don't. The CLR profiler will tell you if you're creating too much.
My advice is jump right in and get coding. There are loads of samples already; even Rare have released some. And see the Benjamin Nitschke stuff (XNA Racer, Rocket Commander) at http://abi.exdream.com/
Performance-wise I haven't got any complaints so far - although most of the meshes I've been using are place-holder. I'd guess I've had a scene with approaching 100, 000 polygons in it without troubling it (but that's nothing these days).
A better indicator though is probably the Racing Games starter kit that you can get from the creators club site Paul linked to.
30 frames per second, 1080p (i think) post screen shaders, cross platform - lovely
I will counter all this enthusiasm with a couple of negatives.
Game content tends to be way bigger than it needs to be mostly due to the need to use wavs for all sound data. Probably not such a big deal with broadband.
You can share your games on Windows no probs but to simply just play XNA games on the 360 requires a Creator Club membership ($99 per year).
Your minimum spec GFX card need to support at least Shader Model 1.1.
Thanks for all the words of encouragement, I'll give it a shot. Looking at the XNA framework and demos has got me quite excited about coding something at home again
Muttley, I'm starting to work my way through "Essential C# 2.0" by Mark Michaelis, which was recommended to me from a couple of different sources. From what I've seen so far it's pretty good, and highlights similarities or differences between C++, Java and VB where appropriate.
30 frames per second, 1080p (i think) post screen shaders, cross platform - lovely
I will counter all this enthusiasm with a couple of negatives.
Game content tends to be way bigger than it needs to be mostly due to the need to use wavs for all sound data. Probably not such a big deal with broadband.
You can share your games on Windows no probs but to simply just play XNA games on the 360 requires a Creator Club membership ($99 per year).
Your minimum spec GFX card need to support at least Shader Model 1.1.
But none of the above are real showstoppers IMHO.
(PS - the MONO project are supporting XNA too)
Yes, I found a series of videos on YouTube of an interview with the XNA development manager Frank Savage http://www.youtube.com/watch?v=I4lzFcL4I6I. He has the racing game is running 30fps @ 1080p on the 360.
I downloaded the Racing Game project template earlier and it's running (in debug mode I hasten to add) at 60 - 100fps on my PC @ 1680 x 1050. Pretty damn impressive if you ask me.
Frank Savage was saying a shader model 1.1 card is a GeForce 3 and this thing can scale back to 640x480 if it needs to so older hardware should cope.
t0ne wrote:
Frank Savage was saying a shader model 1.1 card is a GeForce 3 and this thing can scale back to 640x480 if it needs to so older hardware should cope.
Isn't that a mistake?
MSDN - XNA Framework and XNA Game Studio Express wrote:
Q: Are there any prerequisites to run XNA Game Studio Express?
A: Yes. You must download and install Visual C# Express and the latest DirectX runtime updates (the full DirectX SDK is not required). Also, you need a Direct3D 9.0 video card capable of supporting at least Shader Model 1.1. Our recommendation is that your graphics card supports Shader Model 2.0 since many samples and starter kits require it. Check your graphics card manufacturer’s website for more information about your specific graphics card.
t0ne wrote:
Frank Savage was saying a shader model 1.1 card is a GeForce 3 and this thing can scale back to 640x480 if it needs to so older hardware should cope.
Isn't that a mistake?
MSDN - XNA Framework and XNA Game Studio Express wrote:
Q: Are there any prerequisites to run XNA Game Studio Express?
A: Yes. You must download and install Visual C# Express and the latest DirectX runtime updates (the full DirectX SDK is not required). Also, you need a Direct3D 9.0 video card capable of supporting at least Shader Model 1.1. Our recommendation is that your graphics card supports Shader Model 2.0 since many samples and starter kits require it. Check your graphics card manufacturer’s website for more information about your specific graphics card.
Hmmmm... yea, I was a little surprised when he said GeForce 3 and I'd forgotten the Direct X 9 requirement (I better go listen to it again in case I got it wrong)