Sign in to follow this  

Quick XNA question

This topic is 3042 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone! I recently got back into programming and game development and was really excited to find out about XNA. But one thing confuses me: all the XNA websites I've seen, both Microsoft's and third-party ones, somehow always end up mentioning Xbox 360... What I mean, I've yet to find a game or even an example, a demo, that's PC-related. All of them are to be played on an Xbox... Can XNA be used to write proper PC games? No fancy stuff like Xbox and whatnot? I just want to write PC games and share them with other people, can I do that with XNA? Thanks in advance!!!!

Share this post


Link to post
Share on other sites
Short answer: Yes.

Just watch the beginners 2d and 3d tutorials on the XNA creators club site. They incorporate both windows and xbox functionality in the sample game.

Edit: Here is the link. http://creators.xna.com/en-US/education/gettingstarted

Share this post


Link to post
Share on other sites
Thank you! That was quick =)

But come think of it... Wouldn't the input mechanism (ie controls) be the only difference between the Xbox and the PC build, since XNA is supposedly cross-platform, which means no tinkering in the code to run a game on either PC or Xbox, right?.. Other than that, there shouldn't be much difference, programming-wise, or not?

Share this post


Link to post
Share on other sites
For the most part, yes that is true. I wrote an Xbox 360 game which runs perfectly find on the PC with minimal code changes. Although, it wasn't intended to ever actually be released on the PC, so I have to connect an Xbox 360 controller to my PC to actually play it.

This property makes it really easy and convenient to playtest and debug XNA games, not to mention it's a lot easier to capture videos/screenshots for promotional materials.

Share this post


Link to post
Share on other sites
Quote:
Original post by Utko
Thank you! That was quick =)

But come think of it... Wouldn't the input mechanism (ie controls) be the only difference between the Xbox and the PC build, since XNA is supposedly cross-platform, which means no tinkering in the code to run a game on either PC or Xbox, right?.. Other than that, there shouldn't be much difference, programming-wise, or not?


The 360 graphics chip has it's own set of capabilities, which are listed in a chart in the docs. The 360 runs the games through the .net compact framework, which has it's own bottlenecks, like running GC after every 1 meg of garbage, and having slower floating point performance.

You have to make sure only to use the parts of .net compatible with the compact framework, and write your code in an XBox friendly way. The GC on the PC .net runtime is a lot more forgiving then the 360's.

But that's easy, since coding with the 360 in mind works just as well on the PC. You just have to be careful to allocate what you want upfront and use pooling and other techniques, so you don't generate tons of garbage.

To be able to distribute your game on the 360, it has to be checked through peer review to make sure it confirms to the tech requirements (title safe area, storage devices, sign ins, any controller can play, etc...) and doesn't have any prohibited content.

There is no mouse support on the 360.

There is no XBL avatar support on the PC.

A good 360 game will realize that a TV is not a monitor, and design for it accordingly. That means minding the safe areas, not using 1 pixel tall lines on an interlaced display, and realizing that the user is not sitting a few inches away form the screen, but upwards of 10 feet.

360 games have a size limit of 2GB locally, and 150mb (highly compressed) on the indie games shop.

Quote:
This property makes it really easy and convenient to playtest and debug XNA games, not to mention it's a lot easier to capture videos/screenshots for promotional materials.
You can pull screenshots directly off the 360 if you launch it through connect in Debug mode. Right click on the xbox in the device center and select screenshot!

Share this post


Link to post
Share on other sites
Thanks for all the replies! Very much appreciated!

But I want to clear something up: I am NOT even considering making Xbox games whatsoever, at this point, at least. All I want is to make PC games, Windows, specifically. So is XNA good enough for that? Seeing as MDX has been scrapped and the documentation for SlimDX (is that what's it called?) is... well, weird, at the very least, what other options besides XNA do I have? Or is XNA a true, good enough, graphics library on its own? Cause to me it seems by the way Microsoft is positioning it, is that XNA is something like Game Maker, a fun tool for newbies (such as myself) to make computer games. That is not what I want. So, for example, can an engine be written in XNA + C#? Or is XNA already an engine? Can I actually work on, and control, the graphical aspect to a reasonable degree? Or do I just draw a bunch of sprites, create a game design and let XNA do the rest? Could someone please clear this up? I don't want to waste my time on a Game Maker-like thingy. To me it's purely educational, I don't want to release or publish a specific game (so I don't care about all this XboxLive etc. stuff at all( and do not necessarily need the fastest and most hassle-free technology to do that. I want to use 3D graphics with C#, for myself, to learn, because I do like C# a lot. So is XNA like OpenGL/DirectX or is it something different? Am I better off diving into good ol' C++, then? I have the Beginning OpenGL game programming book by Dave Astle, and even though that's very complicated, I'd rather spend my time on something like that, than just play with a fun tool like XNA. Or am I wrong? Please explain =)

Share this post


Link to post
Share on other sites
I'm no expert, but I might be able to help answer some of your questions. XNA is not an engine itself, it's more like a collection of libraries I guess. It is similar to say OpenGL or DirectX, except basic things like constructing a window, etc. are much more simplified and pretty much done for you. It is possible to create industry quality games, both 2D and 3D, using XNA. Would you be able to create games that rival the best ones created in C++? I don't know. Maybe with a full team it would be possible, but I'll leave that to someone else to answer. Does XNA allow you to create innovative games that would not be possible with Gamemaker or another similar program? Yeah, I think so.

Share this post


Link to post
Share on other sites
Short answer, yes XNA is for you.

Long answer, XNA is a directX wrapper. It simplifies a lot of things that otherwise would require a lot of time and effort on the programmers part to implement. On the other hand it lets you get down and dirty with the very basics if you want.

XNA allows you to make a simple 3D game using basic effects in very little time at all. If however you want something better and want a deeper learning experience it lets you write your own shaders and everything else.

That's not to say writing a good game is easy in XNA. You still need to know how to structure a program properly and that usually comes from experience. To write a good engine in XNA will take a lot of time and a lot of research. Once you get past the window generation and various helpful structs and classes XNA provides the deep dirty work of your engine will be exactly the same as if you wrote it in C++. By that I mean your various culling techniques, rendering techniques, grouping, collision and everything else are all up to you to write.

XNA just provides a lot of the basic building blocks for you to start with and it also let's you work in VS and C# which are by far (imho) the easiest and quickest language and IDE to work with.

Share this post


Link to post
Share on other sites
Quote:
Original post by Utko
Thanks for all the replies! Very much appreciated!

But I want to clear something up: I am NOT even considering making Xbox games whatsoever, at this point, at least. All I want is to make PC games, Windows, specifically. So is XNA good enough for that? Seeing as MDX has been scrapped and the documentation for SlimDX (is that what's it called?) is... well, weird, at the very least, what other options besides XNA do I have? Or is XNA a true, good enough, graphics library on its own? Cause to me it seems by the way Microsoft is positioning it, is that XNA is something like Game Maker, a fun tool for newbies (such as myself) to make computer games. That is not what I want. So, for example, can an engine be written in XNA + C#? Or is XNA already an engine? Can I actually work on, and control, the graphical aspect to a reasonable degree? Or do I just draw a bunch of sprites, create a game design and let XNA do the rest? Could someone please clear this up? I don't want to waste my time on a Game Maker-like thingy. To me it's purely educational, I don't want to release or publish a specific game (so I don't care about all this XboxLive etc. stuff at all( and do not necessarily need the fastest and most hassle-free technology to do that. I want to use 3D graphics with C#, for myself, to learn, because I do like C# a lot. So is XNA like OpenGL/DirectX or is it something different? Am I better off diving into good ol' C++, then? I have the Beginning OpenGL game programming book by Dave Astle, and even though that's very complicated, I'd rather spend my time on something like that, than just play with a fun tool like XNA. Or am I wrong? Please explain =)


XNA GS is a thin wrapper around D3D9, + some helper classes. After that, it doesn't do much else for you, and you are on your own. It's no different than just programming using C++ and D3D9, except that you have C# as a quick and easy language.

It also new project templates. The default game template does all the initializing for you, and takes care of pumping out the update and draw calls. SO you go immediately into working on your game. Very convenient.

Share this post


Link to post
Share on other sites
Quote:
Original post by Daaark
XNA GS is a thin wrapper around D3D9, + some helper classes. After that, it doesn't do much else for you, and you are on your own. It's no different than just programming using C++ and D3D9, except that you have C# as a quick and easy language.

That makes it sound like there's not that much to it. The Content Pipeline alone is a significant amount of code that you no longer have to write. The XNA Framework is pretty huge; not just "some helper classes".

Quote:
Original post by Daaark
It also new project templates. The default game template does all the initializing for you, and takes care of pumping out the update and draw calls. SO you go immediately into working on your game. Very convenient.

This is a big time savings. It also means less code that you could potentially screw up, which means less time fixing problems and more time writing code.

Share this post


Link to post
Share on other sites
So I will not be limited by XNA whatsoever? It's a full-fledged graphics library, not some play-tool for teens, right? So I can potentially in a number of years write a decent 3D game if I start learning it now? And what are Microsoft's plans for it? How does it position XNA? Is it like an alternative to MDX? Like DirectX for .NET?

Share this post


Link to post
Share on other sites
While on the surface XNA can appear to be a "play-tool for teens" (it did to me when I first found out about it) once you start using the library you'll see that it really is a fully functional set of libraries usable for writing both hobby and professional games.

XNA is mostly focused on the Xbox, but the whole library still works on the PC (besides avatars, obviously). Xbox integration is what microsoft charges for, so if you don't need it you can use XNA for free.

The Xbox integration is a problem for those who want to use XNA on the PC, since it keeps the XNA team from implementing any DirectX libraries that don't work on the Xbox. This means no DirectX 10, 11, etc. for the foreseeable future.

You can certainly share XNA games with other people- visual studio will even build an installer for you. One issue might be the shader model- XNA only supports 2.0 or higher, and there is no fixed function pipeline at all. This means that everything you do requires a shader, and anyone who doesn't have 2.0 can't play your games.

Personally I view XNA as a short-term solution, unless you want to use it with the Xbox. I started using DirectX with XNA and have since moved on to SlimDX. SlimDX is much more true to the original DirectX libraries, and it implements many more libraries than XNA since they aren't held back by Xbox support. Some people even mix SlimDX with XNA- they use XNA for as much as possible since it is simple and documented, and they use SlimDX whenever XNA doesn't have something they need.

I think you should definitely use XNA for now, and later move on to SlimDX if you need more features. XNA was a very easy start for me with all of its documentation. And who knows- the XNA team might decide to integrate the missing features after all.

I hope I answered all of your questions. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Utko
All of them are to be played on an Xbox... Can XNA be used to write proper PC games? No fancy stuff like Xbox and whatnot? I just want to write PC games and share them with other people, can I do that with XNA?

Thanks in advance!!!!


Yes,
You must know that first and foremost, the XNA - Game Studio is an XBOX 360 SDK.
With XNA, you can pretty much

Share this post


Link to post
Share on other sites
Quote:
Original post by wingbird101
XNA is mostly focused on the Xbox, but the whole library still works on the PC (besides avatars, obviously).

And networking. You have to roll your own networking on the PC, but there's libraries available (Lidgren being one).

Share this post


Link to post
Share on other sites

This topic is 3042 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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