Getting started with game programming - some newbie questions

Apprentice
Posts: 5
Joined: 2009.03
Post: #1
Greetings, everybody!
I am yet another newbie programmer with some game-design ambitions, but a definite lack of vital knowledge.
Before I ask my silly questions, I'll let you know that I have a small background in PHP programming (I have written my own CMS for a recipe site. It's simple, but proves I know the basics at the very least), so I understand many general programming basics.
What I don't know is this: If one plans to write video games, probably just targeted at close friends to begin with, in the pixelated 2D style associated with the Nintendo Famicom and Super Famicom, where would one begin?
I've got the latest version of the Apple developer tools, along with a few books on Objective C/Cocoa books (mostly from 2002), but I'm not sure if that's the right path. Some people reccomend C++, apparently, others reccomend C, others reccomend scripting languages, and I have to admit I'm a little lost.

So, okay. Goals defined, skills defined and question asked. I guess that's it. If any of you gurus have any advice for me, I'd greatly appreciate it. I realise that these types of questions must be pretty common-place, and probably a bit annoying by now, but I just want to be completely sure before I start learning a language I might not be able to use.
Thank you for your time!
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
Neptunus Hirt Wrote:I just want to be completely sure before I start learning a language I might not be able to use.

I don't think you'll need to worry about this, for two reasons:
1. Almost any language you learn will be useful in some context. Most the ones that aren't are usually toys that are a good mental exercise anyway.
2. Once you learn one language, it becomes very easy to learn another.

I got my start with somewhat limited high-level scripting languages and didn't learn C until later. I've managed to make things I'm proud of in every language I've put the time in to learn properly, so you should really just be able to pick one and run with it. One thing I would recommend would be not to try to learn C++ or Objective-C until you know C; learning C first gives you a good grounding in the fundamentals on which its derivatives are based.
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.03
Post: #3
ThemsAllTook Wrote:2. Once you learn one language, it becomes very easy to learn another.
This is where I hope my efforts to learn PHP will help, although I guess it's a bit different.

ThemsAllTook Wrote:One thing I would recommend would be not to try to learn C++ or Objective-C until you know C; learning C first gives you a good grounding in the fundamentals on which its derivatives are based.
Okay! That's a good idea, especially since from what I gather, Ob-C is something like an extention of C, so learning C first should help keep them distinct in my mind.
Thanks a lot for your insight, I appreciate it. One more thing: Can you tell me about some games you know were coded in C? Just so I can understand what it's capable of.
Now, to go find some books on C.
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #4
Neptunus Hirt Wrote:One more thing: Can you tell me about some games you know were coded in C? Just so I can understand what it's capable of.

There are many high-end titles which have been written in C. Many of the old id and Bungie titles were written in C, like Marathon, Doom, and even Quake3. Nowadays there is a preference in the industry to use C++, but C is capable of being used for anything, and as ThemsAllTook said (sort of), you pretty much need to learn it anyway.
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #5
C++ is easier than C imo. For instance in C strings are very cumbersome, as is making variable sized arrays etc. the STL libraries make these things very easy in C++.

If you have some experience in php you will know about objects and classes, which work similarly in C++, so maybe you'll be more comfortable in C++.

You will need to learn about pointers though, that might be a bit tricky.

If you want a simple cross platform game library to get you started fast check out SDL http://www.libsdl.org/, download the development libraries (framework), install it as described, you should be able to chose "SDL Application" when you make a new project, that should get you started.

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #6
Najdorf Wrote:C++ is easier than C imo.

That's like saying Calculus is easier than Algebra! C++ is *vastly* more complicated than C.
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #7
AnotherJake Wrote:That's like saying Calculus is easier than Algebra! C++ is *vastly* more complicated than C.

Well the language has more features hence it's more complex, still using the "easy" subset of C++ takes very little more knowledge and makes writing programs easier. Also typically C++ libraries are easier to use than the equivalent C library and with the STL containers you can mostly avoid memory management.

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #8
Najdorf Wrote:Well the language has more features hence it's more complex,
So there you go. You wanna learn C? Read a book with less than 300 pages in it. You wanna learn C++? Read a book with like three times that much. Then go try to read a book that might make sense out of some of it. Really, C++ is incredibly complicated. One of the best tomes of information about C++ I've ever read is Bruce Eckel's "Thinking in C++", and even he makes the assumption that the reader has already learned C.
Najdorf Wrote:... still using the "easy" subset of C++ takes very little more knowledge and makes writing programs easier.
I categorically disagree with the notion that C++ somehow makes writing programs easier than C for beginners. That is simply not true for most people.
Najdorf Wrote:Also typically C++ libraries are easier to use than the equivalent C library and with the STL containers you can mostly avoid memory management.
Avoiding memory management is a terrible excuse not to learn C, and it's an especially terrible argument in favor of learning C++ *first*. The amount of C++ code I've read over the years which was clearly written by folks who have no idea what they're doing is the *number one* reason why I complain about C++ (even though I use C++ myself from time to time). There is just so much junk out there that I cannot in my right mind advocate beginners trying their hand at C++ first.

I have no idea where you got the idea that C++ libraries are typically easier to use than the equivalent C library. There are good and bad libraries all over the place, and that has little to do with the language, but rather the API designer's inability to present a coherent and understandable interface. What I see in terms of poor libraries are:

- C libraries sometimes have very little or no documentation in the headers. The designer feels the user should read their docs instead, which are sometimes garbage too, or worse, that the programmer making use of it should somehow divine the usage out of their clever function names. On top of that, some coders feel that a name like strcmp somehow makes life easier than stringCompare. So yes, I agree, the C standard library leaves much to be desired, but that is hardly representative of all other C libraries.

- C++ libraries sometimes have automatically generated documentation from comments in their code. This can be absolutely horrid and has no use whatsoever but to confuse things further and obfuscate the purpose of the class. A recent library I've been using which illustrates this with crystal clarity is the FBX SDK. The separate written documentation for it adds little help. The demo code is buggy, but is arguably better at illustrating its usage.
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #9
Why would avoiding dynamic memory mg be a bad thing for a beginner?

c++ object structure makes many operations-libraries less tedious/weird. Do you prefer working with a pointer to char pointers or a vector of strings?

Its not about how much time you need to read a book with all the keywords , its about getting things done.

If you're saying c coders in average are better coders than c++ then yeah just as assembly coders are even better and basic coders are worst. The harder the language the better the coder must be to use it, raising the average level.

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.03
Post: #10
This discussion I seem to have spawned has been very interesting to read, arguments from both sides are pretty compelling.
I think I'll start with C (need some books/ebooks/tutorials, any suggestions? Short on cash right now, so free/cheap is a big plus), then move to Objective-C, perhaps assimilating knowledge on C++ and Objective-C++ later. So many languages, so little time!
@Najdorf: Thanks for your pointer about SDL, that looks promising.

Thanks for your input, everyone!
I'm looking forward to being part of this community, it's a real diamond in the rough. Hopefully I'll be able to make something resembling a game in the next decade. LOL
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #11
Najdorf Wrote:Why would avoiding dynamic memory mg be a bad thing for a beginner?
If automatic memory management is a valid argument to learn C++ first over C, then I'd say you might as well learn Java first! Memory management is a fundamental concept in both C and C++. Skipping it is a terrible idea.

Najdorf Wrote:c++ object structure makes many operations-libraries less tedious/weird.
That has nothing to do with it being easier to start with than C, and that argument is highly debatable anyway.

Najdorf Wrote:Do you prefer working with a pointer to char pointers or a vector of strings?
They both have their issues. Personally I prefer good ol' printf, but that's not why I'd recommend starting with C over C++.

Najdorf Wrote:Its not about how much time you need to read a book with all the keywords , its about getting things done.
Huh? How are you supposed to get something done if you don't know how to use the language? You have to read a book or something before you'll gain the knowledge of how to use the language. Your argument doesn't make much sense to me. C++ is much much harder to learn than C, and for the most part you'll be learning C anyway if you're learning C++.

Najdorf Wrote:If you're saying c coders in average are better coders than c++ then yeah just as assembly coders are even better.
That's not even sort of what I said. Rolleyes

Look, IMNSHO, jumping right into C++ is a bad idea. It's fine to learn later on, if that's what you want to do. I'm not saying a person has to master C. I'm not suggesting C is better. I'm not suggesting you suck if you use C++. I am saying what I've said over and over: The vast majority of C++ code out there is utter junk, and the reason why is because a lot of coders don't know how to use it, because it is way too complicated. They start with bad habits and they continue those bad habits. Learn the fundamentals properly and you will likely write less crappy code. And skipping memory management is a sure recipe for disaster in C/C++.
Quote this message in a reply
Member
Posts: 44
Joined: 2008.12
Post: #12
I'm surprised no one has mentioned Java as a beginning language. When I was in college, the intro classes used Pascal then we graduated to C++ in the advanced classes. Shortly after I moved up to C++, they switched to Java for the intro classes. I wished I had taken those intro classes instead as Java seems a much more useful language than Pascal.

Its been a long time since I've used C++, but I remember having a lot of problems with memory management. Director, the current environment I am using uses automatic memory management (though you can override some of it if you need to). I've been glad not to have to deal with it.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #13
AnotherJake Wrote:Look, IMNSHO, jumping right into C++ is a bad idea. It's fine to learn later on, if that's what you want to do. I'm not saying a person has to master C. I'm not suggesting C is better. I'm not suggesting you suck if you use C++. I am saying what I've said over and over: The vast majority of C++ code out there is utter junk, and the reason why is because a lot of coders don't know how to use it, because it is way too complicated. They start with bad habits and they continue those bad habits. Learn the fundamentals properly and you will likely write less crappy code. And skipping memory management is a sure recipe for disaster in C/C++.

Learning C++ isn't bad. Using it is Rasp

I've been coding almost exclusively in C++ for almost a decade (before becoming overly frustrated), and on the mac, Objective-C is certainly the better choice. C++ is not healthy. As it's been said, it is a complex language, and a large majority of code in the wild is horrible. If you do choose C++, it is imperative that you also learn other, more 'esoteric' programming languages, unless you want to cripple your brain.

*Manual* memory management is definitely not a topic you should skip, unless you want to become a Java drone. You may be able to drive without knowing anything about your car, short of what the steering wheel and pedals do, but if you don't know how to adjust your suspension, you won't win a race.
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #14
DoG Wrote:*Manual* memory management is definitely not a topic you should skip, unless you want to become a Java drone. You may be able to drive without knowing anything about your car, short of what the steering wheel and pedals do, but if you don't know how to adjust your suspension, you won't win a race.

Good analogy!

And to be clear, I'm not saying automatic memory management is a bad thing later on, when you know what you're doing and feel it'd be more convenient. But beginners must learn to manually manage their memory first or risk certain doom at some point. This doesn't count for Java or Director, or any other language which runs inside a virtual machine since no harm can be done there (theoretically), and they are usually designed to automatically handle memory from the ground up anyway. However, C/C++ (and Objective-C) run directly on the CPU (no safety net like a virtual machine) and the computer is rather unforgiving of sloppy memory management.
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #15
Jake my point was that even if a language has less features than another (hence the "book" is smaller) it does not mean its easier to use, quite the opposite. Assembly has very few commands still its certainly not easy to use. High level languages with more features tend to be easier.

And yeah i would probably recommend a higher level language still i was focusing between c and c++. I won't judge obj c since im not confortable enough with it to give an opinion.

And really using stl i never had to do any memory allocation-freeing except when a library forces you.

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Newbie here! I'm gonna make my first iPhone game youngn 2 3,088 Sep 14, 2012 11:45 AM
Last Post: youngn
  Newbie Question: Making a multiplayer collectible card game Extra Turn Games 1 5,648 Jan 25, 2012 10:21 PM
Last Post: mikediamond10
  Soliciting ideas for game programming "tips" SethWillits 9 6,879 Apr 13, 2010 10:54 PM
Last Post: reubert
  Game Programming Blogs? intregus 2 4,674 Jul 1, 2009 12:54 PM
Last Post: intregus
  Pangea's Ultimate Game Programming Guide for Mac OS X is now free Zwilnik 15 8,146 Jan 31, 2008 02:45 AM
Last Post: ynda20