Tuesday, March 5, 2013

I want to learn game programming #2

I tried to scare you away from your foolish desire to learn game programming in the first episode, but if you are still here it means I haven't succeeded just yet. Let's explore, then, what resources are at your disposal if you really want to venture along these treacherous paths.

If you are an absolute beginner and you have never written a line of code before (no worries, we have all been there at some point), you can start here:

Once you get yourself acquainted with the basics and with solving little problems, you can move down the chain and look at lower level languages such as C#, Java and Objective-C, three C based languages which introduce a higher level of complexity and control over the code you are writing and the concepts you are manipulating. Very unfortunately Microsoft killed XNA, an excellent C# game framework; you can still grab the latest copy of XNA Studio and play with it. It's highly recommended:

If you are more of a Java person, you can follow the next tutorial, that will take you from absolute beginner to making Space Invaders yourself! Who doesn't love Space Invaders?

If you are coming straight from the web developing world and you dream in Javascript, there are options for you too, here's a good introduction:

And keep an eye on Lanica, these guys are creating a mobile game engine driven in Javascript, coolness all round. You can read more on Lanica's Blog

If you have a shiny Mac (why wouldn't you have one?) and think that mobile gaming is the future, download Xcode from the App Store, it's free! Xcode is a difficult environment to learn for a beginner, make sure you cut your teeth with something simpler before having a go at this beast. Once you have Xcode on your Mac, redirect your browsers to the following tutorials and code away:

Beware, here we are entering the realm of serious programming, approach with care and make sure you master the basic concepts first. Objective-C is not an easy language, it's a C dialect that will make you scratch your head several times about object ownership and such. Approach with extreme care and Keep It Simple.

Last, but not least, the rising star of indie game development is Unity 3D: it's a powerful, component based, visual editor for games that can target several platforms easily. It's been used extensively, lots of tutorials are available and scripts can be written C#, Python or Javascript. What's not to like? It takes from where Microsoft left XNA and improves on pretty much everything. It's also an absolute must if you are a visual person.

Point your browsers here now, you'll thank me later:

Everything you have learnt earlier will come very handy when you are creating your first game with Unity3D.

While you are learning, don't forget to keep things simple, focus on solving problems and learn the ideas behind what you are doing. Don't get paranoid about writing fast and efficient code now, it is not as important as many seem to preach, or, better, it is not important now for you.

But most importantly: have fun. Choose a language, choose a set of tools and create something simple you like and you know you can finish: the most important skill a programmer can possess is finishing what you started. That alone will get you a shiny, glamorous job in the Game Industry some day.

Sunday, March 3, 2013

I want to learn game programming #1

So you really want to learn game programming, and you are asking where to start. I've been on the receiving end of this question so many times, that I tend to answer in autopilot. Let's get the scare talk out of the way first: making videogames is neither glamorous nor will it make you (or me) rich, it just so happens to be our passion.

It's hard work, there's a ton and more knowledge to build up on the technical side before even trying to attempt making a very simple game, and, after that, there's a lot more to learn about how to interact within a game team, with colleagues coming from different nationalities and working in different fields (from programmers to artists to producers to... managers). Work hours are long, depending on where you ended up they are even longer, the dreadful promise of crunch time in the hope that the game will be shipped on time is an always looming menace, with the little solace of the faint hope of a bonus at the end of the project (that practically very rarely or better never materializes). Speaking of money, game programmer is a very low paid job compared to other engineering fields.

If you are here to make money, move away. There's lots of good blogs on the web that teach you databases.

Are you still around?

Next question to answer is: what programming language do I learn?

Quick answer: not C++. Pretty much anything else is fine, but if I have to choose, I'd go for either Python or Ruby, two high level, dynamic languages that take most of the gritty details out of the way while you build up your confidence in writing code. At the beginning especially, you need to focus on learning how to solve problems in a simple manner and how to manage complexity: programming is hard, programming is a blend between engineering and art, programming is a creative and artistic endeavor. Mastering the Art of Programming, being games or any other engineering field, requires years of practice and not everyone will likely succeed: Keep It Simple must be your mantra.

Why not C++? Because it's a bloated, difficult, over complicated, extremely powerful language that will keep you bogged down forever in details that are completely irrelevant to learning programming. You will have to master it one day, but that day is not today.

... to be continued