Jump to content
  • Advertisement
Sign in to follow this  
PulsarSL

C# worthwhile

This topic is 5261 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Quote:
Original post by Will F
Here's a entry at wikipedia about Direct3D vs. OpenGL. It should give you a better understanding about the two.

That is not a very valid comparison when talking about managed code. I mean there is absolutely zero reason to use OpenGL with C# unless you want to use it cross platform. If you are developing for Windows only in C# than managed DX is the best API for the job.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Saruman
Quote:
Original post by Will F
Here's a entry at wikipedia about Direct3D vs. OpenGL. It should give you a better understanding about the two.

That is not a very valid comparison when talking about managed code. I mean there is absolutely zero reason to use OpenGL with C# unless you want to use it cross platform. If you are developing for Windows only in C# than managed DX is the best API for the job.


One of the beautiful things about wikipedia is that you can go in and add that information if you want to. I don't know much about windows specific programming, but I assumed that link might be helpful to someone (then again, you always have to take the things you read on wikipedia with a grain of salt).

Share this post


Link to post
Share on other sites
Btw: Arena Wars is written purely in OpenGL, which is possible too and was a few years ago not such a bad choice (since managed directx came later).
Saruman is absolutely right, given the same timeframe to develop an application a c# program should always outperform a c++ program (unless you do a stupid loop or something) because you have so much time optimizing performance and the code (more ide features, refactoring, code generation, reflection, etc. make this job easier and unlike c++ c# is not a write only language ^^).

Now I switched to DirectX, which wasn't too hard for most parts of the engine and is IMO the better sdk for using shaders anyway in the moment. I still think OpenGL is the easier language for simple and easy rendering, but when you need advanced features all this extensions can become really annoying, especially in c# when you always have to update your c++ wrapper dll ...

Another sideeffect of using .NET is the fact, that more and more tools and applications (e.g. from the business world) are for or in c# and make your life easier.

Share this post


Link to post
Share on other sites
Will we someday see trully commercial games using c#? Im talking about games such as Quake, Doom, Unreal, Diablo and the like, those are true commercial games as in - they have enough content and enough design to become a very productive product :D

Arena Wars is a start, yes, i can see a bright future for it because of its nice design. But this game is mostly 2d, not 3d. What about 3d games then?

Im just asking that because right now im wondering about starting learning c# instead of c++ . I know if i learn either one of them ill be able to learn the other easier because both use at least the same syntax, and both are just different expressions of the same computer language (binary). But is it worth it? Will i be able to someday make true commercial games? Will the tiny bit of performance affect how the game plays? Yes, question still remains, is c# worthwhile for game programming?

Share this post


Link to post
Share on other sites
There is nothing about C# itself that prevents anyone from making an A+ game in it. The problem is that the companies already have so much invested in C++ that a change would be very costly, and probably not worth it.

And this has been said before, but don't worry about whether a language will be useful or not, what you learn can be applied to most any other language, and if you master one you shouldn't have much problem learning and then mastering another.

Share this post


Link to post
Share on other sites
Quote:
Original post by XVampireX
Im talking about games such as Quake, Doom, Unreal, Diablo and the like, those are true commercial games as in - they have enough content and enough design to become a very productive product :D

You have a very narrow and wrong assumption of what a commercial game is. What you mentioned were AAA commercial titles. And quite honestly no company producing tripleA titles is going to switch to using managed code. Why? Quite simply because if you have the budget to develop a tripleA title you are developing for multiple platforms which must use native code. Not to mention the existing codebase they have already invested millions of dollars into to build up.

Quote:

Arena Wars is a start, yes, i can see a bright future for it because of its nice design. But this game is mostly 2d, not 3d. What about 3d games then?

Our new engine is a full C# 3D engine and actually runs faster than our old C++ engine due to better design with the time constraints, etc. You should attain 97-98% of the performance you would in the exact same C++ application unless you make some huge design mistakes... which has nothing to do with language anyways other than it's easier to make design mistakes in C++. Quite honestly for the average developer their code is going to run faster in C# than in C++ anyways because most developers using C++ do not know how to properly use the language and/or do it optimally.

Quote:

Im just asking that because right now im wondering about starting learning c# instead of c++ .

Language actually means nothing at all. The algorithms, logic, and patterns are what matter and they will be roughly the same for any ADA/C language.

Quote:

I know if i learn either one of them ill be able to learn the other easier because both use at least the same syntax, and both are just different expressions of the same computer language (binary).

Actually computers speak machine language, but that's another story :) C++ compiles to native machine code while C# compiles to MSIL and is JIT to native machine code on first run of the code portion and cached for later use.

Quote:

But is it worth it? Will i be able to someday make true commercial games? Will the tiny bit of performance affect how the game plays? Yes, question still remains, is c# worthwhile for game programming?

If you can't make a successful commercial game in C#, quite frankly you couldn't do it in any language.

Share this post


Link to post
Share on other sites
Quote:
Original post by PulsarSL
Probably because everyone uses it [edit - it being C++].
Do I have to comment on that argument?

Share this post


Link to post
Share on other sites
Quote:
Original post by XVampireX
Yes, question still remains, is c# worthwhile for game programming?


Yes, games will always need tools. With C# you can get your game tool programming done a heck of a lot faster than in C++. I mean I've always been a MFC enthuastist and still am for the most part. I can say I am, well was not, highly biased to using it for all C++ GUI needs. I just loved how freaking easy it was to drag and drop components to make a GUI then add in the code, all with C++.

Well, with Windows.Forms in C#, it's a lot better than MFC. I mean I had no idea of how C# worked, yet I was able to make a GUI in less than 30 minutes. Most of everything is logical as it should be programming wise. I mean I could just scroll though the Intellisense and found what I needed and used it. Of course I had to look up a few things here and there, but let me tell you, Windows.Forms is something that will start to be used more often down the line, at least I know I will be using it.

Another neat thing that you can do with it is you can make your GUI in C#, then tie in your C++ code via another program. What I mean is that you do not have to code your tools in C#, you can make C++ programs, then tie those programs in though the GUI. I remember a discussion a while back on thoughts on using multiple languages - I can see the argument now of being able to increase effeciency with multiple languages.

As for games themselves, I have not yet ventured into that aspect of C#, so I don't have much to say. Using C++ libraries is easy via C#, but it's tedious since you have to go though and convert all #defines to const int's and such for C#. That is of course if you do not want to learn managed DX [wink]

Ok so wrapping up, I think C# is very useful and is definitly worthwhile, mainly in regards to game tool development. It has a lot of features in it that make it 'fun' to mess with. Really though, you don't have to sit down and 'learn it' - you just get an idea of what you want to make GUi wise, then start dragging and dropping and that's about it. When you need to find specific functionality, MSDN has just about everything you need as well as the numerous examples all across the net.

Share this post


Link to post
Share on other sites
On the note about C# taking care of the memory managment for you. It is true that the garbage collector will get rid of stuff eventually but, you will want to pay attention to how you handle any Managed DirectX objects. They have Dispose methods on them so you can free reasources, just because you have a garbage collector doesn't mean you need to just drop trash everywhere :-D You still have to program effecient code. :-D

Anyways, I think C# is a good language to program games in. Especially if it's a 1 man project. It simplifies things and makes it easier to get things done, which I believe increases the likelyhood of finishing a project. On the managed DirectX being a good API. Yes, it is good and although it had some really annoying bugs when it was first released I *think* they are fixed now... The API for MDX is still changing though so that is slightly annoying moving from one version to the next. Overall I think C# is a great choice. I wrote a program using MDX that rendered things to a seperate display(on a projector actually). Although it wasn't a game it was a graphical program that used shaders, and stuff and I thought it worked well. MDX is lacking on the DirectShow type wrapper though. I ended up writing a DirectShow filter in C++ that interfaces with the managed part of it to get the flexibility I needed.

Share this post


Link to post
Share on other sites
I am a C# newbie. Like every line of code I write in it, i have to change after the compiler complains. And despite that, im still productive with it.
I wrote a decay simulator for extra credit complete with animation via GDI++ in a few hours after never before coding in C# ever. It's just so easy :)
C# is just awesome for small utilities and apps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!