Hacker News new | past | comments | ask | show | jobs | submit login
How to Become a Game Programmer
143 points by palish on Oct 23, 2010 | hide | past | favorite | 44 comments



Not sure I agree with the author's assertion that matrix math should be avoided until absolutely necessary when learning graphics programming. I don't even agree with the idea that matrix math is particularly difficult.

When I was in university, we learned graphics programming by taking a linear algebra course or two. This was applied in a graphics course in which all students built their own software renderer, from top to bottom.

I have seen coworkers who never learned matrix math fumble with obfuscated code that could be replaced with one line of matrix operations. Several game companies I have interviewed at make linear algebra a very big part of their technical interview process. IMO if you are even remotely comfortable with math, learning matrix math is a HUGE benefit (maybe even a necessity) if you want a serious job as a game developer... the easiest way to get going with it is to just take a university-level intro to linear algebra course. That is all you need to understand the math underneath the entire rendering pipeline.


Vector, Matrix, Affine transformations, quaternions - this can all be managed in a week or two for solid understanding, even if one's math skill is at advanced arithmetic (pre algebra) level, since it is Linear algebra after all. It really is not that hard, and of utter importance in graphics.

No excuses: http://www.khanacademy.org

There is a book Math for game programmers or something, I forgot, but these are the basic tools you have as a graphics programmer. I'd argue you need to expand knowledge into physics if you want to be a good graphics programmer (optics), and without some calculus, namely integration, forget about advanced graphics programming. You could do it, but you won't understand it - you'll end up waiting for others to code examples and publish non-scientific papers in order to understand what you need to do. Thus, you will always lag behind cutting edge and won't be able to read published papers and implement/expand them.

I have kind of a bad memory, so I have these two books I find very helpful when I want to refresh my pre-calculus knowledge: http://www.amazon.co.uk/Mathematics-Physical-Sciences-Robert... and http://www.amazon.co.uk/Further-Mathematics-Physical-Science...


The key point he makes is that you don't _have_ to focus on the hard stuff to be productive and actually make something useful. I think it's an important thing to realize and a great way to learn...build on little personal victories and gain a level of confidence before you take on the really tough challenges.


It's useful to know eventually, but I think the author is right that, if you want to make games, you should learn how to make pong first. (How many hobbyists would be willing to learn the equivalent of two college courses before they can rotate a circle on screen?)


In my university's game design society, we have a short competition to make "pong with a twist" near the start of the year. Use of Game Maker and similar programs is encouraged, because we're "game design" not "game programming", but it's the same principle: if you want to make games, start by making a game.


Matrix math is actually incredibly easy. I've never really understood why a linear algebra class is considered a difficult class by some. If you were able to handle high school algebra, then the ideas you learn in linear algebra won't be particularly beyond that. At the very least, a simple understanding of basic matrix math will get you pretty far in graphic programming.


Matrix math is covered in a few classes, it's all the abstractions that state the same thing in 10 different ways. Gaussian elimination, determinants, subspaces, eigenvectors, etc that make it a full course.


I've seen various resources around hn for getting familiar with linear algebra (which seems hugely useful) - let's say that I'm not in a position to take an intro to linear algebra cours at a university, what other alternatives are there? Any online courses?

And how much calculus is required to have a chance at understanding the material?

It might be nice to have some study groups in the bay area for people looking to get into this with a regular schedule.


The MIT Linear Algebra course by Gilbert Strang is my personal favorite. I don't think calculus is really needed to understand the material. Linear algebra does have a lot of benefits in a multivariable calculus course though.

It can be found here: http://ocw.mit.edu/courses/mathematics/18-06-linear-algebra-...


Khan Academy is really great to learn the basics from. I remember watching it, because my college and curriculum did a poor job of explaining it.


Your local community college probably offers linear algebra and may offer them at more convenient times. I only offer that if you haven't considered it.

Assuming no class is available, depending on how deeply you want to learn the subject, linear algebra is fairly accessible. It sounds like the introductory level stuff (University 200 level) is what is recommended in that article, so the good news is you don't need a class to learn it.

I don't think not having calculus would prevent learning it at this level. Personally I'd just look at reviews for linear algebra textbooks on Amazon and buy the best one. One thing I often do when trying to learn a subject on my own is a go to the University bookstore to figure out what materials I should start with.

Then just read the chapters and work the sample problems. When doing any matrix manipulation by hand (boring, but good to verify and help internalize understanding) it's easy to use that software to check results.

Basic linear algebra is one of the easier mathematics to teach one's self.


> I'm not in a position to take an intro to linear algebra cours at a university

What kind of non-position are you talking about?

At least here in Germany, there's absolutely no problem with attending a linear algebra lecture as a guest. Just ask the lecturer whether it's okay for him/her, and everything is fine.


My faculty even allow people to attend its courses as a regular student for some money (not much, ~35 Big Macs).

But of course, you need to be close to a university with decent linear algebra lectures, have enough time and so on. That's harder.


Linear algebra is absolute basic stuff. It is part of the first and second semester in mathematics, and also taught in computer science, physics, chemistry and many other fields.

So all you need is a university that provides natural sciences. I can't imagine such a university being hard to find.


HN would disagree with the one rant the author spent the longest time on.


If you really do want to be a professional game programmer then I'd recommend biting the bullet and starting with C. It's a fundamental requirement for programmer at any game studio, and it's absolutely the closest interface you can get to the low-level workings of a machine without resorting to assembly. Learning about the heap, pointers, arrays, addresses and offsets isn't particularly fun, but neither is it particularly hard. I would be far more likely to employ a junior or intern with a solid understanding of these concepts, than someone with a fancy python graphics demo but who couldn't implement strlen()

That said, if you do want to dip your toe in the water and figure out if programming is for you, I'd really disagree with the suggestion of using Python as your language, particularly if your intention is to later focus on C/C++. Python is great, but its structure and constructs do not map particularly well to those languages. A better first step would C# (native on Windows, Mono on other platforms). In most ways its syntax is virtually identical to C++ and shares the same project and compile/run concepts. If you are using Windows, you'll also be using a best in class debugger and the same environment as you would in C/C++.


I couldn't disagree more. I used to work in the game industry and one of the biggest things we would look for was a passion for gaming and the ability/history of shipping a game.

If an entry level candidate developed a game we could download and play, it was almost guaranteed we would bring them in for an interview. It didn't matter if it was text based in C, a simple card game in Python, or a Galaga clone. Sure a background in C/C++ is good, but it was pretty low on the list of things we looked for in entry level applicants.

So if you want my advice, complete game of your own as soon as you can, in whatever language works best for you. Pick up the skills and tool knowledge you need as you go along.


On the other hand, python, at it's very basic level, gets the syntactic mess that you or I are very familiar with, and removes all of it for first-timer's. There are no classes, no functions, just statements.

Also, for the "enter a name" and "guess a number" programs, for the beginner, everything I can think of will look effectively the same between the two languages. Furthermore, you can see the results right then and there when you're programming, rather than compiling, running, and repeatedly earning segfaults.

That said, the moment they begin to understand the flow of logic, they should move away from that language, so they can comprehend pointers/etc. This is, of course, all my opinion. Dijkstra would disagree with me, and so would many hackers, I'm sure, but wouldn't it be advisable for them to first begin to think in the minuscule steps, like a programmer does, before they have to deal with some of the stresses of C, and, even more so, classes?


I couldn't agree more with the middle paragraph.

But 'no classes' and 'no functions'?

  class NewClass:
      def NewFunction(arg0, arg1):
          print("Hello, World")

Python has both.

Pointers wise, I think you can learn them fairly late. I certainly didn't struggle to pick them up after years of using pointer-free languages.

(edit fixed my formatting)


I meant needing classes. You can program in python without ever looking at them; where as in C#, they're required to do anything. Not needing that extra boiler plate code is just one more hurtle a new programmer won't need to learn before getting into the real meat of development, if they chose to use Python as their first language. I should have been more clear about that.


I agree, knowing the basic concepts is very important. As a way to teach OOP you could also use an existing 2D engine and start creating basic games in that. That would be an easy way for people to get something on the screen and at the same time get the feeling that they're actually making a game.


I wrote a book called Game Programming For Teens when I was 14, that was an international bestseller, sold in over 6 countries.

The book was written for teenagers who wanted to learn how to make videogames for the first time. I used a language called Blitz Basic to teach the kids. Why? Because they learned with a very basic language, how to make a cool game that was fun to play. They could even share with friends! But they didn't get bogged down in the intricacies of the syntax of C/C++.

I found that the teenagers who've read my book tend to get really inspired by the BASIC language, and that passion carries over to finally finishing the game in C/C++


This is a great article. However, at the point where he suggests that the two choices for graphics programming are DirectX or OpenGL, I would point out that there are other options if you are pursuing anything other than graphics programming. If you're still on python at that point, there's PyGame, or SDL for C/C++.

Maybe it's because Im older and there wasn't as much need for 3D graphics when I was starting out, but I'd argue that for most people, focusing on a 2D API first will be much more rewarding.

On his mentioned other paths, I would fall squarely in the "texted based MMO => Network programmer path", except I did write plenty of graphical games along the way, just never with a 3D API of any sort.

I do think I will just link this article next time someone asks me that question though, he said it all better than me.

(Credentials: World of Warcraft was the first 3D game I worked on)


This seems to be directed at PC/Console games. But for casual Flash games, Kongregate has great tutorials at: http://www.kongregate.com/labs


I disagree with his advice on not using game engines. Just about any finished game will rely on someone else's libraries or code at some point. It would be insane to duplicate all this effort from scratch, except maybe as a learning exercise. Ogre3D is a good engine for C++ and Unity 3D can even use javascript. I learn a lot about actual game construction and design while using these engines, while efforts at reinventing the wheel usually end in frustration.


I think his point is to not focus on an engine. You don't work for a studio and are just starting out, you need to get the experience and knowledge first. Sure when you're working in Starcraft 3 or Quake43262 you'll be using an engine made by someone else, but the fact that you now know how that engine works on the inside because you didn't use them when you started makes you invaluable. It's the same deal with Ruby programmers and only Rails programmers we have now.


Especially true for beginners who for a long time wont be able to write that kind of code anyway. Python + Panda3D on the other hand allows even a beginner to get a few simple models on the screen within short time. And that kind of motivation you can get out of it will pay for itself, even if you plan to add C++ in the future.


I'd like to know about the economics of being an indie game dev. Is it a an industry where it is easy to turn a profit once you've learned the basics? I've read that games are really hit-and-miss, so you need a large game portfolio to spread out the risk.


They're blockbuster driven, like other entertainment media. If you get a hit, you can make a million in a month.


I did something very similar to this, it worked, I weaseled my way into the video game industry and I shipped a major console title. You can do it, too!

However, the industry sucks. I left after about a year. In that time I learned the terms "stress migraine" and "death march." Compensation is pathetic.

Upside: wanting to make games propelled me to learn to create software. Now, I have a fantastic career as a software developer, minus the games and the stress migraines.


I've considered setting my main focus on graphic programming to combine my love for math and programming. As the author said, they are "puzzles" that are unbelievably rewarding when solved. I could never really see myself going into game programming though just because I typically am not interested in many games with the notable exception of games like Doom. I still plan on making my own version of the Doom engine for Android (as a personal introduction into graphic programming), but have gotten bogged down with other projects.

On the downside, sometimes I feel I learn more from reading things such as this and going off and building my own things than I do from classes. I'm currently trying to solve this by focusing on my math major first then switching focus to my computer science major so I can approach it with a "larger toolset".


I'm a computer science major and I've interned at an animation company as a technical director. We were outsourced for a certain AAA game that is coming out in 2011 (can't say what companies cause it would probably breach the NDA.) I spent a few days at the actual game company, and it sort of put me off game programming completely. Even though people had cool offices with posters and toys everywhere it was a very dull and depressing place to work. People came in at 10 and sometimes stayed till midnight. The highlight of the day was ordering dinner at 6pm. It was basically permanent crunch time. Also people don't realize that most of game creating is assets. Animations, mocap, recording dialog, scripting. There is very little actual programming unless you're working on an assets/tools team which makes engines (in my case they licensed the Unreal engine so most of the work in terms of programming was done.) Making a game nowadays is more like making a 10 hour movie...there are writers and directors that are hired. They film the action in a mocap studio and eventually animators clean up the data and level designers import it into the engine.


Well, I don't know about being a game programmer, but he made me want to program my own tic-tac-toe game. So I made one yesterday and added a real AI today.

That's probably, even by my very low standards of beginner, one of the dirtiest pieces of code I've ever written, but yay ! it works !


Step 1: Learn to program. Step 2: Program games.

Seriously. Why do people make this out harder than it has to be? Sure, your first few games won't be sale-able. They'll probably be crap.

-NOTHING- you can do will skip the crap games you are going to produce at first.


The point isn't "how to learn how to program"; the point is, "here is an ordered list of projects that will terminate in you knowing for yourself what good next steps are for game development".

I was enthralled by this article, not so much because I'm interested in game development (I'd rather eat a bug), but because I can imagine how valuable this article form would be for software protection, or reverse engineering, or network protocol design, or operating systems development (wow, would I ever like a series of step-by-step projects that ended in a basic functional virtual memory management system), or (somebody, please, please, please) FPGA dev.

(sorry for the prior opening snark).


I'm a CS PhD student, but I took a graduate level configurable computing (read: FPGAs) class in the ECE department. It was hard, but I came out with some of the basics. You may like reading through the homeworks I did for the course: http://people.cs.vt.edu/~scschnei/ece5530/

(That first homework took me 25 hours because it was my first time ever using a hardware description language. Feeling like a freshman again was humbling.)


Hmm I did it backwards. Step 1: Program games. Step 2: Learn to program.

Serious. Remember Hypercard? Well back when I was 12 or so I used powerpoint to write adventure games. I put these links on each slide, and when you click one you get linked to another slide. Then I discovered gamemaker and used that. http://alstaffieri.com/gamemaker.html (Still no programming yet.)

After gamemaker, I got up to "Runtime Revolution". http://www.runrev.com/ I stored "variables" in textfields and wrote gui programming scripts (when you click this button, put 5 into that textfield. if the textfield contains 5, show dialog box "you went into the wrong tunnel and fell".)

When I finally realized revolution can't really make games either, I moved forward to TNTBasic http://tntbasic.com/ and finally learned what a "variable" really means. Took me maybe 2 years.

These days, I program websites, not games.


This type of questions, don't bring anything up, those who want to become game programmers, will become game programmers by they own initiative. Beginning with the language they would find at first step better for them, through the experience of time, those spirits would hand out and discover, what languages and technologies match better with the project they are currently working. Today I could say C/C++ are my best conclutions, thanks to pointers, memory access adresses, offsets. But who knows tomorrow?

Sorry for my english.


This type of questions, don't bring anything up, those who want to become game programmers, will become game programmers by they own initiative. Beginning with the language they would find at first step better for them, through the experience of time, those spirits would hand out and discover, what languages and technologies match better with the project they are currently working. Today I could say C/C++ are my best conclutions, thanks to pointers, memory access adresses, offsets. But who knows tomorrow?


If you want to be a game programmer I would suggest giving graphics programming a miss. I would suggest concentrating on one of the following:

1. Tools: C#, Maya & 3DS Max APIs, pipelines, UX. IMO the most important area in games (hence my startup), also very sort after.

2. Networking: learn about how to write networked games and servers that handle lag and heavy load.

3. Low level systems, memory, optimisation, in C/C++.

These areas are all heavily sort after in my experience. What the games industry doesn't need is more wannabe graphics programmers.


Once you get to graphics programming, what are your options on the Mac for IDE and library (directx/OpenGL)?


On the mac: IDE == Xcode. API's OpenGL, OpenGL ES (on the iPhone/pad), 2d there's quartz which is beautiful but generally too slow for games.



Step 1: Learn to program. Step 2: Program a game.

Games are computer programs just like all the other computer programs.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: