learning game programming for C++

LumbergTech

Diamond Member
Sep 15, 2005
3,622
1
0
I am almost done with my computer science degree and haven't taken a C++ class. I have taken a variety of other languages and have a fairly good understanding of programming in general. I am almost done with the tutorial at http://www.cplusplus.com. My focus in school is/was database, but my true interest is games.
I am wondering what would be the best place to start to get into game programming.
 

tatteredpotato

Diamond Member
Jul 23, 2006
3,934
0
76
Are you looking to get into game development professionally? If so you might want to focus on learning fundamental concepts of computer graphics and making your own simple game engine. If you want to just do it for a hobby try using an existing engine and work on more of the gameplay-specific code.
 

Kirby

Lifer
Apr 10, 2006
12,028
2
0
You can always play around with the Source SDK, it's in C++ I believe.
 

Cogman

Lifer
Sep 19, 2000
10,284
138
106
Personal projects is always the best place to start IMO.

Start with a simple game. Like, really simple, think zort. Next, move on to a console based game (where you have to write/rewrite the buffer). Then move on to a 2d game using some library like the sdl (or you could do it straight in opengl or directx if you like). And finally, finish up with something in 3d.

Game programming is tough and time consuming, so good luck. Get familiar with being able to read documentation. And for heavens sake, don't copy/paste code.

Good luck.
 

LumbergTech

Diamond Member
Sep 15, 2005
3,622
1
0
What about typing it in? I don't know how to start.
I found a tetris tutorial. I tried going over it and typing it in line by line and looking up a fair amount of what I saw.

I still don't have it fully functional, but it works somewhat.

I understand the structure of a Windows application a little better, and it familiarized me with with basic collision detection...

I still have a ways to go on comprehending the whole file.

Is this a worthwhile approach or is there another way that is more effective?
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
Is this a worthwhile approach or is there another way that is more effective?

The best approach is just reading and writing code, once you know the basics.

Teach-yourself-C++-in-21-days.png
 

Cogman

Lifer
Sep 19, 2000
10,284
138
106
What about typing it in? I don't know how to start.
I found a tetris tutorial. I tried going over it and typing it in line by line and looking up a fair amount of what I saw.

I still don't have it fully functional, but it works somewhat.

I understand the structure of a Windows application a little better, and it familiarized me with with basic collision detection...

I still have a ways to go on comprehending the whole file.

Is this a worthwhile approach or is there another way that is more effective?

reading someone else's code is ok for getting the gist of what is going on. However, just retyping it, using the copy function, ect is not ok. I can guarantee you that you won't learn anything until you take the principles from what they are solving and apply it to your problem.

For example
OK
I'm writing a pac-man clone. There is a tutorial for a tetris clone. thats how they start up the SDL, I should start it up similarly.

NOT OK
I'm writing a pac-man clone. There is a tutorial for a pac-man clone. I'll copy what they did and see what I'll learn from it.

Seriously, I've gone down the second path before in the exact same pursuit. I didn't learn a single thing from it. When things broke (IE I didn't write the exact same code) I was lost on how it was broken or how to fix it. Even after I finished it, I could not reproduce the results if I wanted to.

It wasn't until I took the "I'm going to do this my way" approach that the exact same tutorial (nehe if you are wondering) suddenly made a whole heck of a lot more sense. All the sudden I knew how to use glBegin() correctly. It is really quite a magical thing.

So don't get me wrong, I'm not trying to discourage you from reading others code. That can be really invaluable. What I'm trying to discourage is writing or copying others code. That is really counter productive. You'll end up with a big mass of code which you don't fully understand (not a good thing when you are supposed to be the one the writes it all).

It may be harder to do, but it is worth it for the learning aspect.