Games in C# is it even Possible
-
Chona1171 wrote:
What does Microsoft MVP Stand for?
It means I help people in forums a lot.
Chona1171 wrote:
Damn I though I was being original
Yeah, that's the tough bit, for sure.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
And a 100mb hard drive went for a shitload of money. now terabyte drives are making the scenes. I even find that people arent using the normal CD's anymore its all DVD baby!!!!!!! and Blue ray is out but still very expensive, but I give it about 2 years to become a normal house hold item. My first PC was the ZX spectrum.
Oliekrokenosterpikkelikkeastrysvoel
-
True, but it's the part you think of when you think of performance. I doubt that C# is much behind C++ in terms of ability to crunch numbers.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
Exactly, it's written in C/C++ as a thin layer around the graphics drivers. .NET accessibility is probably just a thin layer around the native DirectX layer, giving the 4-5% performance penalty. It's all the other stuff around the DirectX, where .NET will hurt performance. For instance, handling trees, queues, lists, arrays, will always be faster in native code. Native code doesn't have to go through all the hoops .NET lays out (security, memory management, exception handlers (yes, these are serious performance hoggers - even so in C++ apps), etc). Native apps also have less memory overhead, allowing for less page faults and better cache management which are probably the biggest performance killers. If C#/.NET had been a viable option for games, we would've seen them by now. (No, Tetris doesn't count ;))
-
True, but it's the part you think of when you think of performance. I doubt that C# is much behind C++ in terms of ability to crunch numbers.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
Hmm, I wouldn't bet a whole lot on that. For high performance number crunching, I'll bet C# might run into issues. For example the physics engine, or maybe the collision engine. Perhaps if there's an advanced AI engine for game play, and that has to do a lot of fast number crunching to determine things, or movements?
¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!
-
Christian Graus wrote:
Why ?
Possibly because C# has been shown to be about twice as slow as C++? For a time critical app like a 3D game, that might be important.
David Kentley wrote:
Possibly because C# has been shown to be about twice as slow as C++?
Shown by who ? C++ programmers who don't know how to use C# ? I write image processing software. I implimented an algorithm in C#, and moved it to C++. It went from 15 seconds to "I gave up after a day". I know C++ better than C#, but I'd just ported the code holus bolus, when I went back and looked at it, I could see why, and I changed the way my algorithm was implimented, and ended up with something slightly faster, as in 12 seconds or something. I still use that C++ code in my C# app, just to save those few seconds, but most of my processing is a lot less intense than that lot was ( HDR image merging ), and it works just fine in C#.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
Jörgen Sigvardsson wrote:
If it was, we would've seen hordes of games written in C#, wouldn't we?
as I already stated further in the thread. For speedy games you need C/C++, but for slower games C# will do just fine... eg. Leisure suit Larry 9 could be written in C" perfectly. Doom 4, Need For Speed Hot Pursuit 3 and the likes, could not...
I've found a living worth working for, but I haven't found work worth living for. :beer:
:jig:V. wrote:
eg. Leisure suit Larry 9 could be written in C" perfectly.
I'd like to see it to believe it. :) Remember, any glitch in the animation will make the game look like crap. You can't have the garbage collector kick in and practically halt the game. Programmers are far more tolerable of this kind of behaviour than gamers are. Could you imagine the reaction of a gamer if a game started to act like Visual Studio 2005!?
V. wrote:
Doom 4
I suspect you meant either Doom 3 or Quake 4. :~ I believe they shouldn't have been written at all. You'd have to search hard to find crappier games. Shitslow, and absolutely no value for the money.
-
Chona1171 wrote:
Blue ray is out but still very expensive, but I give it about 2 years to become a normal house hold item.
Not unless them and the HD-DVD camp get their crap together and consolidate.
Yea the consumers always have top suffer under the companies red tape. But I also thing blue ray might be a problem cos I mean a tiny scratch on the disk and you are out of a GIG of Data. I have done a little bit of PC Forensics and Recovery and as far as I understand it is impossible to recover from a damaged surface.
Oliekrokenosterpikkelikkeastrysvoel
-
V. wrote:
eg. Leisure suit Larry 9 could be written in C" perfectly.
I'd like to see it to believe it. :) Remember, any glitch in the animation will make the game look like crap. You can't have the garbage collector kick in and practically halt the game. Programmers are far more tolerable of this kind of behaviour than gamers are. Could you imagine the reaction of a gamer if a game started to act like Visual Studio 2005!?
V. wrote:
Doom 4
I suspect you meant either Doom 3 or Quake 4. :~ I believe they shouldn't have been written at all. You'd have to search hard to find crappier games. Shitslow, and absolutely no value for the money.
-
I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?
Oliekrokenosterpikkelikkeastrysvoel
I am not a game programmer, but have worked on some soft real-time systems that have similar issues. The main problem with using C# or any other GC language/platform for such tasks is managing resources. For a real-time software, it is crucial to have a tight control over resources - i.e. you don't simply call
new
to get a chunk of memory - instead, you preallocate memory chunks when the program starts and then manage them during run-time. In my experience, it is much easier to do with C or C++ than with something like Java or C#. Not to mention the annoying fact that many string operations with Java/C# result in a creation of a brand new string object, but that is probably not a big issue with games - for the language processing applications I am working on, it was practically a show-stopper. -
I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?
Oliekrokenosterpikkelikkeastrysvoel
Chona1171 wrote:
Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?
I've long held any language can be used for just about anything, the question is about quality and efficiency. Most processing systems (CPUs) are fast enough to make up for most deficiencies in any language **IF** you understand what those are and how to get around them, which brings it back to you and your skill. Competing in the market has less to do with language and more to do with skill and uniqueness of the game. A truly unique game does not need efficient operation, see the first Myst game. by holding a new and unique place in the marketplace you can sell easier. IF, however, you want to compete against say the Doom series directly, that takes skill and guts. Many games used to be written in assembly for speed, but the time to write a game and bring it to market was too extensive. Then came high level languages with hand-optimized assembly for some of the more commonly called routines. But even that took too much time for fine tuning. Optimizing compilers got good enough hand-optimized assembly became rare. So the long and short... Can C# compete? yes, with the right skill, design and marketable concept. That is a tough combination no matter what you program for, or on.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?
Oliekrokenosterpikkelikkeastrysvoel
Check out the following link for some C# and Managed DirectX related information. www.thezbuffer.com[^] Microsoft also has a site that has a couple of simple games (space invaders, pong, etc.) written in C# and GDI+. www.upgradeyourgame.com[^]
-
Yea, you beat me to posting that. They have links to game engines all built with .NET and Managed DirectX. It's a pretty nice site.
Steve Maier, MCSD MCAD MCTS
-
DirectX in C# is apparently only 4-5% slower than C++.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
Christian Graus wrote:
DirectX in C# is apparently only 4-5% slower than C++.
and if you visit the Microsoft Labs presentations at the Game Developer's Conference (GDC) you will hear them say that most games are innefficient. This actually is not surprising, if it takes a year to write a program to reach market (and it usually takes more), then technology has changed in the mean time. Many companies schedule rewrites for technology advances into the game schedule, but that is difficult. So most games go into the market at the mid-level of technology because it is too expensive to stay current all the way to market. Give the right skill of the programmer I don't see 4-5% as a show-stopper, per se. Now if you go head-to-head with a skilled 3D programmer, 4-5% handicap hurts.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
David Kentley wrote:
Possibly because C# has been shown to be about twice as slow as C++?
Shown by who ? C++ programmers who don't know how to use C# ? I write image processing software. I implimented an algorithm in C#, and moved it to C++. It went from 15 seconds to "I gave up after a day". I know C++ better than C#, but I'd just ported the code holus bolus, when I went back and looked at it, I could see why, and I changed the way my algorithm was implimented, and ended up with something slightly faster, as in 12 seconds or something. I still use that C++ code in my C# app, just to save those few seconds, but most of my processing is a lot less intense than that lot was ( HDR image merging ), and it works just fine in C#.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
Christian Graus wrote:
but most of my processing is a lot less intense than that lot was ( HDR image merging ), and it works just fine in C#.
have you tried the C# Microsoft Research Accelerator? I would expect for HDR image manipulation it would work great. It moves C# to utilizing both CPU and GPU for parallel processing. http://channel9.msdn.com/wiki/default.aspx/Accelerator.HomePage[^] I haven't used it yet, but it is the first item of C# that made me do a double take. That is worth learning a new language (not that I have had any time to).
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
David Kentley wrote:
Possibly because C# has been shown to be about twice as slow as C++?
Shown by who ? C++ programmers who don't know how to use C# ? I write image processing software. I implimented an algorithm in C#, and moved it to C++. It went from 15 seconds to "I gave up after a day". I know C++ better than C#, but I'd just ported the code holus bolus, when I went back and looked at it, I could see why, and I changed the way my algorithm was implimented, and ended up with something slightly faster, as in 12 seconds or something. I still use that C++ code in my C# app, just to save those few seconds, but most of my processing is a lot less intense than that lot was ( HDR image merging ), and it works just fine in C#.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
Christian Graus wrote:
Shown by who ? C++ programmers who don't know how to use C# ?
I think I was basing my "twice as slow" comment on this link that I found a while ago. Judging from the site name I doubt they're biased against C#. In particular the Sieve of Eratosthenes results were interesting (scroll down, the Hello World results are useless and not at all unexpected). BTW, I program in C# and believe that in the vast majority of applications, being twice as slow doesn't matter at all (most programs spend most of their time waiting for the much slower human component). I like C# as a language. But it's not as efficient as C or C++, and by design it can't be. So for something like a modern 3D game, which needs all the performance it can get, C++ is going to be the better choice. As for DirectX only being 4-5% slower when using C#, that's all well and good but considering DirectX spends most of its time in libraries that aren't written in C#, it's not surprising and nor is it very useful. The rest of the app (physics, AI, what have you) will be much slower and significantly so.
-
I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?
Oliekrokenosterpikkelikkeastrysvoel
Well there is stuff on how to do this, and there is a few c# games written - some of them are even on this site. If you want to have a look at how to do this then perhaps you should try MSDN webcasts or http://www.digipen.edu/main/Webcast Ciao, M.:laugh:
-
Exactly, it's written in C/C++ as a thin layer around the graphics drivers. .NET accessibility is probably just a thin layer around the native DirectX layer, giving the 4-5% performance penalty. It's all the other stuff around the DirectX, where .NET will hurt performance. For instance, handling trees, queues, lists, arrays, will always be faster in native code. Native code doesn't have to go through all the hoops .NET lays out (security, memory management, exception handlers (yes, these are serious performance hoggers - even so in C++ apps), etc). Native apps also have less memory overhead, allowing for less page faults and better cache management which are probably the biggest performance killers. If C#/.NET had been a viable option for games, we would've seen them by now. (No, Tetris doesn't count ;))
Age of Empire!?!
-
I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?
Oliekrokenosterpikkelikkeastrysvoel
Written in every programming language; including assembly. Give enough engineers enough non-project time and they will code a game.
A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane
-
Age of Empire!?!
Does it run well on a $1000 machine? Is it entirely written in .NET? It's hard to verify how much C++/CLI there is in there to speed it up. :)
-
Does it run well on a $1000 machine? Is it entirely written in .NET? It's hard to verify how much C++/CLI there is in there to speed it up. :)
Jörgen Sigvardsson wrote:
much C++/CLI there is in there to speed it up
Obviously not! Are you of these fool who would think .NET a failure until Windows and Office would be entirely managed? When you've got some running C code, keep it! We are not in the Java crowd here...
Jörgen Sigvardsson wrote:
Is it entirely written in .NET?
err.. mistake here. C++/CLI is just the same as C#. only pure C++ could have some sort of advantage. Now I'm not convinced at all by the so-called "overpowering advantage of C++". All tests I have done or seen failed to convince me. But hey, if the competition stick to C++, all the better for me! ;P