Sign in to follow this  
gp343

Are there any big Commercial Games in C?

Recommended Posts

With C++ being so popular, I was just curious if there are any Big time commercial games in C or if people are still using C to develop commercial quality games?

Share this post


Link to post
Share on other sites
Well, the root of my question is that I'm a Java developer who's interested in moving over to C or C++ for Games development. However, judging from the questions/comments I see in forums, it appears that the majority of Game developers uses C++. With that in mind, it appears pointless in learning C - although C may have a shorter learning curve than C++?

Share this post


Link to post
Share on other sites
Quote:

However, judging from the questions/comments I see in forums, it appears that the majority of Game developers uses C++. With that in mind, it appears pointless in learning C


So you believe it's "pointless" to learn a language just because the majority of game developers don't use it? You couldn't be more wrong. First of all, do you really think that professional gamedevs only know C++? They probably know a dozen of languages. And second, are you a professional developer? No. So you don't have to work with the constraints they do(compiler support, legacy). Learn a lot of languages, and pick the best one for the job judging by *your* conditions and requirements, not by someone else's. For example, I know C++ but I have decided that I program mainly in Python, because it serves me better. Merely imitating professionals and using whatever tool they happen to use doesn't make you a better programmer.

Share this post


Link to post
Share on other sites
I wonder, how you could avoid learning C while learning C++... C is basically a subset of C++.

But to your question: I think that Doom, Quake 1 and/or 2 were written in pure C. But I'm not 100 percent sure.

Share this post


Link to post
Share on other sites
Quote:
Original post by gp343
However, judging from the questions/comments I see in forums, it appears that the majority of Game developers uses C++.

The majority of game developers on forums never finish their games, either.

Quote:
...C may have a shorter learning curve than C++?

Not really, and certainly not to a Java developer. Besides, C++ is an imperfect superset of C, so you can employ almost all C techniques in C++, though you really should learn C++ techniques and idioms.

Either choice is functionally adequate. There may be external constraints for you that will dictate one language over others, but as far as intrinsics go, C, C++, Java, Python, etc, etc, etc are all valid choices for game development.

Share this post


Link to post
Share on other sites
Well, 'learning C' is not something you can avoid when doing C++. It's practically the same language, the only difference is in techniques used due to the fact that C doesn't have an object-oriented flow.

But, when it comes down to it, I can tell you that yes, some game developers do use normal C. I work for a console games developer, and the engine we use is mostly standard C style, with a few classes here and there.

Just use whatever style/approach you feel comfortable using. TBH i prefer the class-based approach, but have to accept writing normal C style code for the majority of my work.

Don't rule anything out, just make sure you're familiar with the different techniques used in old-style C code, in case you find yourself needing to use them yourself.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dinsdale
I wonder, how you could avoid learning C while learning C++... C is basically a subset of C++.


You could avoid learning, for example, the C way of handling strings(with char*, strcmp,strcpy and whatnot) and learn the C++ way of handling strings(std::strings). You could avoid malloc and use new. You could avoid learning the likes of printf,scanf and learn streams. You could avoid learning how to implement virtual function tables by learning how to use virtual functions. Same for a lot of things that are handled differently in C and C++.

Share this post


Link to post
Share on other sites
Quote:
Original post by mikeman
You could avoid learning, for example, the C way of handling strings(with char*, strcmp,strcpy and whatnot) and learn the C++ way of handling strings(std::strings). You could avoid malloc and use new. You could avoid learning the likes of printf,scanf and learn streams. You could avoid learning how to implement virtual function tables by learning how to use virtual functions. Same for a lot of things that are handled differently in C and C++.


Yes. But those things are not language constructs, those are more or less the same in both. It's more a 'coding style' question. You can always use malloc/free in C++ if you want :)



Share this post


Link to post
Share on other sites
Quote:
Original post by Dinsdale
But those things are not language constructs, those are more or less the same in both. It's more a 'coding style' question.
If you qualify "learning" a language as being nothing more than learning the language constructs, then sure, they're pretty similar. Personally, I would say that it's pointless defining learning in that manner because the constructs have been designed to be used in particular styles, and if you don't learn those styles as well then you're missing the point of the language. You can use a hammer to put a screw into the wall...

Share this post


Link to post
Share on other sites
Quote:
Original post by Dinsdale
I wonder, how you could avoid learning C while learning C++... C is basically a subset of C++.

But to your question: I think that Doom, Quake 1 and/or 2 were written in pure C. But I'm not 100 percent sure.

Yes some of the most popular and successful pc games were written in C or C++. You can google quake source code to see for yourself. Homeworld,mechwarrior,allegiance not to mention valve sdk source code is also available so you can get an idea of what you are up against. Just realize that you will see some bastarized C/C++(mixed with some assembly here and there)since standards/good coding goes out the windows when you are trying to ship a game on time for the holidays-LOL! If I recall even John Carmack commented in an interview how he cringed at some of the early quake code and how horrible it was to him looking back after several years since his coding skills got better of course.
As far as you coding choice C vs C++ actually if you get a decent book like "accelerated c++" that shows you how to program C++ the modern way it's intended and using the standard library it can be easier and you'll be more productive than using old C. Just do everyone a favor and get a decent book so I don't see more people posting C/C++ programs mixing printf and cout, malloc and new in the same program!
I'm sure there are more than one person that wishes C would go completely away-- it's not any time soon so if you code in C++ long enough you'll bump into it eventually even if you don't plan on learning it!

[Edited by - daviangel on May 12, 2008 11:18:02 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by gp343
With C++ being so popular, I was just curious if there are any Big time commercial games in C or if people are still using C to develop commercial quality games?


Yes, and no. A lot of commercial games are done in C++, but are done without using any of the OOP features. So pretty similar to C. As far as commercial games being done strictly in C only, I would say that's most common for handhelds, or anytime that memory is at a premium(since C++'s standard library takes up memory, and is required, unlike C).

Hope that helps.

Share this post


Link to post
Share on other sites
Every (commercial) game I've ever worked on has been a bastardization of C and C++. So, yeah, it's still somewhat relevant (although most new codebases are probably a little nicer that the legacy crap I deal with).

Although I do agree that not learning something because it's not widely used in game development is a bad idea. One of the most important aspects of a programmer's job is to use the right tools for the job. The more tools you know how to use, the bigger your toolbox will be when it comes time to get the job done.

Share this post


Link to post
Share on other sites
One currently active AAA game that uses C is Dark Age of Camelot. Mythic had a solid code base they had used for their old text based multiplayer games for years. So when they started work on DAOC, they used that old server code as the foundation. Both C++ and C were used on the client side.

Share this post


Link to post
Share on other sites
Quote:
Original post by gekko
Nintendo still has projects done in C.

As does Microsoft.

Actually, I went to a MS lecture on how to multi-thread your games recently where they showed some source code from "a xbox 360 racing game" as an example of the techniques being explained, which was all pure C. memcpy FTW! ;)

Share this post


Link to post
Share on other sites

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