Saturday, June 03, 2006

Getting a games programming job - Tip 1 - Watch your language.

I frequently come across people who ask "How do I get a job as a games programmer?". I do a lot of recruiting work for Heavy Iron, and so know the area pretty well. In this first post on the subject, I'm going to cover the best programming languages to practice.

Most games are written in C and C++. Certainly all the home consoles and main handhelds are mostly developed in C/C++. Cell phone and perhaps some web based games may use Java, but I'll ignore those platforms here. Also, if you’re just getting started with programming, you’re probably best ignoring everything I say here and choosing some kind of basic, just to get used to the basic concepts of functions, conditionals, loops, variables etc.

I recommend to university students that they attempt to use C/C++ as often as possible. If you have a choice of which language to use on a project, choose C/C++. When you apply for a job, you're very likely going to need to do some kind of programming test. If you're really familiar with the language, then you'll do several times better than otherwise.

"Well I know Java, and that's just like C++"
With the rising popularity of Java at universities, I've heard this statement a lot. A few years back I left games for a couple of years and did Java programming. When I (thankfully) came back to games I had all the fun of refamiliarising myself with pointers, low level string manipulation, manual memory management, bitwise operators and all the other low level stuff. Yes, Java is like C++ in that the syntax isn't too dissimilar, and they're both object oriented, but they're different enough to mean that there would be a noticeable transition period if we hired a person who just knew Java. I also agree that a person can be a great programmer, and that shifting language is pretty trivial for such a person, but in terms of getting through the interview process people will do much better if they're familiar with C/C++.

"I'm great at C++, and C is just part of C++, so therefore I know it"
This is another statement, or rather assumption, I've come across. It's also a lot more of a grey area than the Java vs C++ issue. Knowing C++ is good, but if you really want to do well in the interview process, make sure that your lower level C is good. If you ask some people to write a string reverse function they'll break it down into 5 classes, and wrap it in accessor functions. These are good skills to have, but it's better to have the low level skills too. Ideally people who know C should be familiar with things like:
  • How numbers get represented in binary for signed ints, unsigned ints, and floats.
  • The sizes of data types, and the padding which happens in structs.
  • Use of pointers, and pointer arithmetic.
  • Use of bitwise operators such as And, Or, Not, Bit shifts, and masking. For example, how would you read and write to the middle two bits in a byte without disturbing the rest?

"What about assembly language?"
Having a low level understanding of how processor works, and assembly language is a very useful skill for games developers. It helps one to write optimal C/C++, and we occasionally end up optimizing heavily used functions into assembly (e.g. math functions) or stepping through assembly to work out why our code isn't working. This said, I don't consider this especially important for a junior candidate. Personally, I'd much rather see good strength in C/C++.


C/C++ is trickier to learn than VB, Java, and some other languages. In some ways it would be cool if other languages could be used for console game development. We might spend less time tracking down dangling pointers, off by one errors, and writing lots of code just to build a string. But in the context of getting a job programming for games consoles, C/C++ is the way.

You might be thinking “Isn’t it short sighted to require that people specifically know C/C++, when they might be a great programmer in another language and can cross over quickly after being hired?”. Yes, you’re probably right. But if we interview two people, and one’s already familiar with it, they’ll have an advantage.

If you've never touched C/C++ before, Microsoft has a free IDE (Visual C++ Express) and also has a lot of tutorials online.


Anonymous said...

I have an awesome demo (which I don't but lets pretend), its got spaceships, lens flare and HDR dinosaurs. Should I send it to the companies I want to work for or should I take it to the interview? Elaborate please, mister pope.

Mark Pope said...

I'll talk more about demos and the application process in future, but I'd suggest creating a website for yourself and putting it on there. Then you can just drop the link into your covering letter or resume... People like to click links and look at pictures.

Tsu said...

Hi! Im looking forward to what else youve got in store, but for now a couple semi-related questions.

Is using a non-VC++ compiler for your coding (I use dev-c++) going to be a problem when applying for a job?

Is a solid experience base working with something like SDL going to make up for a general weakness in low level C?

Mark Pope said...

Using a non VC++ IDE is fine. Console programming often requires you to use a non-standard compiler and tools, so flexibility is useful. If you were super religious about only using a certain IDE or OS for development, then that would likely cause problems though.

I'd not heard of SDL. It appears to be a complete game harness for doing 2D games. It covers video, audio, events, threads, timers and more.

SDL sounds great. Because it wraps up all the systems which it does, it means your code can more easily compile for any target platform / operating system.

Using a system like this is a good way of getting into programming. It allows you to make progress with your program (which is fun for you, and can get you closer to having a demo) and learn the language at the same time. I'd still recommend trying to use other engines, writing some code without SDL, and trying to learn the lower level stuff though - just to become more well rounded.

Anonymous said...

I am a high school Freshman. I love games, computers and such. What do you recommend I should do? My parents want me to study Math, Biology, Chemistry...all those sciences because they think I should become a doctor. I am not sure about many things. I do not know what the future brings. Will there be work for me when I become an adult in game?

Thank you for listening and for all your sharing of information. It is really neat.

Mark Pope said...

Choosing courses and direction in life isn’t easy. I can't tell you what to do, but I can tell you what I did...

I first got interested in programming when I was about 10, though I wasn’t anywhere near competent until I was 18 or so. When I was at school (ages 15-18), the most directly relevant courses I took were Math, Physics and Computer Science (which covered programming). After that, my degree was in Software Engineering. Also I took an IT course in school which taught me to touch type (not essential, but I’m very glad I learned to do it). English and communication ability is important for me too as we constantly need to discuss how we’re going to write the code, the design of the game, our processes etc.

Beyond programming, there was an article on the ‘Game Producer’ blog the other day on the subject of which courses to take, which might be useful:

As to whether there will be jobs in games. I think so. And if not, most programmers can quickly adapt to programming in different environments. Programming call center software which tracks people’s mortgages is surprisingly similar to programming games. It’s just that instead of a shield recharge rate, it’s a mortgage rate. The memory allocation, string handling, logging system etc are all pretty similar. I could go on with more reasons, but generally even if games somehow went away, the world is still going to need programmers.

Good luck choosing your path. I’m not trying to push mine on you. I found that following what I was most interested in / best at, served me well so far…

Anonymous said...

I am so glad I stumbled my way into your blog. I find the subject matter which you have covered to be very helpful and am looking forward to frequenting your site. Right now I do not have any pressing questions. Just want you to know that I am an appreciative reader.