Professional Games Made In C#?

Started by
95 comments, last by GameDev.net 18 years, 4 months ago
:-)

Merry Christmas all, before I forget
Advertisement
Quote:Original post by Dot5
Now, if you code up something like a simple physics lib or lets see.. an a* pathfinder or geometry builder etc etc. Now, shift that over to c# and put a load on it. What I found was that c# would perform ok with a very light load. But, it becomes seemingly exponentially slower as you start to give it a lot to do. The c# tests brought the pc to its knees, with framerates < 1fps, while the c++ version was still running > 80. Now, this was using an extremely simple renderer, with no optimization on either end other than the algoritms themselves being optimized.
This is strongly indicative of some kind of problem with your code in C#, possibly some misunderstanding of some important memory allocation detail or some such. (A gigantic number of gen2 objects, for example.) Which brings us to another point -- many devs are familiar with C++, it's quirks, how to fix things, etc. Not so much with C#.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
there was nothing wrong with the c# code. I have used it for many speed intensive tools for over a year and know the pitfalls and optimizations that it benefits from.

As I mentioned I used c# for some tools that did involve rendering large sections the game we are doing. BTW before I get any lofty posts asking about my "so called team", I am not an amature whose team comprises of a bunch of people in all reaches of the world, I am, and have been, a professional programmer for large companies for over 15 (the last 12 as lead) years with a handful of top 5 games, including a couple of number 1's on console and pc.

I liked c#, because like most of you guys it was pretty quick to get decent stuff up and running. Obviously this turns your head and so I checked it out, I didnt just install the compiler write a quick program and make my assumptions from that, I spent a few months trying various things, reading about optimizations etc etc this is after I spent a year on it learning about its "quirks".

Don't get me wrong, its good. I have just not seen any real gains it could provide on the actual game side when you consider the set up the company I work for, and the countless others I visit and have friends at have.

From that I drew my conclusions.

[Edited by - Dot5 on December 6, 2005 4:01:48 PM]
Quote:Original post by Enselic

C++
*** Source Snippet Removed ***

C#
*** Source Snippet Removed ***



That has got to be the worst example I have ever seen. By the way, the proper way to open a basic window in C++ is

#ifndef INCLUDED_HELLOWORLDAPP_H#define INCLUDED_HELLOWORLDAPP_H/** * The HelloWorldApp class * This class shows a window containing a statusbar with the text 'Hello World' */class HelloWorldApp : public wxApp{public:        virtual bool OnInit();};DECLARE_APP(HelloWorldApp)#endif // INCLUDED_HELLOWORLDAPP_H// HelloWorldApp.cpp#include "wx/wx.h"#include "HelloWorldApp.h"IMPLEMENT_APP(HelloWorldApp)/* this is executed upon startup, like 'main()' in non-wxWidgets programs */bool HelloWorldApp::OnInit(){        wxFrame *frame = new wxFrame((wxFrame*) NULL, -1, _T("Hello wxWidgets World"));        frame->CreateStatusBar();        frame->SetStatusText(_T("Hello World"));        frame->Show(TRUE);        SetTopWindow(frame);        return true;}


Something I find interesting is that Microsoft is using C# for all its game dev tuts in Code4Fun.

I tried looking at the MDX samples and stuff for C#, and to be honest, Im am MUCH MUCH more comfortable with C++ and DirectX, even though the most DX i have done is drawing lines with DirectDraw in DX8.
Quote:Original post by Dot5
anon, what do you mean?

I have used c# for over a year now, just not for game side stuff.


Well, quite frankly I just quoted your post because it had words in it that I've seen sooooo many times. Not trying to direct my comments at you directly.

The fact is, IMO, that C# is a damned fine language. I've been programming for around 20 years, I'm damned good at what I do, and like most people who've been in the biz that long I've used any number of languages during that time though C++ had been my "primary" language up until I started doing C#.

Even though I've never been a professional game developer (I'd like to, but the average pay is significantly lower than what I typically bring in, particularly when you factor in that I'd be "starting over" in the game industry), I feel that I'm in a pretty good position to compare languages, and I just get so tired of the language vs language threads. And I'm especially tired of how a thread that didn't start that way ends up that way ;)

The fact is quite simply that the answer to the original question is that there is not much in the game industry being done with C# at this time. This will change. I doubt that we'll see AAA games being done in managed code, but I have no doubt in my own mind that there will in time be a much bigger place for C# game development in general. I won't speculate on whether it'll ever get to the point of being a primary language in game dev, but there's little doubt that it's "market share" will grow tremendously.

Quote:Original post by Dot5
as for the slow argument, yes, I have compared it to c++. Now, you can do speed comparisons, and I have had people give me source and exe's showing that, like for like they are roughly the same. But the source is doing trivial things, even though they eat up time. large loops of simple calculation or assignments etc.

Now, if you code up something like a simple physics lib or lets see.. an a* pathfinder or geometry builder etc etc. Now, shift that over to c# and put a load on it. What I found was that c# would perform ok with a very light load. But, it becomes seemingly exponentially slower as you start to give it a lot to do. The c# tests brought the pc to its knees, with framerates < 1fps, while the c++ version was still running > 80. Now, this was using an extremely simple renderer, with no optimization on either end other than the algoritms themselves being optimized.

I am not anti c#, but if someone asks me if c# is used in professional game develpment, then im sorry but no, it most certainly isnt.


I guess the only real tests of whether C# is "slow" would be for you to have written both programs, and have had several years of experience optimizing in both languages.

Because I can tell you from my own experience, C# is not slow. That is an absolutely biased opinion not based on fact.

Now, having made that strong statement, I do not happen to believe that you can squeeze every last bit of optimization out of C# like you can C/C++, it will probably always be possible to have a faster C++ program. But that does not mean that C# is slow in any way. Slower does not equal slow ;)

As for your specific example, I have done C# ports of some of the freely available OpCode/ODE code and have seen virtually no noticible (measurable but not apparent) difference in speed using the same test environments and data, though the C# version does not suffer nearly as much from Stack Overflow exceptions ;)

A good algorithm and conscientous coding are the very best way to obtain good speed in any language, period.

This topic is closed to new replies.

Advertisement