views:

454

answers:

14

I'm in high school and taking a class where basically we design our own course and choose what we learn. I've chosen to learn about C++ and game programming.

I'd like to learn as much about using C++ with OpenGL or DirectX or some other API as I can.

After I finish learning C++ where should I go? Can you recommend a book on game programming?

+2  A: 

Everyone has different opinions, but I would recommend just jumping into OpenGL. It is fairly easy to understand once you know it, flexible, and cross-platform. It is also widely documented.

I would also HIGHLY recommend brushing up on your maths. Maths is such an important skill when it comes to 3D. You need to know about matrices, vectors, rotations, translations, ect...

Alexander Rafferty
I think a 3D game is way over my head at this point, so I'll probably be looking solely at 2D stuff.
A.J.
@A.J., You can still easily do 2D programming with OpenGL.
strager
That's fine, you won't need to worry about too much math. You will need to set up the modelview matrix to a 2D projection.
Alexander Rafferty
+5  A: 

You should invest some time in learning as much Mathematics as you can. Core fields such as Geometry, Algebra, Trig and Matrix Algebra would be, IMHO, the bare minimum.

mkoistinen
+1 can't agree more. Especially if you aim at finding a well paid job.
Alexandre C.
+8  A: 

The only way to learn how to make games is by making games. I've always heard this as a suggested order:

  1. Pong
  2. Tetris
  3. Pac-Man
  4. Super Mario Brothers

Of course I mean "games of that type" not exact clones. The idea is that you parallel the evolution of video games by moving from single screen games to a scrolling screen game. Also, the concept of AI is introduced halfway through. You mention that you are learning OpenGL -- I would start with 2D games first since the assets are easier to create and the details of a 2D graphical engine are much simpler. There will be less time spent on "video", and more on "game".

After you finish the first four little projects, then start thinking about how you would make a game in the Doom genre.

Unfortunately there are no "obvious" books on game programming like there are on general programming (Knuth, Wizard Book). Of the ones I have read, I most enjoyed the "Game Programming Gems" series which contains little snippets of ideas for you to absorb into your games.

nick
That's a great sequence of games, as each one builds on the one before. The opening sentence is the truth.
dash-tom-bang
I agree with your post except that there is no reason OGL can't be used for 2D games. For anyone really just getting into gamedev these kinds of API choices really aren't important.
BigSandwich
+11  A: 

Saying that you think you know most of C++ reminds me of when I said I thought I knew most of Java. When you find yourself saying things like that about languages you haven't used for 8+ years, you've slipped into a bad comfort zone. Stretch yourself. A lot. Read a book about the language. You'll be shocked about everything you don't know.

While I don't have good advice about game programming, I can tell you that as a programmer, you should absolutely tackle the fundamentals first, full force. For me, that means reading Code Complete, GoF, and anything by Martin Fowler (Not just once, but several times). It also means stretching your knowledge of technologies through toy projects.

Then you can do whatever it is that you want, and do it well.

Mike
+1 for Truth...
Chris
I up-voted you, but I REALLY think that jumping on code design practices before you have an understanding of programming basics pertaining to algorithms and data structures is silly.
San Jacinto
+1  A: 

Don't forget Game programming isn't just about graphics! There's AI, sound, input, networking, etc etc etc - there's lots and lots of things that go into a "triple A" video game involving a lot of people and time and energy...

If you're looking to do an indie game, I'd personally recommend to first stick to creating a simple 2D game clone like tetris or something, just so you can get a feel of exactly what's involved in creating a game.

Pick up a source control solution as well - may I recommend Bitbucket and TortoiseHg.

And most of important all, have fun! :)

Blakomen
+8  A: 
Yes, I know I won't be able to make some super-amazing MMORPG,

To this I have to say... Why not? The people that work on these things are mere mortals, like you and I. They don't have some superhuman ability that you can't necessarily acquire.

It's true that there are only a finite number of jobs, and a finite number of people who are successful at a given task, but if you artificially restrict what's possible, you don't get it done, or even learn the skills you need.

For example... When I was a student, I was interested in operating systems. If I said something defeatist like "no one works on kernels these days" and simply gave up, I wouldn't have learned anything about kernel development, and I would not do as well at my job today.

I would say to you... Go to a decent college, major in computer science, don't stop coding out of interest on your own time, and apply for internships and jobs in an area of the industry you're interested in. Most of all, don't be afraid to be ambitious.

asveikau
Thanks much for the -1, anonymous assailant.
asveikau
I made an account just to vote you up. I hope you feel a little bit better. Oh, and thanks for the inspiring answer too :D
A.J.
+2  A: 

You could look at some Open Source C++ games like OpenLieroX or others and get involved into their development.

Or make a new game yourself from scratch -- which can take some time though. Just think of something and try to implement it.

You should take a look at the SDL library. That library is a very easy way to setup your main window, get events from mouse and keyboard (or even gamepad and others) and draw simple 2D stuff. And you can also use it to initialize the OpenGL environment.

Albert
+1 SDL is ***the way*** to go for 2d games.
TokenMacGuy
+3  A: 

I too have once thought I knew most of C++... Then I read "Effective C++","Effective STL" , "C++ Gotchas" and "Modern C++ Design", and I realized just how wrong I was.

Dima
+1  A: 

Also don't forget to visit http://gamedev.stackexchange.com/ while learning

Carlos Muñoz
+1  A: 

As others have said, I SERIOUSLY question your claim to be familiar with most of C++ but that aside...

You need a good foundation in algorithms and data structures, as well as a basic understanding of the classic Non Neumann computer model (or Harvard, take your pic). I would hesitate to read ANYHING related to software engineering until I learned at least the most common data structures and their usual implementations. It will do you no good to read about models of engineering if you don't know that std::map is more appropriate than std::vector if you need to search a thousand items 100 times per second to find the correct item to update in memory that correlates to a specific item in your game environment.

After this, a good understanding of concurrency will be useful, but if you wanted to learn more about design first this would be the time.

San Jacinto
A: 

If you are looking to continue with gaming, C++ is a darn good place to start. You could also check out C# as it is used by Microsoft in XNA (XBox), Second Life, and by Unity on smart phones.

While I would not disagree with anybody about the math and reading you need to do, I think it is better to just roll up your sleeves and program. Read other people's code and then read so that you can understand why they are doing what they are doing.

If you think you know C++ well, the next step is to learn how to use it to make better software. For that, I would start with reading Effective C++.

If you really have a handle on C++ then perhaps this StackOverflow thread will answer your question about game books.

Personally, even if your goal is game programming, I would branch out from that to get a solid grounding as a developer.

Perhaps you should do a little web programming to get a feel for what that is all about. Maybe something like Ruby on Rails.

Alternatively, you could try to write a simple compiler or even an operating system to get a feel for what goes on under the hood and to learn that these too are just programs written by mortals.

Instead of writing your own, you could also get involved in an Open Source project. If I had the time, I would be all over spending time reading the code of Haiku and finding somewhere to contribute. Here is a list of open source game projects that you could consider joining as well.

Your chances of getting a decent job probably go up quite a bit if you know Java or .NET so those are also options. If you decide on .NET, I recommend checking out Mono.

Justin
+1  A: 

Normally I'd say learn a totally different language, however, you're more than likely very new to programming in general. Therefore I'm going to go with learn another language. Try Python or Ruby because they're dynamically typed. Later on, when you've got a foundation in data structures, algorithm design/analysis, and the like try a functional language like Haskell, Scala, Lisp or OCaml.

wheaties
A: 

Try going to your loca University bookstore. They carrie books for their advance classes that you might be interested.

Yurat Abraham
A: 

If you're asking where to go as in post-high-school education involving game development as a programmer, I'm a recent Full Sail University graduate and would recommend it highly. Not perfect, not by far, but if this is really where you have the passion to be, go for it.

As far as what else would be relevant for game development programming?

Disclaimer: By no means a comprehensive list.

General:

  • Software Architecture
  • Design Patterns
  • Data Structures
  • Machine Architecture

Math/Physics:

  • Linear Algebra (Matrix & Vector)
  • Rigid Body Physics
  • Havok Physics Engine
  • PhysX

AI:

  • Finite State Machines
  • Planners
  • Pathing Algorithms
  • Flocking Algorithms

Scripting:

  • Event/Message Systems
  • Python
  • LUA

Graphics:

  • Direct3D & HLSL
  • OpenGL & GLSL

Input:

  • DirectInput

Audio:

  • OpenAL
  • DirectSound
  • FMOD
  • Wwise

Optimization:

  • Multi-threading
  • Memory Management/Recycling
  • Archiving/Compression/Decompression
  • SIMD/SSE
  • Assembly

Tools:

  • C#/.NET Framework/Windows Forms
  • Java

Networking:

  • Server & Client Architecture
  • Network Architecture
  • MySQL
Sion Sheevok