Sign in to follow this  

is possible to make advanced games with C#?

This topic is 3870 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

Hi dudes, So, i'm learning java, but i'm thinking in make a mmorpg (it's just a future project)... but i'm studying the technologies to know what is the best for this purpose... the game that i want to make is a MMORPG style, using OpenGL... so, i got a little of fear to learn C++ cause some friends talks that it's very hard. i'm fine with java, i understand well but since the language is very slow for make it i'm thinking in learn C#, but i don't know nothing about this language, someone can talk if is possible to do that using C#? or if it's not recommended and i sould learn C++ :O? tnx all and sry my worst english...

Share this post


Link to post
Share on other sites
Uhm:

1) Java isn't as slow as most people think. (it is about as fast as .Net if you use the right compiler/VM and write sane code)
2) OpenGL works very well with Java, C#, C++ and a bunch of other languages
3) Both C# and Java can be used to make any game you can think of.
4) If you want you can learn C++ anyway, there are plenty of resources around for it.

Share this post


Link to post
Share on other sites
First off let me just say welcome to GameDev.net :)

Secondly, to ward off having a very unpleasant experience here since your new I would just search the gamedev forums and archives. Trust me, the question your asking has been asked hundreds if not thousands of times.

All I can really say is that a game is only as advanced as the person(s) developing it. You can create advanced games in java/C#/C++/Ruby/Python whatever.

XNA uses C# and there are already some "advanced" games being created with it.

Good luck tiagomac and remember that the search function is your friend :)

Share this post


Link to post
Share on other sites
C# is very capable of creating the type of game you're thinking of - as a_insomniac observes however the capabilities of the language are rarely anywhere near as limiting as the abilities of the programmer, so you'll need to spend quite a bit of time learning to effectively use the language you choose.

I'd suggest either sticking with Java or learning C# for this; you're welcome to learn C++ if you wish, but it can be very difficult to learn and work with and you don't need it.

Share this post


Link to post
Share on other sites
I'm in the same situation as you, choosing a language to start learning for game development, having experience in Delphi and Visual Basic.

As far as I know, Java is (one of) the most portable languages and is as powerful as C++. However, I've also heard some comments about Java's "lower speed" because of the virtual machine it uses. C# might be a little easier than C++, and it also has some improvements. The following articles maybe interesting to you:

http://msdn2.microsoft.com/en-us/library/yyaad03b(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/ms228358(VS.80).aspx

What convinces me about learning C++ is a huge amount of games already made in it (means that most of proffesional game developers prefer it). And that the game programming schools focus on C++ as a "base language" to teach implementation of game development technologies and tecniques. At least the academic programs of 2 schools i've examined proove it (the other ones don't mention any specific language).

Share this post


Link to post
Share on other sites
Quote:
Original post by Konstantin Vikhrov
What convinces me about learning C++ is a huge amount of games already made in it (means that most of proffesional game developers prefer it).

First, you're not a professional, so what pros use has little immediate bearing on what you use. Second, perhaps the pros use it because they have to, not because they prefer to?

Quote:
And that the game programming schools focus on C++ as a "base language" to teach implementation of game development technologies and tecniques. At least the academic programs of 2 schools i've examined proove it (the other ones don't mention any specific language).

Game programming schools are mostly a sham. With determination and dedication, you can do far better - and then you can spend that money on hardware or software or art or music for your game, rather than tuition fees.

Make a game with what you know.

Share this post


Link to post
Share on other sites
Dudes, tnx tnx tnx very much.
u guys removed me manny doubts in a few posts...
i read a little about XNA, it seems to be very good for game development, but in the site it recommend to use a GeForce FX serie 6 or better :O! then, a friend today tell me that C# is slow like Java :O! if it's slow like java and with my experience with java i can say that i can't do what i want (a MMORPG)in C# since in Brazil the guys don't have these strong Video Cards :(!
i'm lost in doubts :'(! i think that C++ will be very hard to me, other friend tell me to use C instead of C++ cause he said that C++ is very "disarranged" what u guys think about that?

Share this post


Link to post
Share on other sites
Well you don't have to use XNA to render. You could use MDX, which is a more "direct" wrapper over DX9 or OpenGL through Tao. Both of them still support the old fixed function pipeline which would allow you to target older video cards, unlike XNA which requires shader support. Of course if you wanted to target pre-DX9 hardware you'd probably have to use OpenGL.

Edit: Oh and if someone tells you it's "slow", ask them if they've actually used it(for more than a few hours). If the answer is no, don't listen to them.

Share this post


Link to post
Share on other sites
Whichever way you go, I recommend creating something other than a MMORPG at first (like someone else said, something smaller)

You will probably have to learn C++ anyway, simply because of all the documentation and tutorials are in C++ (XNA starting to get some more...)

And if you want you're game to run on systems other than Windows (and Xbox for XNA), you will most likely have to use C++.

And as long you don't make it too big, you should be able to write in about any language you wish (aka., not World of Warcraft or other big, high-intensity titles). C++ is known though for having a lot of power.

Java should work (I don't write in Java, so I don't know as much about availible libraries...). C++ takes a little bit of work (except during those all-so-rare times). C# should work fine (if anyone happens to read this, do you know if Visual Basic works with XNA? That's the main reason I backed off...)

My two cents.

Share this post


Link to post
Share on other sites
If you're just starting out, then the "speed" of the language isn't going to affect you. All of these languages are capable of running at speeds much faster than you can program for. You're just starting out, your games will be simple, you're not going to max out the abilities of your programming language, period.

Your game might run slow, but thats because you are just learning and your code is not going to be super-efficient. It has nothing to do with the language you are writing in, it has to do with your lack of experience. No programming language in the world is going to make your first learning experience game run at 500 frames per second with graphics like Gears of War.

C++, Java, and C# are all C-family languages. Once you are very good at one, you can move to another one without relearning everything from scratch. Just pick one, whichever one is most convenient for you at this time, and run with it. In the future when you are making more advanced games then you can switch to a different language if you deem it necessary.

Share this post


Link to post
Share on other sites
XNA is a framework that uses the .NET technology. The Microsoft .NET platform is esentially a very complex web of tools taht encompasses everything from security to Web development. More info in:

http://en.wikipedia.org/wiki/Microsoft_.NET_Framework

http://msdn2.microsoft.com/en-us/library/a4t23ktk.aspx

So, YES! C# is slower than C++ for game programming actually. A test program rendering poligons in a PIV with C++ and DirectX is almost twice faster than XNA and C#.

And Managed DirectX is no longer supported by Microsoft and we all know what happens with Microsoft software when is no longer supported (remember WIN 98 and VC++ 6).

If you want to use OpenGL I recommend you to use it with C++. Search in the net to look all great games that have been developed with C++ and OpenGL (Quake sounds to you).

Then you'll have another great benefit, portability. A game made with C++ and OpenGL can be buil and compiled in many different machines and OS, like Linux, Unix, Mac, etc.

Good luck.

Share this post


Link to post
Share on other sites
Quote:
Original post by ejele012
So, YES! C# is slower than C++ for game programming actually. A test program rendering poligons in a PIV with C++ and DirectX is almost twice faster than XNA and C#.


Really? Where's your proof? DirectX API calls are the same across all languages, so I really doubt this is true.

Quote:
Original post by ejele012
And Managed DirectX is no longer supported by Microsoft and we all know what happens with Microsoft software when is no longer supported (remember WIN 98 and VC++ 6).


Actually it is still supported, just not updated. Also there's a difference between not being updated(MDX) and just being pure crap(VC6).

Quote:
Original post by ejele012
If you want to use OpenGL I recommend you to use it with C++. Search in the net to look all great games that have been developed with C++ and OpenGL (Quake sounds to you).


Too bad Quake is a C program with an assembly software renderer.

Quote:
Original post by ejele012
Then you'll have another great benefit, portability. A game made with C++ and OpenGL can be buil and compiled in many different machines and OS, like Linux, Unix, Mac, etc.


Yeah, but a game built with Mono only needs to be compiled on one system and can run on the others, thanks to the JIT compiler. Lets see C++ do that.

Share this post


Link to post
Share on other sites
One of the most advanced games I have seen made with C# and the XNA Framework is XNA Racer. The game and source code are available as a starter kit on creators.xna.com and from Ben's book on XNA. The game is all managed code and a video of it is available on youtube here.

Now, in my opinion, that is pretty damn advanced, so you can hardly say C# and the XNA Framework are not capable of producing high performance games.

Quote:
Original post by ejele012
So, YES! C# is slower than C++ for game programming actually. A test program rendering poligons in a PIV with C++ and DirectX is almost twice faster than XNA and C#.
To be blunt, this is such complete bullshit. So I am calling you out to prove it. Provide two sample applications with full-source that render the exact same geometry with the same shaders and prove that C++ is "almost twice faster". [flaming]

Regards,
ViLiO

Share this post


Link to post
Share on other sites
It's actually the opposite when it comes to speed because the programs you write in C++ tend to be written so poor that it's a mess / wreck anyways.

For your case, C# will cut development time, learning curve and be almost as fast as C++. The problem is it'll take hard work to match frame rates and power of a well programmed and optimized C++ program using C#.

I recently read up on such an article with a few demos, but I cannot find the web site any longer. I do too many things at work and home... :/

Share this post


Link to post
Share on other sites
Quote:
Original post by markadrake
It's actually the opposite when it comes to speed because the programs you write in C++ tend to be written so poor that it's a mess / wreck anyways.

For your case, C# will cut development time, learning curve and be almost as fast as C++. The problem is it'll take hard work to match frame rates and power of a well programmed and optimized C++ program using C#.


The quality of coding is the same, regardless of language.

The different is, poor coding in C# or Java will result in slower execution, and occasional NullPointerException with a stack trace.

Poor coding in C++ will result in 28,000 memory leaks, 4500 synchronization issues, 58,000 portability/incompatibility problems, 340 language/compiler incompatibilities, and random segfaults without a hint of where, why and how.

Take your average driver, and put them in formula 1. Yes, they *could* drive 300mph. But in reality, they'll crash in the first corner. At least with that big ugly SUV that is "slow" they'll finish the lap, and likely, the race.

And no, getting acceptable framerates in either of those won't take long - far from it. That's the whole point - C# and Java aren't legacy ridden mess, there's one way to do something, and that's it.

Share this post


Link to post
Share on other sites
Quote:
The different is, poor coding in C# or Java will result in slower execution, and occasional NullPointerException with a stack trace.

Poor coding in C++ will result in 28,000 memory leaks, 4500 synchronization issues, 58,000 portability/incompatibility problems, 340 language/compiler incompatibilities, and random segfaults without a hint of where, why and how.


Antheus, tnx u very much, i'm very interested now to learn C# :O!
but i'll have to increase my english knowledge first :O!

Share this post


Link to post
Share on other sites
Quote:
Original post by ejele012
So, YES! C# is slower than C++ for game programming actually. A test program rendering poligons in a PIV with C++ and DirectX is almost twice faster than XNA and C#.
Oh? May we see this test program? What's the experience of the programmer in each language, are they an expert in both and therefore able to utilise each language and technology effectively?

I'll also observe that no beginner is skilled enough with C++ to write an optimal program which will outperform a reasonably written C# equivalent; they'll have enough problems gettings things working at all let alone working optimally.

I've seen you recommend C++ while slandering C# in a number of threads, but you never did end up responding properly when I challenged you on it in the other one -- in short, put up or shut up -- you're welcome to give your opinion on languages as you wish, but if you're going to keep making claims like above it'd be nice to see you back it up.

Quote:
Then you'll have another great benefit, portability. A game made with C++ and OpenGL can be buil and compiled in many different machines and OS, like Linux, Unix, Mac, etc.
Only if you've designed and written your program very carefully in order to be portable. Using OpenGL (and/or other cross-platform libraries) does not automatically guarantee the portability of your program. Note also that you'll have to compile a seperate binary for each platform; were you aware that a C# program designed and programmed to be portable could potentially run on all of the platforms you named without a recompile (see Mono and .GNU)?

Share this post


Link to post
Share on other sites
Quote:
Original post by tiagomac
Antheus, tnx u very much, i'm very interested now to learn C# :O!
but i'll have to increase my english knowledge first :O!


Increasing your English knowledge is surely a good thing, but people are usually willing to cut some slack for those who aren't native speakers. With that said, though: You can come across a lot better by not writing txtese, and by capitalising properly. For example, if I rewrite your first sentence:

"Antheus, thank you very much, I'm very interested now to learn C#. :O!"

it is clear that it is written by someone who has English as a second language, but it looks much more professional and serious! This is a good way to get better help and better attitudes, and it doesn't require you to learn anything at all, it just needs you to take a little more time with your posts.

Share this post


Link to post
Share on other sites
The current stereotype is C# is slower than c++ maybe some of you c# proponents could run an few tests and prove the stereotype wrong. Flaming ejele for not justifying his claims then claiming c++ code is so badly written its slower(markadrake) with no evidence is hypocrisy.

[Edited by - RobN on May 11, 2007 1:38:36 PM]

Share this post


Link to post
Share on other sites
Another thing you might look into is Visual C++ with Managed Extensions. This will allow you to program in a safer C#/Java like environment with the 'option' to use C++ features. This is much like writing a program in C/C++ and having the 'option' to use assembly.

KW.

Share this post


Link to post
Share on other sites
Quote:

The current stereotype is C# is slower than c++ maybe some of you c# proponents could run an few tests and prove the stereotype wrong instead of shooting people down. Flaming ejele for not justifying his claims then claiming c++ code is so badly written its slower(markadrake) with no evidence is hypocrisy.

Here's the thing. Benchmarking languages is pretty much meaningless. A language itself is little more than a gloried BNF grammar and some assorted rules as defined by the language's standard. When people discuss the relative "performance" of "language X" versus "language Y," then those people are doing one of two things:

a) demonstrating their relative ignorance of the field of computing and language theory, or
b) eliding (because it is understood, hopefully, by all parties involved) the assertion that the comparison is less to do with X versus Y and more with particular implementations of those languages being applied to particular solutions to particular problems.

ejele's comments about the relative performance of C++ versus C# seem to be grounded firmly in the realm of (a), since he has never bothered to follow up with concrete evidence of anything.

Furthermore, when we consider (b), we note that it deals entirely with specifics. Benchmarking those things is exceedingly difficult, because performance, in general, is a very fickle thing influenced by a number of subtle factors. Many C++/C# benchmarks are exceedingly flawed, written by people without sufficient experience in one or both languages; C++ and C# (and any two languages, in general) are far too different in underlying paradigms and concepts they use to be compared naively by using nearly-identical (as near as is required to compile) source code -- but that's what most "benchmarks" do.

The problem with benchmarks is that they are not conclusive, especially performance benchmarks, since (again), performance is such a subtle thing. You cannot make definitive unilateral claims about performance (especially between something inherently non-performant like a language). But that's what ejele (and others) are doing, and that's why they are more than deserving of the criticism they're getting.

Benchmarks can only provide conclusive results within constraints; that is, based upon the context of the benchmark. It is trivially true to write benchmarks in any two languages that illustrate that either language is "slower" than the other, just by doing stupid things like putting in delays. Those benchmarks are obviously flawed and there results useless. But this is exactly the same problem most C++/C# benchmarks have, although the problems are usually a little harder to detect than simple delay loops.

The reason people challenge claims like ejele's are because the results of a benchmark are useless without the benchmark itself -- the actual code used, the way the code was built, and the conditions under which the code was executing. Until such time as that code is provided, any claim using the results of the benchmark is bogus; and even once you have the code, again, the benchmark does not provide a definitive assertion that is correct in general, just some conclusions that can be extrapolated to a small degree within the context of the benchmark.

Share this post


Link to post
Share on other sites
Quote:
Original post by RobN
The current stereotype is C# is slower than c++ maybe some of you c# proponents could run an few tests and prove the stereotype wrong instead of shooting people down. Flaming ejele for not justifying his claims then claiming c++ code is so badly written its slower(markadrake) with no evidence is hypocrisy.


It is hard to prove it wrong as any benchmark is biased, as soon as you move above assembly language you will rely heavily on the compiler for performance.
there are situations where for example icc can give 15-20% faster code than mvsc(express or standard) using the same source and others where they are close to equal. (pro versions and above of msvc has more advanced optimization methods avaliable though and generally gives performance on the same level as icc on the x86 platform)

as it is today the high end c++ compilers do often produce slightly faster code than .Net on the x86 platform. (However the best C++ compilers are not free)

Oh, here is a little benchmark showing Java (Or more precicely, Suns Java Server VM) kicking G++ (a popoular C++ compiler) in the nuts
http://kano.net/javabench/

Ofcourse the author is a bit of a Java fan so its probably biased (and he only tests with i386 or i686 optimizations) but it still shows that Java is fully capable of beating some C++ compilers in some situations.

Edit: Sourcecode for the tests are avaliable, the author ran the tests on a intel P4 cpu (the C++ programs were only using P2(i686) optimizations), so there are definitly easy methods to further boost performance of the C++ programs there. -march=pentium4 is one way -mfpmath=sse -msse -msse2 is another however by using those compile flags it would only run on P4 or equivalent (or better) hardware, Java and C# optimizes its code when the user runs the programs and thus always optimizes for the current hardware. (You can work around this with C++ by either releasing the sourcecode or by releasing multiple binaries)

Share this post


Link to post
Share on other sites
Quote:
Original post by jpetrie
The reason people challenge claims like ejele's are because the results of a benchmark are useless without the benchmark itself -- the actual code used, the way the code was built, and the conditions under which the code was executing. Until such time as that code is provided, any claim using the results of the benchmark is bogus; and even once you have the code, again, the benchmark does not provide a definitive assertion that is correct in general
Exactly, and you'll note that I specifically refrained from making any claims of my own when I challenged ejele to back up what he was saying. I have no doubt that there are probably situations for which results such as those he speaks of can be produced, but the questions I'm interested in are:
  • Are those situations particularly relevant? Is the test-case he mentions something that's likely to be generally applicable to a significant portion of programs?

  • Was the test-code actually a correct optimised and idiomatic usage of both languages tested, or are the results flawed by one of the languages being used incorrectly/poorly.

  • Has he actually either done or seen the tests, or is he just spouting made-up statistics?

Share this post


Link to post
Share on other sites

This topic is 3870 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this