C#, C++, Game Programming?

Status
Not open for further replies.
OK, people, I've got a few questions to throw your way.

First of all, I have taken an introduction to C++ course in college (2 semesters ago) and also read a book and wrote a few small apps with C# (last semester). Therefore, I have working knowledge on both languages, but I've never entered the wonderful world of pointers, linked lists, or binary trees. I do however, have a fairly good grip on OO techniques, but not mastery. I have also programmed in VB6 for a year in my job and would call myself an intermediate VB programmer.

With the summer upon me (no class!) and my having some extra time after work to blow, I'm interested in learning some game programming skills, primarily DirectX. I don't necessarily have any goal to become the next Carmack or anything like that (mostly because I couldn't do that) but I'd like to be able to make a standard side-scrolling platform game or a small RPG, etc.

Furthermore, I think it would be pretty cool to make some games for the PocketPC 2002 platform.

With these targets in mind, what do you guys suggest I pursue? Should I pick up an intermediate C++ book and dig in to pointers, linked lists, and binary trees, then dive head-long into DirectX and COM? Or should I pick up some of the DirectX wrappers for .NET and start playing around with it in .NET?

Furthermore, which one of these two languages would most easily transition to PocketPC 2002 development? I know that C++ is "the language" when it comes to game programming, but does anybody think .NET will change this? I'm most interested in the PPC platform, because I think people might actually PLAY 2D side-scrollers on hand-helds still, and I'd ultimately like to offer anything I make to people via the 'net.

Lastly, if your suggestions are to go with C++, should I use C++.NET or learn on a "vanilla" C++ compiler such as VS C++ 6 or Borland?

Thanks for your input!
 

svdsinner

Ars Legatus Legionis
15,152
Subscriptor
The reason that C++ is the language of choice is performance. All other .NET languages produce "managed code." That means that they are compiled to an intermediate langauge and then interpreted at run time. You have little control over garbage collection, and your performance will be slightly reduced.

If your app needs that extra 5-10% performance boost and/or can't afford to have the game slow/pause during a random garbage collection, then C++ is your only option. If you can live with mildly reduced performance and possible random pausing for GC, then you can program in any .NET lanquage you want (C#, VB.NET, whatever)

Good luck
 

mauerj

Wise, Aged Ars Veteran
121
"interpreted at run time" isn't accurate. Managed code passes through a just-in-time compiler the first time; subsequent passes run as native code.

The GC could be a factor if you're creating (and discarding) a lot of objects. By recycling objects, you can avoid GC hits and improve performance from less object overhead.

A managed language should perform just fine for what you're trying to do. People have written side-scrollers with Python, Java, and other "non-game" languages... svdskinner is correct in that going the managed route will be somewhat slower than fully native C/C++, but it should be fast enough to get the job done.

The big issue right now for game programming in .NET is the lack of a managed API for DirectX. There is an API for VB with DX7 and DX8, but there are issues in using interop from .NET to talk to it. DirectX 9 will have a managed API for .NET, which should be hitting beta sometime later this month.
 
Gas Powered Games is releasing all of the development tools for Dungeon Siege. Terrain and objects can be editied with it, and behaviours and AI can be created with a custom C-based scripting language they call Skrit. Check out game-editing.net if you're interested. I know this isn't exactly what you said you wanted, but in a couple hours a night after work, with this you could actually have a finished game by the end of summer.
 
If your really interested in pocketPC development for games and such, I'd recommend you go to www.microsoft.com/mobile click on the developer link and download the eVisual tools 2000sdk, the 2002sdk, a emulator image, and the eC++ 4.0 (all free downloads).

That way you can install them and start developing applications (learning to develop applications) even without owning a pocketPC.

fyi:
-The eVisual tools sdk is ~300meg and provides the base development enviroment for the pocketPC2000.
-The 2002sdk is ~60meg and lets you develop for the pocketPC2002's.
-The emulator image lets you run a emulated pocketPC2002 device on your computer.
-The eC++ embedded C++ 4.0 is a update to the eC++ 3.0 found in the first package.

You will need to get all the above to have a fully working development enviroment.
 

splicer

Ars Tribunus Militum
2,135
Originally posted by kbaugh:

...but I've never entered the wonderful world of pointers, linked lists, or binary trees. I do however, have a fairly good grip on OO techniques, but not mastery. I have also programmed in VB6 for a year in my job and would call myself an intermediate VB programmer.

If you can't make a linked list in C++ then you don't know C++. It's not that you have to (or should) make linked lists that often -- it's the fact that if you understand pointers and memory allocation a linked list should be easy. You should know about binary trees and it might be good practice but you will seldom run into a situation you can't handle without them.

Concentrate on learning the basics of C++ and maybe work on game ideas in VB or C#.


Furthermore, which one of these two languages would most easily transition to PocketPC 2002 development? I know that C++ is "the language" when it comes to game programming, but does anybody think .NET will change this? I'm most interested in the PPC platform, because I think people might actually PLAY 2D side-scrollers on hand-helds still, and I'd ultimately like to offer anything I make to people via the 'net.
I don't see realtime professional-quality games being programmed in any language that mandates garbage collection anytime soon. However I think you should be fine using C# to start with. PocketPC is a problem because the processors aren't even as fast as a 486 of the same clock speed. You might run into perf issues.



Lastly, if your suggestions are to go with C++, should I use C++.NET or learn on a "vanilla" C++ compiler such as VS C++ 6 or Borland?
VC.net is a perfectly good 'vanilla' compiler
 
Thanks for all the great input!

I've always felt a little inadequate when it comes to C++, so I think I might as well go along and try to learn pointers, linked lists and all that. The game development will have to wait a bit until I master that basic stuff, I guess. I understand the basis of pointers and linked lists now but I've never done much in the way of actually USING them.

So, I guess I'll go spend some time looking through Amazon for good C++ books that cover this stuff.

Learning C++ solidly will most likely allow me to develop for PPC2K2 along with just about everything else, so I might as well break down and learn it. (I sure have been putting it off for a while though!)

Now, this leads me to a few more points of interest:

First of all, any book suggestions are welcome. Again I'm looking for something that'll really teach me pointers, linked lists, etc. I don't need a book that starts with "This is a string" and ends with "Those were the pillars of OOP", as I've got a few already. Maybe something covering the Standard Library? I'll be looking on Amazon myself, as well, just wondering about the Ars-ian opinion.

Second, once I get at least familiar with C++, am I going to need a real thorough understanding of COM to use DirectX? Quite frankly, every time I've been exposed to COM it's scared the hell out of me.

Thanks again!
 

C=64

Wise, Aged Ars Veteran
106
Subscriptor
Take a few more years. By then you will be completly fed up and never talk about game programming again. At least that is what happened to every one who used to be in my major and wanted to "program games".

Well, then you don't know me. :)
I've got my degree and write apps for a living, but in my freetime I still do gamedev work in hopes of eventually producing a worthwhile demo and transitioning.

I do most of my gamedev work in straight C, and (would) do most of the tool chain in VB. 'Course, now that I've got C#, no need to deal with VB anymore. :)
 
Status
Not open for further replies.