C# as a FPS programming laguage

Started by
17 comments, last by u1jd 18 years ago
You only need to know one thing: if you plan to work as a gameprogrammer in the future use C++ and only C++ theres not need to be any discussion on that, but if it is for your own purpose use whatever language you like like C#, Java, Delphi(Pascal) anything will do fine.
Advertisement
C# is faster for the programmer, C++ is faster for the computer. This is not entirely true, since the underlying complexity of the machine is not very hidden from you in C++, and programmers can have trouble actually increasing performance with optimizations. C++ is the standard game industry language, and most engines use C++. I happen to be writing a physics engine in Lisp, so I would certainly be in the "prototype it first in C#, port to C++ the parts that are bottlenecks later" camp.

So if i was to develop my game (not sure if anyone is interested in knowing what it is) with the possibility of maybe moving into game programming as a profession instead of software development should i think about learning C++ instead of using C# which i already know.
Wait, so you're certainly saying that C# has its place in the industry? That it's a language which can 100% be used for programming high-end 3D games?! Wow, this is like my favourite language of all, but I dumped it for this very reason: INABILITY to be used as a language for 3D games (and limited books, materials etc.).

Hey, then guys, what do you recommend, while I'm at it: continue learning Python, which I quite like, or switch to C#? Or even to C++ altogether?
With Microsoft XNA and such, C# can be used to make games that can run on XBox 360. We'll see how that turns out. I doubt the big game developers are going to pull a switch though, because it's unlikely you will see the PS3 running C#, and many developers want to keep with a code base that doesn't restrict them to certain platforms.

Have you considered just sticking with C#, and when you're ready to get into the industry apply for tools programmer positions as well as places that may use C# for the game ?
Well, even Python is viable for game development, but it definitely does have speed issues. Of course they can even be dealt with by hooking in C/C++ code.

My recommendation is to use the language with which you think you can write the game most easily. If you think it would be easier to write it with C#, then use C#. If you think it would be easier to write it with C++, then use it! The speed arguments in the C++ vs. C# battle have been proven moot. They say that DirectX programs in C# suffer only a 2%-5% speed hit compared to the same written in C++ (if someone has a reference to somebody important saying this, it'd be helpful; I think Microsoft themselves may have made such a claim).

In the end, my guess is that if you were to want to break into the industry, you'd be WAY better off having a very well written game done in C# than a not-so-well written game in C++. And if you're just a hobbyist, use whatever language you want. If your program ends up slow, it's more likely because of poor algorithm design than your choice in implementation language. If you find out later on that your game is truly choking on its use of C# features (use a profiler before even trying to make any such assertions), then you can port it to C++ or recode the slow bits in C++ and use them that way.

-Auron
(sorry for hijacking the thread)

So what do you recommend? Should I currently stick to Python or start with C# right away and not waste time? Or just start learning C++? I want to save some time yet not be lost. I have experience with C# and C++, but I still can't decide.
Is Managed Code Slower Than Unmanaged?

If you need more speed there is "unsafe code" option which allows you to switch off bounds checking and do pointer tricks. You could write critical bits in unsafe code while using "safe" code for the rest.

C# has access to DirectX.
C# has access to OpenGL.

The code is much cleaner due to properties, delegates and managed environment. It has operator overloading and templates.

Therefore one can develop FPS or any kind of game in C#.

C# was conceived 20 years after C++. For me using C++ is like flying to the moon today using Apollo 11 from 1967.

But understand there is almost 20 years of legacy code in C++. Is it really feasible for a studio which has been developing games in C++ for more than a decade to suddenly switch to a new language? That is a major factor in slow adoption of C# in professional studios.

If you have opportunity to start fresh use C#.
People of the Earth unite!
Hijack away, i dont mind, I am personally going to go with C# it seems as though no one really has anything bad to say about it and its a nice language to use, if you can do everything with C# that you can with C++ i cant see any reason not to use it,if you like it

This topic is closed to new replies.

Advertisement