Sign in to follow this  
d33ts

starting with xna

Recommended Posts

d33ts    124
I'm starting to get back into game dev, since I'm becoming disillusioned with the majority of the current gen of games. Back in the day, the most I ever did was some simple, tic tac toe type stuff using C++ and SDL though. I never was really able to get into intense graphics based stuff, and I doubt I would even have been able to make a mario clone. I struggled at one point to try to get an animation system working, but I don't remember if I ever completed it. I'm thinking of starting with XNA though. As far as I've seen, C# is supposed to be a much easier language. My question, though, is - do you think I would be able to handle making a 3d or even 2d game using XNA and C# on my own, given my previous level of experience and ability?

Share this post


Link to post
Share on other sites
BLiTZWiNG    361
Absolutely.

C# is fairly easy compared to C++ even though it is a very similar language (hence the name), but you don't have to deal with messy pointers and all those #define's (I'll stop there before I start a flame war). XNA has some built in shaders to do the basics of 2D and 3D rendering for you (some texturing and lighting), it's quite possible to get a simple game going in a few lines of code.

Check it out at http://creators.xna.com/

Share this post


Link to post
Share on other sites
Armadon    1091
Ofcourse,
The thing to remember is that learning a new API and a language might be difficult. It's always good to start off with a language that you are already familiar with as it eliminates the frustration of having to deal with errors from both the API and the language.

If you are familiar /proficient with C++, try C++/CLI, if you hated all the crazy pointers, you could make the move to C# easily as the syntax is pretty much the same.

Share this post


Link to post
Share on other sites
YoYoFreakCJ    100
XNA is really userfriendly. When I started with game programming, I used Basic-languages like QuickBasic, and for a few days BlitzBasic. Then there was nothing for about 3 or 4 years, until I started learning C++ and C#. XNA is like a giant sandbox, that's how easy it is. You load an image file, and draw it on the screen, with less then 5 lines. Drawing a 3D model on the screen takes some more lines [about 15], and the maths aren't to be underestimated. But you'll get the hang of it pretty fast.

I'm close to finishing an animation editor. I had nearly no real experience in gamedev before that [I only made a few really simple and small tile games with QB and BB], and in less than a year I was able to import a model, add my own animation structure to it, save it, load it, and play the animation. XNA is really easy to learn.

XNA is like a wrapper around DirectX. And given the current XNA framework, you can do almost anything you want, from very basic functions to the advanced stuff. I would suggest that you just try out XNA and do a simple tutorial. You will be amazed how fast you will see your first results.

Share this post


Link to post
Share on other sites
As the others mentioned, XNA is extremely fine-tuned in order to accomodate hobbyist and new game developers. If you were looking into learning some basic C# and get a basic XNA 'game' working I'd say you could finish that in 2 weeks with a good understanding of basic C# and XNA with only a few hours of programming a day.

I personally kind of new C# when I went to XNA (needed a bit of a refresher and didn't know some more advanced techniques) and I ended up building a full game (including doing all the artwork) and writing a series of tutorials on 3D in XNA.

I would say your biggest hurdle, as with most game projects, is the art/music assets to get into the game. But, simply from a programming stance of building some kind of engine it could be done relatively fast.

As Blitzwing mentioned, check out XNA Creators Club.

I'd also suggest simply reading over tutorials and seeing if you can relate some of the code with what you know in the hopes of finding some kind of common ground you can work with.

You can find lots of resources online including:
Ziggyware.com
XNA-Development
XNA-Resources
My XNA Tutorials (sorry, shameless self-promotion)

Share this post


Link to post
Share on other sites
d33ts    124
Well, from looking around at tutorials and things like that, it definitely looks like something I can handle. Looks much easier than C++/SDL like before, and it seems to place much more of a focus on programming the actual game logic since the graphics part is much easier.

Hopefully I can get started with it soon, looking forward to making some games now. Do I have to pay to start making stuff, or can I just start developing on my computer? Btw I have a wired xbox 360 controller, which plugs into a USB port, so I can use that on my computer.

Share this post


Link to post
Share on other sites
You can start developing on your PC for free. Currently all development using XNA and targetting the PC platform is free. And as long as you have the drivers for the controller you can program that.

To create games and such for the Xbox 360 you'll need a membership to the Creators Club. I believe currently it's $99 for a 1-year membership or $49.99 for 4 months. Though, you can find trial memberships online in certain places, the most notable being Dreamspark.

I biggest difference programming wise between PC and Xbox is essentially the hardware the Xbox uses. Also, you won't have access to certain built-in XNA libraries on the Xbox.

I'd suggest simply developing for PC when you start so you get a good handle on XNA and don't have to pay (unless you are a student and Dreamspark is available to you).

Share this post


Link to post
Share on other sites
d33ts    124
What would be the best way to learn C#, given that I remember C++ pretty well? All the xna learning stuff out there seems to assume knowledge of C#.

Also, would you recommend buying an actual book, and reading that to learn xna, or will reading miscellaneous tutorials online be good enough?

Share this post


Link to post
Share on other sites
YoYoFreakCJ    100
Try http://riemers.net. He's got some really fine tutorials with step-by-step explaining. He handles 2D and 3D development. He helped me out really much when I started XNA.
Since you know C++, you should get the hang of C# pretty fast. Change -> to . and forget about pointers. You don't have to worry about ressource freeing, since the garbage collector gives you a hand, and he's doing a great job.

I used managed C++, and I got into C# perfectly fine.
System::Console->WriteLine("Hello World");
becomes
System.Console.WriteLine("Hello World");
#include is not used at all in C#, you're just adding references and use them by writing
using System;
using System.IO;
etc

You will see that it's a piece of cake.

Share this post


Link to post
Share on other sites
MichaBen    481
Quote:
Looks much easier than C++/SDL like before, and it seems to place much more of a focus on programming the actual game logic since the graphics part is much easier.

If you want to get straight into programming game logic, I would advice to use a rendering engine instead. I have used OGRE in the past, with just about 50 lines of code (in my case C++) you are ready to go. Using the scene manager you can load objects into the scene with just 3 lines of code, and with a few more lines you can move them around or play animations. This way you can get started on game logic almost instantly, while you are still learning how 3D graphics work, making it easier when in the future decide to make your own engine.


Making your own engine always takes time and is complicated, no matter what language you are using. I wouldn't pay to much attention to those "this language is easier" discussions, it's what they said years back in programming class in school about Java, and 85% failed at the second test. IMO, the book, tutorial, teacher or whatever is going to learn to using the language is of much bigger influence then the choice of language. Some languages might be a bit easier then others, but just about any language can be screwed up without a good guide. When talking about more intense graphics based stuff, then you will need to learn shaders which have their own languages.

Share this post


Link to post
Share on other sites
d33ts    124
I've been thinking about aspects of game development a lot in the last couple days since I've decided to get back into it, and I'm realizing I have no idea how to do most basic things. For example, I know the basic idea of collision detection via bounding spheres/boxes, but I have no idea how to cut down the number of collision tests so that you're not testing every possible combination of objects for collisions, only close ones. Things like that.

Share this post


Link to post
Share on other sites
MichaBen    481
Perhaps you should take a look at a open source physics engine to see how it's done. I haven't got much experience with it myself, I used ODE for a bit last year but physics were eventually cut from the game (wasn't really required for the type of game, so we concentrated more on AI movement) so I didn't use much of it. But what I saw of it was pretty nice, and I think by using a physics engine you should get an idea how it works, and then you can just look at the code to see how the actual implementation is (in case of an open source physics engine that is).

Share this post


Link to post
Share on other sites
daviangel    604
Quote:
Original post by d33ts
I've been thinking about aspects of game development a lot in the last couple days since I've decided to get back into it, and I'm realizing I have no idea how to do most basic things. For example, I know the basic idea of collision detection via bounding spheres/boxes, but I have no idea how to cut down the number of collision tests so that you're not testing every possible combination of objects for collisions, only close ones. Things like that.

Funny you asked since Microsoft actually has a whole series of tutorials on that on the XNA website:
Collision Series 1: 2D Rectangle Collision
Microsoft really really wants to see XNA succeed as you can see all the money they are pouring into all the various tutorials/updates to XNA. They never did that for managed dx:(

Share this post


Link to post
Share on other sites
d33ts    124
So what would be the benefits/drawbacks of using XNA rather than a prebuilt game engine like ogre or irrlicht?

Share this post


Link to post
Share on other sites
iko    100
One really cool thing about XNA is that you can develop games for Windows, but also deploy those games to your Xbox 360 or even Zune. I'm pretty sure it's the only language that can do that (besides what professional game developers use). I'f you're making a 2D game, XNA is one of the easiest languages to use; it handles creating a window / graphics device and all that tedious stuff needed for C++ DirectX and lets you concentrate more on the actual game. I still haven't quite gotten the hang of 3D XNA yet though...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this