Jump to content
  • Advertisement
Sign in to follow this  
TheUnbeliever

Game Development in C?

This topic is 4831 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've not really done much in game development other than some Managed DirectX stuff from C#.NET and VB.NET. I'm in the process of learning C++, but I'm tight for time at the moment so I'm going quite slow (I've got most of it down now, just working on OOP which looks quite interesting). I've got a good deal of experience in C, and was wondering if game development really needs object-oriented stuff and if it would be possible to write a simple non-console game in C(I realise that it the answer is almost certainly no or yes, but it's very difficult)? It'd be an answer to satisfy my curiosity really, I've got another ongoing project at the moment but I'm interested to know.

Share this post


Link to post
Share on other sites
Advertisement
You could write a game even in assembler, oop isn't strictly necessary to write a game, it only make things easyer to manage and cleaner to write end edit and read.
If you have experience with C# and managed code, what is holding you to learn c++ ?

Share this post


Link to post
Share on other sites
Yes you can!

Take SDL and OpenGL for examples that don't require C++. So you have everything you need to start writing your game in C.

Share this post


Link to post
Share on other sites
No a game doesn't necessarily need it, and you are not forced to use OO & OO support provided by C++. C++ is a multiparadigm language and doesn't force into any particular style.

Personally i wouldn't touch pure standard C, not because it is hard or anything like that but because it's pain in the arse to work with and deals at a much lower-level than what you would like to work with in problem domains like games/apps.

So i'd say to use C# or C++ or any other language you feel most comfortable with.

Share this post


Link to post
Share on other sites
That sounds good thanks for the informative replies guys. :)

The reason it's taking me a while to learn C++ is the OOP stuff is quite complicated-seeming, so I'm taking it slow. I know VB and C# are OOP as well, but I didn't really use complex OOP at all.

@snk_kid - Thanks for the advice... I might well use C#.NET a few times, I've come to like it quite a bit (and VB.NET only beats it as my favourite RAD language because VB.NET 2005 has a handy My namespace that saves the odd few lines of code) recently.

Share this post


Link to post
Share on other sites
I use C, dev-c++ and sdl and it works fine for what I want to do at the moment.

Share this post


Link to post
Share on other sites
OOP just makes things easier, games are inherently OO because we usually have objects interacting in a game world.

Share this post


Link to post
Share on other sites
Quote:
Original post by TheUnbeliever
That sounds good thanks for the informative replies guys. :)

The reason it's taking me a while to learn C++ is the OOP stuff is quite complicated-seeming, so I'm taking it slow. I know VB and C# are OOP as well, but I didn't really use complex OOP at all.

@snk_kid - Thanks for the advice... I might well use C#.NET a few times, I've come to like it quite a bit (and VB.NET only beats it as my favourite RAD language because VB.NET 2005 has a handy My namespace that saves the odd few lines of code) recently.


If you do go down the C route you can always adopt a procedural approach in C++ (even a functional one is possible! FC++) the advantage of that for you would be; you are already familiar with C-ish languages (C and C#), there is always other features you can use any time that C doesn't have, save you time from reinventing unnecessary things and focus on the problem at hand instead. In C you have no standardized generic lists, vectors, sets, strings etc but C++ provides those kind of things (check here). So you all you need is a tiny bit of knowledge about templates (at least enough to be aware of them) and know about C & C++ standard library (which you are most of the way there already).

C# is great and has its own advantages aswell.

Share this post


Link to post
Share on other sites
If you're happy with OO and find reason enough to use it and make your coding life more productive/easier etc....then Id say thats the way to go. I on the other hand program in C, it's my preferred language. I work for a developer and we use C all the time. Practically the whole gamecode for Lego Starwars was written in C and I find it easy to debug and quick to develop in.

GCoder

Share this post


Link to post
Share on other sites
I've seen both easy to follow x86 asm and C++ so hard to follow it brought tears to my eyes. Code quality has actually very little todo with language and quite much todo with developer skill and priority. That said some languages do promote good conventions and are better at convincing people to not abuse them.

But C is a viable choice for games alright, I myself prefer C++ for larger endouvers since it helps raise the abstraction level but each to his own.

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.

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!