views:

320

answers:

6

I've been a PHP programmer for 8 or so years, I'm familiar with OOP and try to consider best practices whenever programming. I would like to pick up C++ to possibly enter the 'game development' field, where now I'm doing web dev.

I'm not a school person, but was wondering what people think about self-taught math to complement learning c++ for game dev. The last math course I took was algebra 2. Should I start delving myself into pre-calculus? Are there any other suggestions you may have to ease the process?

Edit: The math part is referring specifically to the game development side of c++.

Thanks for the info guys... I would select all answers as the best If I could.

A: 

Motivate yourself with development projects and see where it takes you.

You do have a lot of math to learn, though. The folks at http://mathoverflow.net might be helpful. (Or they might not… see comments.)

And PHP doesn't really get you a whole ton with respect to learning C++. We'll be happy to help here… just develop something real and don't generate nonsense questions ;v) .

Potatoswatter
Mathoverflow doesn't welcome students, I heard.
Xavier Ho
@Xavier: oh well. Self-teaching is less common in math, so that's especially unfortunate, but I can understand that crowd being sick of homework.
Potatoswatter
I see. I did like the "generating maths..." feature on math. Was really cool to see it progress and update everything into LaTeX. | By the way, the `#math` IRC channel on `freenode` is very helpful.
Xavier Ho
+3  A: 

The quickest way for you to be comfortable with C++ is to write some code.

If it helps to motivate you, I am a self-taught C++ and Python programmer, and my background was Java. Maths isn't hard for me, though, so I was able to read up on a lot of tutorials and implement to make it work.

Oh, and start with the simplest game possible, like Pong, Pac-man, or Breakout. It will get you the idea of buffering, managing objects and states, and the basic game loop. Don't worry about maths too much unless you're also into graphics programming.

Good luck.

Edit for comments below:

Since you mentioned OpenGL, I truly recommend the OpenGL SuperBible. It is very well-written, and easily followable.

Xavier Ho
Thanks, yes I do plan on familiarizing myself with some BASIC 3ds max along with openGL just to get some preliminary work done. Down the line I'll try to find some artists if I end up deciding to build a team.
ThinkingInBits
3Ds max is another giant beast to master. Have fun. I'm a Maya/XSI user myself.
Xavier Ho
A: 

For game programming, it will help to have calculus, yes, but also logic (all programming needs logic!) and vector math. (Those are just basics; you may well need more, e.g., if you're working with spinning objects, you'll want quaternions...) On a more "general programming" front, learn about data structures and algorithms, and concurrency. Both of those are going to be useful to you over and over, whatever language(s) you use.

And never give up on learning! There's a world of interesting stuff out there, and you don't have to get them all at once. It's best to try to challenge yourself to learn a bit more every day.

Donal Fellows
+8  A: 

C++ isn't only OO, it's a multi-paradigm language. In fact, vast areas of it's standard library (namely the STL) are not OO at all, but follow the Generic Programming paradigm, with some Functional Programming intermingled. (The next standard, introducing lambda functions, will make the latter easier and, supposedly, more popular.) People abuse templates to do Generative Programming. According to some Andrei Alexandrescu has invented Policy-based Programming. Or policies are seen as a way to do Aspect-oriented Programming. The C standard library, included by reference, follows Structured Programming.
C++ shines most where you mix these paradigms.

If you want to learn C++, be prepared for a steep learning curve and that it takes years before you become a professional C++ programmer.
Have a look at the definitive C++ book list for starters. You will probably have to work through at least one introductionary book and at least one of the best practice ones to become a junior C++ programmer. And when I say "working through" I don't mean "read", but I mean just that: working. Because writing code is the best way to learn how to program.

If you want to get up there fast and won't mind climbing up a steep slope, I'd recommend you start with Accelerated C++. (The slower version would be The C++ Primer.) Then pick up the last edition of Effective C++. Don't forget to read The C++ Programming Language and always keep it within reach.

sbi
A: 

It depends on how good you are at learning new thing, and how good a programmer you are, not what language you have been using or for how long.

OOP helps .. knowing best practices, probably not much. However the fact that you are learning new practices is important.

You are probably best off getting some books on graphics and 3D graphics, seeing what you don't know and need to know, and going from there. You might also want to consider learning Java, because there are some nice Java 3D tutorials out there, and ther is open GL. Probably if you are programming in open GL that knowledge will transfer over to C+++ but learning in a Java framework will ease the learning curve.

Larry Watanabe
A: 

You will have all the time you want to read the good old c++ books.
Start with c++ faq lite, especially the "new question Q/A" section.
You need basic concepts of vector space for 3d development (vector space) but programming games also means using efficient structures. You may want to read more about data structures in computer science (Introduction to Algorithms). Finally a link to get started with game development: nehe game dev

Ugo