Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Fishy1500

Game programming in C#, a wise decision?

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

Ok i know there are many threads on which is better, C# or C/C++ but I still haven''t really gotten a clear cut answer. I''ve been programming applications at work (not games) in C# and the .NET framework for 2.5 years now and I''m very comfortable with it. I''m not as comfortable with C++. What I want to figure out is will I regret learning how to program games with C# as opposed to C++... Right now my aim is to learn, but i don''t want to spend all this time making myself familiar with game programming in C# if in the end, C++ is actually preferred. I don''t mind the legwork of relearning what I learned in college (C++), i just want to start off on the right foot with game programming (something I have always wanted to do). Any help would be deeply appreciated. Fishy

Share this post


Link to post
Share on other sites
Advertisement
quote:
will I regret learning how to program games with C# as opposed to C++


no. not at all.

learning the basic (and not so basic) algorithms behind game programming is pretty much language independant. I learnt alot of my tricks using VB6

quote:
C++ is actually preferred


if you wanna break into the industry then yeah, C++ is usually preferred. Entirely depends on where you wanna go and how far

quote:
i just want to start off on the right foot


you can get there through either route. Just bare in mind that with game programming there are 10x as many (good) resources for C++ as there are for C#, I find that a convincing argument to stick with C++. I think you''ll find that most people on these forums are C++''ers.

Jack

Share this post


Link to post
Share on other sites
I''d actually suggest C++, at least for now.. C# is a very very nice language, but it is still lacking in libraries for game development, imo. Sure, there are a few helpful things like SDL.net and so on, but none of these is as mature as the C++ libs (especially in documentation). You''ll end up having to write a lot of things that you could have gotten from elsewhere had you used C++.

At least, that''s my experience.. Doesn''t keep me from using C#, but I am rather glad I have the C++-background to help me with building the things that I need myself.

Share this post


Link to post
Share on other sites
Currently, C++ is _the_ language for games, however I prefer C# ;-)


Have fun
Bunnz
Purple#, a shader-driven game engine for .NET.


[edited by - Bunnz on April 14, 2004 7:40:10 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you''re doing indie stuff, then I''d say go for C# or Java.

Share this post


Link to post
Share on other sites
Thanks for the help guys, I really appreciate it. I think I'll start with C# to learn basic concepts first, and then move over to C++ once I revive the knowledge a bit (its been a couple years since i used it in college)

I think the one thing I find a little frustrating everytime I peek into a C++ windows game app and try to figure out what's going on is all the windows specific code! Its really really ugly... whereas windows forms i am pretty familiar with. I just didn't wanna get bogged down by these sorts of things.

I figure I'm gonna need to learn how to make games in C++ if I'm ever going to really look for a job in the gaming industry.

I doubt I will ever start my own gaming studio... if i'm looking to start a business, it would be more along the lines of b2b enterprise type stuff. Games are just fun, and I'm very excited to learn, experiment, and just be a part of this community.

Btw i'm working on a C# tetris right now, wish me luck! *i drew a flipping game piece so far hehe*

[edited by - Fishy1500 on April 14, 2004 11:13:09 AM]

Share this post


Link to post
Share on other sites
Yes, C# does make window creation and control easier to make. However, the window is only created once in most games and after that, alot of the code becomes Win API independant. Once you get past the window code, you will feel much more comfortable coding in C++.

If you wanted something as easy as C# for making a window in C++, you could try a few libraries

GLUT
GLFW
SDL

and a few others. The 3 listed here are mainly for creating windows with OpenGL support, but have the advantage of supporting many many platforms such as linux/mac/etc.. They also do input, and some offer multithreading/sound/etc as well.

If you are using DX, then Win32 API should look familiar to you anyway.

C++ has 2 big advantages over any other language in game development which is portability and the immense number of support/source code/libraries/tutorials.

Share this post


Link to post
Share on other sites
GamerSg's reply is pretty bad so I just wouldn't pay attention to it.

Window creation is not the big hype of C# at all, considering you could use c++ builder if you really wanted to.

C# uses managed libraries, is a native .NET language, the future of Windows programming, and can fully use managed directX which is a much nicer API.

The tradeoff is 3-5% performance.

And considering that more than 99% of the people here couldn't even optomize their c++ applications to use every last ounce of power the point is moot and the majority of projects posted here will run the same, language doesn't matter at all.

If you want to code for consoles C++ is the way.

[edited by - Imperil on April 14, 2004 3:49:03 PM]

Share this post


Link to post
Share on other sites
Via P/Invoke, you can easily set up your basic game-friendly message loop in C# very similar to the one that you'd use in a C/C++ Win32 game and still take many of the advantages of using windows forms. I personally feel the window creation process using .NET windows forms is much more intuitive and simpler than the window creation process in a C/C++ Win32 program, and another benefit I find with C# is the use of event handlers to handle window events rather than coding the Win32 equivalent as a monolithic switch statement. Once you set up your message loop, it's pretty straightforward from there.

[edited by - MRom on April 14, 2004 6:40:09 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!