Starting from scratch? (PHP Background)

Member
Posts: 198
Joined: 2005.01
Post: #16
AnotherJake Wrote:If C is good enough for John Carmack to get all the way to Quake3, it's good enough for... well, any game you can imagine.

I think that's beside the point Smile

Both C and C++ are turing-complete languages, as are pretty much any other modern programming language. You could write object oriented assembly for that matter. But why subject yourself to the extra pain of doing it by hand when the compiler is there to do it for you? I think that's what they meant.

After all, C++ just started out as a C preprocessor that adds a hidden "this" argument to method calls, and function pointers for virtuals.

Cryptic Allusion Games / Cryptic Allusion, LLC
http://www.cagames.com/
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #17
Dan Potter Wrote:I think that's beside the point
???

The argument I attacked is that "C isn't as good as C++ for games" and I offered a pretty logical counter.

Dan Potter Wrote:But why subject yourself to the extra pain of doing it by hand when the compiler is there to do it for you?
How is using C++ not "doing it by hand"? Rolleyes
Quote this message in a reply
Moderator
Posts: 529
Joined: 2003.03
Post: #18
(waits for thread to get ugly)

"Yes, well, that's the sort of blinkered, Philistine pig-ignorance I've come to expect from you non-creative garbage."
Quote this message in a reply
Member
Posts: 198
Joined: 2005.01
Post: #19
Leisure Suit Lurie Wrote:(waits for thread to get ugly)

Hah! I really couldn't care less about the subject. Perhaps it'd be better to pretend I didn't comment.

It's just that there are two common rants between "C people" and "C++ people". The one AnotherJake already covered ("C can't do stuff C++ can!!") with a good rebuttal. The other, "there's no good reason to use C++ for games because Mr. X-and-Foo didn't" is what I was covering. The C++ compiler inserts "this" pointers and handles the function pointers for you, so you might as well use it. That's why it's less manual. Whether that's a good thing or not is a whole other debate... Smile Arguably it's more intuitive though to do:

robot->move(2, 10);

than:

robot->move(robot, 2, 10);

Anyway, ignore me.. back to your regularly scheduled new game code help. Smile

Cryptic Allusion Games / Cryptic Allusion, LLC
http://www.cagames.com/
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #20
Ignore me too. No ugly thread needed.

Dan Potter Wrote:Arguably it's more intuitive though to do:

robot->move(2, 10);

than:

robot->move(robot, 2, 10);
"Arguably" being the operative term here. It does suck that "this" has to be passed to the object for it to have a sense of "self" with C. I guess I'm just saying that it can be done to good effect with C regardless. You nailed the central theme though. Things get twitchy right there. Built-in flexibility with C vs. built-in functionality with C++? For those who don't know, please don't pee on C for it's *apparent* lack of functionality.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #21
I'd rather stick to good ol' dependable C than get stuck in a quagmire of multiple virtual protected inheritance with templates, operator overloading and copy constructors in C++ Wink
Quote this message in a reply
Member
Posts: 198
Joined: 2005.01
Post: #22
OneSadCookie Wrote:I'd rather stick to good ol' dependable C than get stuck in a quagmire of multiple virtual protected inheritance with templates, operator overloading and copy constructors in C++ Wink

Heheh... C++ certainly does give you plenty of rope to hang yourself. Then again the existence of raw pointers in both kinda does that. Smile

Cryptic Allusion Games / Cryptic Allusion, LLC
http://www.cagames.com/
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #23
I love C and have done Object Oriented in it. However, I still think C++ is better suited for large game engines. Besides, it would take a much more experienced programmer to do such a thing in C rather than C++.

For my upcoming game engine, I have no doubt that I could write it in C. However, with C++, it will have a much smaller source, be easier to debug, and be easier to add other objects, since I'd like the classes to not only hold the models, but also the AI etc. Sure, it is possible in C, but it's more efficient and less prone to mistake in C++.
Quote this message in a reply
Moderator
Posts: 522
Joined: 2002.04
Post: #24
Why is it so hard to read the question asked in this thread, form an answer, post it, and avoid squabbling over what flavor of ice cream we all like best?

The guy has a strong PHP background, and has used GameMaker before. That should be the greatest influence to a response, I think.

-Jon
Quote this message in a reply
atek3000
Unregistered
 
Post: #25
OK...here's one for you guys.

I'm a Civil Engineering student. I doodle/draw/paint in my spare time...as well as play video games. I did a very rudimentary C++ course during one of my first engineering semesters and loved it. I want to try and find a gaming industry job when I finish my degree in the next 2.5 years so I'm taking courses in art to improve my "skittles" and am looking to learn about game programming.

So...

Very little coding experience...alot of enthusiasm...own a Powerbook. Where do you guys think I should start?

I've been looking online and around this forum for the past few days and I'm coming across terms like "API", "game engine", "OpenGL"...and others. I know what these things are, but nothing about how they come together to make a game.

Any directions people could point me?
Quote this message in a reply
Member
Posts: 63
Joined: 2005.04
Post: #26
I'd suggest you start small.

There's no real easy way to get into it, at least none that I know of. If you enjoy engineering than my guess is that you will be able to pick things up fairly quickly. Programming is kind of like virtual engineering. If you're serious about game development, I'd suggest picking up a few books... OpenGL for 3D, any of the C flavours (c, obj-c, c++)... mind you I am in no way an expert on the subject
Quote this message in a reply
emilmont
Unregistered
 
Post: #27
If you want to see a simple example of "Object Oriented C" you can take a look at: http://www.emilmont.net/?q=node/3

By the way, to start a new game without a well organized team of developers, I suggest to develop in Java and not in C Smile
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #28
And most importantly get something finished and presentable as often as you can, otherwise you will just learn how to program but not what you can do. Which is a lot more satisfying.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
atek3000
Unregistered
 
Post: #29
Wow...thanks for actually responding guys. Smile

I knew learning a programming language would be the obvious place to start, and it seems there is C, C++, ObjC, and Java to pick from. So, I guess my next question is, "Of these, which would be the most beneficial for me to know?".

With school, art, and life...I don't have all the time in the world to devote to learning to program, so I'd like to start out by learning something that will allow me to create a tangible game in the next 2 or 3 years. ..which will be understandably rudimentary...but a game nonetheless.

I don't want to start any wars between purists...hahaha...just wondering which one would be the easiest to learn and let me do cool stuff.

Thanks.
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #30
Java doesn't have much API support in the game industry and is not widely recommended for games. The best scenario would be to learn all three of C, C++, and Objective-C. C++ is a "superset" of C, but it's harder to pick up than just plain C. Objective-C requires you to know C first, but it's really easy to learn after that. So my recommendation is to learn C first and then Obj-C and C++ later - although you can easily make powerful games without Obj-C or C++, all the id games up to Quake3 are pure C if you have any doubts. I should note that C++ is a little more popular for game development these days and you'll see lots of example code using it, so the argument *could* (and probably *will*) be made that you might want to jump in at the deep end and go for C++ right away, but I personally think it's overkill, especially for beginners. Also, most support APIs used with games (OpenGL, OpenAL, etc.) have a C public API so you can utilize those with just plain C skills. For graphics the standard API on the Mac is OpenGL. The quickest way to get into OpenGL is GLUT. If you can learn C and do some stuff with GLUT you will be well on your way.

Another short descriptive comparison of the C family of languages:

C - the basis of it all. It's the fastest and most flexible, but does not have any built-in object orientation facilities which can be seen as a major bummer. However, that does not mean that it cannot be used in an object-oriented fashion as many seem to believe.

Objective-C - is C with object orientation added. It's primarily used on Mac OS X for use with the Cocoa API. Cocoa is Apple's wiz-bang user interface API for making powerful menus and windows, etc. Objective-C is pretty efficient and is fast enough to be used for entire games but many of us just use it for the user interface and leave the faster graphics code in C or C++.

C++ - the focus of bitter debate between lovers and haters. C++ is probably the king of all programming languages today. It's object-oriented and very powerful and basically as fast as C for all intents and purposes. The new id games such as Doom3 and Quake4 use C++ as well as virtually every other major game in the industry. C++ also has the characteristic ability of encouraging programmers to write virtually unreadable code. Make no mistake about it C++ can be *very* complex and can take quite some effort to learn versus other languages, but many would argue the benefits outweigh the drawbacks.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Starting from scratch? (C Background) SLDCGG 6 3,908 Aug 9, 2005 01:13 AM
Last Post: sealfin