XNA Game Studio / C#

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

vargonian
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 60
Joined: Fri Aug 07, 2009 3:34 pm

XNA Game Studio / C#

Post by vargonian »

Hi guys,

I'm just curious what you guys think about developing for the Xbox (or PC) with the XNA Game Studio Creator's Club. I am unapologetically a C# fanboy, and this is coming from someone who spent a decade writing in C++ prior to switching to .NET. There are just so many hassles that become non-issues when you switch to .NET, and the performance implications of using .NET are highly overrated. I'm just curious what your feelings are on the subject, from one game developer to another.
Image
User avatar
hurstshifter
ES Beta Backer
ES Beta Backer
Posts: 713
Joined: Mon Jun 08, 2009 8:33 pm
Favorite Gaming Platforms: SNES
Programming Language of Choice: C/++
Location: Boston, MA
Contact:

Re: XNA Game Studio / C#

Post by hurstshifter »

vargonian wrote:There are just so many hassles that become non-issues when you switch to .NET

how so?
"Time is an illusion. Lunchtime, doubly so."
http://www.thenerdnight.com
User avatar
trufun202
Game Developer
Game Developer
Posts: 1105
Joined: Sun Sep 21, 2008 12:27 am
Location: Dallas, TX
Contact:

Re: XNA Game Studio / C#

Post by trufun202 »

Overall, I'm a fan of C# and XNA development. It can be a bit rigid, but it get's the job done in most cases. And, with that said, I have no plans of moving away from C++ for other gaming projects.

The XNA Creators Club is helpful community, but getting a game approved for Xbox 360 can be pretty painful. There's a giant list of perceived "no-no's" for 360 games, and you have to clear that list before getting your approvals - regardless of your personal opinion on the matter.

Plus, you have to pay to release games on the 360 ($100 a year), so you'll have to make at least that much on your game to break even.
-Chris

YouTube | Twitter | Rad Raygun

“REAL ARTISTS SHIP” - Steve Jobs
vargonian
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 60
Joined: Fri Aug 07, 2009 3:34 pm

Re: XNA Game Studio / C#

Post by vargonian »

hurstshifter wrote:
vargonian wrote:There are just so many hassles that become non-issues when you switch to .NET

how so?
Well, to name a few (sorry if I sound like a commercial):

1. Memory Management
You no longer have to worry about leaking memory since you've got garbage collection. If your objects are no longer being used by anything, they get deleted. (To be pedantic, technically you can still leak memory but you'd have to try really hard.)

2. Headers/implementation file hell
As an experienced C/C++ developer, I've gotten used to dealing with header/implementation files so it isn't as big of an issue anymore, but this drove me nuts when I was newer. You don't have to worry about the order in which you include .h files or worry about what should go in a header file versus an implementation file. In C it's typical to have an "extern'd" constant in a header file, and the actual definition in the implementation file, for example. C# does away with header files altogether; everything gets defined in the .cs file. You no longer get into header hell.

3. Less awkward naming conventions
In other languages it's common to see class names prefixed with letters (beyond just Hungarian notation) to distinguish them from similar classes, when ultimately it just makes the code more difficult to read. For example, I've been doing iPhone development recently and I see a lot of "NSString", "CFDictionary", etc. While nobody's stopping you from doing that in C#, you don't need to because namespaces easily resolve ambiguity. Granted, C++ has namespaces as well... I'm just contrasting this with other languages.

4. First-class debugger/IDE support with Visual Studio
If you've ever used Visual Studio to debug/write C++ programs versus .NET ones, you'll see what I mean. While it's still great for debugging C++ apps, you've got much fewer incidents of call stack corruption and other issues which make tracing your program flow more difficult. Intellisense works more reliably as well.

5. A powerful framework class library
The libraries which ship with .NET are probably the best I've ever seen in any language as far as functionality and ease of use. Using a generic Dictionary versus an STL hash map (for example) is much easier. The same applies to any Collection class for that matter. There are also tons of convenience methods in classes like String.Contains, String.StartsWith, String.Replace, etc.


I know I'm leaving out a ton of stuff like LINQ, events, etc. Really, I'd be hard pressed to find a good reason not to use C# if you're targetting the Windows/Xbox platform for smaller indie games (obviously if I'm making Farcry 3 I'd use a lower level language).
Image
Panama
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 21
Joined: Fri Jun 05, 2009 12:37 pm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++ and C#
Location: Great Britain, although I don't understand what's so great about it

Re: XNA Game Studio / C#

Post by Panama »

Ive used XNA and C# in the past to make little games. C# is definately nicer to use than C++ for the reasons you've listed above but I never really felt right when I was using XNA, there's something about DirectX which i just prefer.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: XNA Game Studio / C#

Post by Falco Girgis »

I'm not interested. Not because of anything against C# or XNA, but because I find myself extremely attracted to the computer science and engineering part of game development. I want to work at a low level, I want to write my own collision algorithms, I want to learn physics to write my own physics libraries. My lust for knowledge is one of the things that has kept me going on ES, and I feel like I would be missing out on my favorite part of the development process with something like XNA.
vargonian
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 60
Joined: Fri Aug 07, 2009 3:34 pm

Re: XNA Game Studio / C#

Post by vargonian »

GyroVorbis wrote:I'm not interested. Not because of anything against C# or XNA, but because I find myself extremely attracted to the computer science and engineering part of game development. I want to work at a low level, I want to write my own collision algorithms, I want to learn physics to write my own physics libraries. My lust for knowledge is one of the things that has kept me going on ES, and I feel like I would be missing out on my favorite part of the development process with something like XNA.
Yeah, XNA Game Studio development can hide some of the underlying hardware details from you, but it certainly doesn't hide all of them. You still write shaders from scratch (unless you use the simple ones they set up for you), deal with collision/matrices/physics/AI/etc. all on your own. The XNA libraries do have a lot of collision/intersection/vector/matrix classes which can make life easier for you but there's no requirement to use them. You definitely have to write your own physics libraries, etc. It just handles (in my opinion) the more annoying, repetitive details for you, like the low-level details of loading textures/models, matrix operations, memory management, and that sort of thing. But again, you could still do any of these manually if you really wanted to.

If anything I just want to break any possible misconception that using XNA Game Studio is akin to using a program like RPGMaker, or even that XNA is a "game engine", which it isn't (or if it is, it's horribly lacking in typical game engine features). I don't mean to sound like a Jehovah's Witness trying to convert you. I've developed 12 published titles in C++ and I certainly have a lot of love for the language.
Image
User avatar
davidthefat
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 529
Joined: Mon Nov 10, 2008 3:51 pm
Current Project: Fully Autonomous Robot
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: California
Contact:

Re: XNA Game Studio / C#

Post by davidthefat »

Its a good start on your portfolio to put in your resume to develop and publish your own game
wearymemory
Chaos Rift Junior
Chaos Rift Junior
Posts: 209
Joined: Thu Feb 12, 2009 8:46 pm

Re: XNA Game Studio / C#

Post by wearymemory »

davidthefat wrote:Its a good start on your portfolio to put in your resume to develop and publish your own game
Some of that Golden knowledge from ya there, bub!
Last edited by wearymemory on Mon Aug 10, 2009 11:04 pm, edited 2 times in total.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: XNA Game Studio / C#

Post by Falco Girgis »

davidthefat wrote:Its a good start on your portfolio to put in your resume to develop and publish your own game
. . .
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: XNA Game Studio / C#

Post by dandymcgee »

GyroVorbis wrote:
davidthefat wrote:Its a good start on your portfolio to put in your resume to develop and publish your own game
. . .
It's okay. The drunken grammar threw me off for a second too.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
ibly31
Chaos Rift Junior
Chaos Rift Junior
Posts: 312
Joined: Thu Feb 19, 2009 8:47 pm
Current Project: Like... seven different ones
Favorite Gaming Platforms: Xbox 360, Gamecube
Programming Language of Choice: C++, ObjC
Location: New Jersey.

Re: XNA Game Studio / C#

Post by ibly31 »

davidthefat wrote:Its a good start on your portfolio to put in your resume to develop and publish your own game
Seriously, WTF is he talking about?
Last edited by ibly31 on Tue Aug 11, 2009 4:45 pm, edited 1 time in total.
Image
Twitter
Website/Tumblr
My Projects

The best thing about UDP jokes is that I don’t care if you get them or not.
tendencydriven
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 3
Joined: Fri Aug 07, 2009 1:01 pm

Re: XNA Game Studio / C#

Post by tendencydriven »

I have used C# on and off for about two years now and I have no problem whatsoever with the language. Granted, I have only used it for non-game applications.

As for making games for the XBox, why not? Give it a shot, see what you think.
zNelson24
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 39
Joined: Tue May 12, 2009 5:15 pm
Current Project: School assignments.
Favorite Gaming Platforms: PC, Xbox 360
Programming Language of Choice: C#, BASIC

Re: XNA Game Studio / C#

Post by zNelson24 »

I have been using XNA for a while (PONG Clone and experiments). Nice way to make games, and from what I've heard C# and C++ are somewhat similar languages. I have considered learning the industry standard C++ along the road once I have C# down (and learn all the concepts of proramming along the way).
-zNelson24

Image
Image
Image
Image
User avatar
captjack
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 50
Joined: Fri Sep 18, 2009 4:23 pm
Current Project: engine framework
Favorite Gaming Platforms: PC, XBox 360, PS3
Programming Language of Choice: C, C++
Location: Northern Virginia

Re: XNA Game Studio / C#

Post by captjack »

vargonian wrote:The XNA libraries do have a lot of collision/intersection/vector/matrix classes which can make life easier for you but there's no requirement to use them. You definitely have to write your own physics libraries, etc. It just handles (in my opinion) the more annoying, repetitive details for you, like the low-level details of loading textures/models, matrix operations, memory management, and that sort of thing. But again, you could still do any of these manually if you really wanted to.
The libraries are included so you don't have to do all that rewriting. If you're having to rewrite the libraries then they weren't that good in the first place, in which case XNA would suck. Software reuse means a lot. For those who have no desire (or the technical understanding) of how a traditional game engine is developed, then XNA would be ideal. I see it as a huge wrapper around "the complicated stuff" - a RAD tool if you will. It certainly has it's place, and I might recommend it to some folks who "have no clue". That is to say, if I've never programmed a lick of C++ and DirectX/OpenGL/SDL/etc, then I'm far better off trying to learn C# and use XNA - the learning curve is much smoother and I can get a game out more quickly. With DirectX I have to make all the initializations and so on to get the thing ready (determine device types and adapter counts and which rendering pipeline to use...) XNA wraps all that in a few nice function calls.

My biggest beef, though, is the nature of C#. I don't care for a proprietary language. I don't see a reason to have what seems to be C++ done Microsoft's way. It's yet another language to learn and I don't have the time. I spent all that time getting proficient at C++. If my employer needs me to crank out C# code it's easier for me to quit and get another gig. :) I also find C++/CLR (aka managed C++) a kludge to band-aid the flaws in Windows, but that's a different story.

I think the $100 a year to publish on XBox live is a glass ceiling to keep crap out of the pipeline. What really torques me is that to be a serious XBox developer you have to have the commercial SDK - and that thing is more guarded than the Crown Jewels. One has to be a large game studio to get that thing. (Anyone know about a PS3 SDK??)

-capt jack
Post Reply