• Advertisement
Sign in to follow this  

Engines/games written in pure C not C++

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

I have been trying what to write a game with. language wise. i've used java doesnt work. C# i like but for now cant use it cause i'm gonna be using linux. C++ i like but for some reason i like the C style of writing programs. but i wanna know if there are any commercial console/pc games written in C no C++. thanks.

Share this post


Link to post
Share on other sites
Advertisement
I don't believe it's possible to use managed directx on Linux at all. Therefore, either your using windows, thus C# and managed dx is possible, or your using linux, where although c# is possible dx is not.

Might i suggest a dual boot?

Share this post


Link to post
Share on other sites
i want to give up windows completely thats why i'm using allegro library and C and
i plan to move to allegrogl. i just want to know if C is still used in games. also OOP dont seem to agree with me. i guess i just like the C style more.

Share this post


Link to post
Share on other sites
Can you write games in pure C? Yes of course you can, but why would you want to? There is a reason that people have moved over to OO programing. It is easier to code, debug and test if it is done right. The problem with functional programming is that if you need to make changes you end up having to make changes in a lot of different places. That is one of the major reasons OO programing took off. You keep all your changes in just a few places.

theTroll

Share this post


Link to post
Share on other sites
First, I'd wonder what you mean by "used java doesn't work". In my experience, it works just fine. As for commercial games written in C that you can look at, I believe that Quake III was written in C, and the source to that engine is publicly available under the GPL.

Share this post


Link to post
Share on other sites
Quake2 was written in C, the source is freely available.

I'd recommend to learn C++ over C anyway, because there's really little to benefit from sticking with C. Carmack used it for the Quake series because it was the only thing around when he started programming, so he was most proficient and comfortable with that. As far as syntax goes, you can program in a procedural style with C++ just as well, so that's a non-issue.


EDIT:
Quote:
Original post by lightbringer
First, I'd wonder what you mean by "used java doesn't work". In my experience, it works just fine. As for commercial games written in C that you can look at, I believe that Quake III was written in C, and the source to that engine is publicly available under the GPL.

Quake3 was already partly written in C++, as far as I know.

Share this post


Link to post
Share on other sites
Quote:
Original post by Prototype
Quake3 was already partly written in C++, as far as I know.


Nope, looks like all C. Well, I didn't exactly check every single source file, but there's not a whiff of C++ in there from what I can tell. It even has a bit of assembly :-)

Share this post


Link to post
Share on other sites
Quote:
Original post by lightbringer
First, I'd wonder what you mean by "used java doesn't work". In my experience, it works just fine. As for commercial games written in C that you can look at, I believe that Quake III was written in C, and the source to that engine is publicly available under the GPL.


well i looked around and i could find little thinks related to games. i mean i like the whole embedded games in web browser thing but i can do that in flash cause i learned that from web class so but yeah. so your saying C is phased out like the 60gb ps3?

Share this post


Link to post
Share on other sites
With C, you'd just be setting yourself up for a world of pain. C++ is useful if you actually want to work in this industry, but for the rest of us hobby game developers, there are some alternatives. Things you might want to look at:

JGO
LWJGL
JME
PyGame

Share this post


Link to post
Share on other sites
Quote:
Original post by jamaicandude
i wanna know if there are any commercial console/pc games written in C no C++.


Someone here on the forum mentioned and quoted that one of the developers of halo said that halo was written in c.

Share this post


Link to post
Share on other sites
Quote:
Original post by jamaicandude
i wanna know if there are any commercial console/pc games written in C no C++.

thanks.

I think the better question is, are there any commercial console/pc game written in C++ no C. The answer would obviously be no, although many are mostly C++ they all have some C code in them. There is no shortage of C code in modern commercial software. Some of them don't even use STL :o

Share this post


Link to post
Share on other sites
Quote:
Original post by TheTroll
Can you write games in pure C? Yes of course you can, but why would you want to? There is a reason that people have moved over to OO programing. It is easier to code, debug and test if it is done right. The problem with functional procedural programming is that if you need to make changes you end up having to make changes in a lot of different places. That is one of the major reasons OO programing took off. You keep all your changes in just a few places.

theTroll


Functional programming and procedural programming are completely different.

Share this post


Link to post
Share on other sites
Why not just use c# and opengl? That works great in linux. Check out the tao framework, it provides opengl bindings for c#. Combine that with the c# bindings for SDL and OpenAl, and you have a very nice set of libraries for game development.

Share this post


Link to post
Share on other sites
Your question could be answered at two levels.

Yes, there have been and still are games which are written entirely in C (with some assembly thrown in) on consoles, computers and other devices. Some of these were or are commercial games backed by professional developers. More generally, the C language may well be used by an experienced and competent C programmer to develop a far better game (both in terms of user experience and in terms of code quality) than if developed by an average programmer of another language—I have seen it happen, and it's a beautiful thing to witness. On the other hand, this does require a fair amount of experience and intelligence to get done, and that is much harder to gather than an average amount of experience in, say, Java or C#.

However, your question specifically asked about commercial games, so there seems to be an underlying notion of you writing professional games in the C language. As an independent, it's possible. On the larger "employment" scale of professional development, however, fluency in the C programming language is only an asset if you are just as fluent in other programming languages (and paradigms) as well. In particular, the expert C programmer I mentioned above accomplished tasks with such efficiency because he incorporated many Object-Oriented principles in his (still mostly procedural) design.

So, by restricting yourself to the C language, you can expect to develop games if you are skilled enough, but you should not expect to land a job unless you learn to efficiently use other languages as well.

Share this post


Link to post
Share on other sites
Quote:
Original post by jamaicandude
Quote:
Original post by Aiursrage
I think the torque engine is written in c.


well i know it was written in C++ ;)


From what I recall of seeing a friend who tried to use it, it was C++, just bad C++ (again it was a brief look but it was bad, that much I recall clearly).

Share this post


Link to post
Share on other sites
I think there are some MUDs written in C. Of course they're MUDs and not graphic, so there's not much interest in them usually... (perhaps unfortunately).

Share this post


Link to post
Share on other sites
Hidden
Are you guys for real? :)

This thread is scary. You're acting like C was some kind of strange unheard-of language. "Hmmm... I think *that* game might have been written in C...hmm...not sure....!"

Basically EVERY commercial game from the 80's up to the late 90's were written in C. Console game however were usually written in assembly code, specific for the processor that came with the console. But for PC, C was the language to use. It's only in recent years that C++ became the new industry standard. I, however, don't think for a second that Microsoft does NOT have something to do with it. If everyone is using Windows, and Microsoft has developed a powerful tool to develop programs for Windows, who WOULDN'T use Microsoft Visual C++ ?

I say, if you prefer C and not C++, go for it.... Anyone who says "you can't do X or Y because you're using C and not C++" is an idiot, in my book.

Share this post


Link to post


You can write programs in C++ as if they were C. You can then use the libs and APIs that are C++ interfaces if you need to, but still program the way you want.
Ive been doing that for years (ex- using DirectX but programming the rest with STRUCTs and objectless routines, a bit of ASM if needed, all static data, etc...)

Share this post


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

  • Advertisement