Games in C# is it even Possible
-
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
Arena Wars[^] is a great game.
Regards Thomas
Disclaimer:
Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you. -
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.
You should replace for (int i = begin; i < end; ++i) with for (int i = begin; i < primes.Length; ++i) And do the same with the inner loop. This is a special construct recognized by the JIT that eliminates array bounds checking. I haven't tested this on .NET 2.0 yet, maybe .NET 2.0 eliminates array bound checking even when not using that fix.
-
Chona1171 wrote:
Mabe I should just stick to Information Systems its what I am good at.
Nah, stretch yourself, become good at other things. Resources such as bitmap handles and database connections can be cleaned up by the IDisposable interface, which just means if an object has a Dispose method, you should call it when you don't want an object anymore. It's a poor mans substitute for deterministic destruction.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
Actually, with a game, you shouldn't dispose resources as soon as you're finished with it. If possible, you should make sure the GC doesn't, either. The idea is to dispose unused resources during a transition (those times when the loading screen pops up) so as to avoid hiccups in the frame rate. It's not all that important when it's just one or two little resources but if you're clearing out game resources in bulk players will notice. Same goes for loading them.
Christopher S. 'coldacid' Charabaruk
-
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.
Puh-leeze. C# isn't faster or slower than any other language, it's all in how it's used. I developed a little game in 3 days that used only 2D graphics with the help of SDL.NET, and it struggles at 30 FPS. I've seen MDX and Tao.OpenGL that just fly. C# is a perfectly good language for game development, concerns about resource & memory management or no.
Christopher S. 'coldacid' Charabaruk
-
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
Try to implement perpixel alpha blending in C# and you'll see why there are no many games written in .net. The answer is - because there are many winapi functions which doesn't have corresponding .net methods. These functions are in most cases so-called low level, such as WINAPI UpdateLayeredWindow function. So, the only way to implement pp alpha blending is to call WINAPI function from C# but does it make any sense? Isn't it better to write the game in C++ and use WINAPI functions directly?
-
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 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
Very possible. Check out this article at Coding4Fun... Rocket Commander
-
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)
Interesting, cheers for the link! There is also NGen for improving managed assemblies performance: http://msdn2.microsoft.com/en-us/library/6t9t5wcf.aspx
-
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
Not only is it possible, Koios Works has released multiple games all developed in C#. Their latest game, Panzer Command: Operation Winter Storm just came out in June.
-
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.
bwahahahaha!!!! and 72% of all statistics are made up on the spot.
-
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 this game written in C#: http://www.rocketcommander.com[^] Rocket Commander Tutorials: http://msdn.microsoft.com/coding4fun/gamedevelopment/rocketcmd/default.aspx[^]
-
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
There are some great tutorials on the following links. [http://abi.exdream.com/ http://msdn.microsoft.com/coding4fun/gamedevelopment/rocketcmd/default.aspx](http://abi.exdream.com/
http://msdn.microsoft.com/coding4fun/gamedevelopment/rocketcmd/default.aspx)[[^](http://abi.exdream.com/
http://msdn.microsoft.com/coding4fun/gamedevelopment/rocketcmd/default.aspx "New Window")] Arena Wars is commercial game written in .NET. http://arenawars.krawall.de/com/[^] -
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
Hi, there already is a professional 3d Game programmed in C#/.NET: http://arenawars.krawall.de/start.html
-
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)
-
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
It is possible, but you would only select C# for game develoment in the case of a game that did not require state-of-the-art performance. C# is indeed slower than properly written C++. However, in either language you can tank the performance if you are not an experienced programmer. C# in the hands of a good developer could actually exceed the performance of a poor programmer using C++, depite being interpreted. If you are planning on writing the next FPS, like Quake X, then you'll need to use C++. If you are writing another version of Soduku, then C# will perform fine. In the industry, programmers skilled in both languages typically use C++ for coding the game, and C# to code tools, like level editors. Why? Well, in the game, I want to be able to do anything at any time for maximum performance. I may even go to inline asm. But, I want the tools to develop game content (levels, animations, etc.) built quickly and C# allows that to happen without worries about memory management. To truely be proficient in programming in C# you'll need to understand memory management to understand how it works behind the scenes, or you'll be writing slow code anyway. So, learn both. Patrick