-1

Well, where do I start.

I am a newbie in the programming world. I barely know the basics of C(and am lacking quite a lot). I wish to start coding games with C, not with C++ because I have found out that C++ is much harder than i assumed it was. I checked out the recently disclosed source code of Doom3 and it was written in C++, I didn't understand the code as it was quite OOP(ish).

I did not find the entry point of the game, however I found multiple int main in the source and was baffled.

I read up on game engines, however I still cannot understand them even after multiple reads. I actually don't want to do 2D games, 3D is what i want to do, but I do not know how. How are the graphics made,when you walk how come an object is still there and not disappearing to be redrawn again,how is gravity simulated, and much more.

I am sorry if my question is confusing, I always write whatever pops in my head.

dikidera
  • 2,004
  • 6
  • 29
  • 36
  • 2
    The Doom3 code is not particularly good C++ code. I forbid you from learning C++ from it. If you want to learn C++, learn it from [one of these](http://stackoverflow.com/q/388242/46642) instead. Don't start with a 3D game. Start with something small at first. Once you have some programming skills on your belt, read up on game engines and graphics libraries and whatnot again. I'm sure it will make more sense. – R. Martinho Fernandes Nov 29 '11 at 12:12
  • The reason you saw multiple main functions is nothing to do with C++. It's simply because you're looking at a big complex code base, which consists of several different executables for several different platforms. – jalf Nov 29 '11 at 12:13
  • As I've said, I'd like to avoid C++. I came to like C better. – dikidera Nov 29 '11 at 12:13
  • 1
    you need to learn to walk before you learn to run – AndersK Nov 29 '11 at 12:17
  • 1
    @dikidera: That's a commendable attitude: Always stick to your decisions, never mind you being shown that they were based on wrong assumptions. You will get far with this approach. – sbi Nov 29 '11 at 12:18
  • @sbi: He might be immune to irony – Gunther Piez Nov 29 '11 at 12:29
  • 1
    @dikidera if you want to learn C, the community gathered [a list of good books](http://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list) about it as well. – R. Martinho Fernandes Nov 29 '11 at 12:35
  • @drhirsch: I propose http://irony.stackexchange.com then! – sbi Nov 29 '11 at 12:58

4 Answers4

6

Hit the books.

Learn to program.

This often surprises people, but game programming is not magic. It is a specific subdiscipline within the programming field.

And that means that you can't start with it. You have to learn to program before you can learn to program games. Just like you have to learn to program before you can learn to program word processors or web browsers or operating systems.

And just like you have to learn to drive before you can learn to drive a bus or a race car.

So start from the basics. Learn to write simple programs that are not 2D or 3D games. They might be purely text-based games, or they might not be games at all, or they might not produce any text output at all.

Learn programming. Don't try to skip ahead. Don't think that "now I know how to write a small simple 40-line program in C, so I'm ready to tackle a 3D game".

There are no shortcuts.

jalf
  • 243,077
  • 51
  • 345
  • 550
  • I said I was a beginner, I never said I had no experience with C. Sure, I may not know how in fact games work, but i recently made a GPU monitor for myself, which will monitor my temperatures and act accordingly. – dikidera Nov 29 '11 at 12:18
  • 1
    +1 for making my comment into an answer :) – R. Martinho Fernandes Nov 29 '11 at 12:18
  • 1
    Nailed it. This is exactly how it works. – Matt Joiner Nov 29 '11 at 12:19
  • 2
    @dikidera: but your question shows that you do not have a robust enough understanding of programming. **That is why you could not make sense of the code you read, and that is why you do not know how to approach game development** – jalf Nov 29 '11 at 12:31
  • 4
    I'm not saying this to insult you, and I'm sorry if you take offense at it, but it's the truth. if you'd asked "how do I write a novel like Lord of the Rings, I know the alphabet, and I've previously written a pamphlet for the local church", the answer would also be "before you can write an epic fantasy novel, you need to learn to write". You need the basics before you can specialize – jalf Nov 29 '11 at 12:37
1

I have found that the best place to start is either 3DBuzz or Marek-Knows. Both sites offers video tutorials that explain every single step. Marek-knows is purely C++, where 3DBuzz give you the option of choosing between more. It also has the best Unity tutorial on the web.

Jan Dragsbaek
  • 8,078
  • 2
  • 26
  • 46
0

get yourself MAYA, and learn how to box model first, this is an enjoyable learning curve, then later learn some animation, and then once you have a good idea of what you are doing you can learn more about texturing and physics.

If you were to work for a large gaming corporation, say Playstation for example, It is highly unlikely you would both program and model at the same time, so the real decision is what side of 3d gaming do you want to get involved with?

  • I would like to be an indie developer if I even succeed in this task, so I'd be doing both I guess. – dikidera Nov 29 '11 at 12:15
0

First, you need to learn programming. For that, C might not be the best language. I would suggest a statically typed language like Ocaml, and/or a dynamically typed language like Python or Scheme (the great SICP book uses it).

After you learned some programming, you can try to learn C. Better first code simple command line programs.

Learning several different programming languages and paradigms is important.

After you learned C, you can try to learn how to use some graphical library or toolkit.

You'll learn a lot by using GNU/Linux, because all the programs involved are free software and you can study and improve all the software you use.

Enjoy, learning what you want takes a lot of time (months or years), but is very fun.

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • 2
    +1 for recommending different languages first. C and C++ are not good starting languages. C++ isn't even a good _finishing_ language. – Matt Joiner Nov 29 '11 at 12:20
  • 1
    tempted to -1 because of the completely irrelevant Linux/"free software" worship in the middle of an otherwise relevant and sensible post. I won't, though, because the rest of the post is good. :) – jalf Nov 29 '11 at 12:53
  • Free software is *very relevant* to learning, because you can study the source code, and understand how real software is actually happenning. – Basile Starynkevitch Nov 29 '11 at 12:55
  • @BasileStarynkevitch Study linux code with interrupts, multithreading and memory management when he barely understands C? For what purpose? – jn1kk Nov 29 '11 at 14:21
  • Not the kernel, but source of basic commands (like `ls` or `sash`) is a useful way to learn programming. Looking at other's source code is a very good way of learning (both for newbies & experts) And participating to a free software project is also a very good way to learn programming (but of course requires some skills). – Basile Starynkevitch Nov 29 '11 at 14:28
  • @BasileStarynkevitch Have you seen the source for ls? It is like 5000 lines long! – jn1kk Nov 29 '11 at 14:38
  • 1
    Yes, and I showed it to some interns. Most can understand something of it. Those who can't are not able to code in C. – Basile Starynkevitch Nov 29 '11 at 14:44