Home > Learning To Code > Learn To Program 1: What It Takes

Learn To Program 1: What It Takes

Do I need an expensive computer or software?

No! You do not need a fast or new computer to be able to write programs, and all of the tools you need for the majority of things you may want to learn are available for free on the internet.

I want to write a game. Can I do that?

This is always a popular question among my peers. Writing games is in many ways the cutting edge of programming: it is where we do the most complex maths, write the most complex code, stress the computer out with the highest workload and push the technology to its limits. Game programming has in many respects driven the development of faster processors and graphics cards as we strive towards ever-greater realism.

As a result, game programming is regarded by many as one of – if not the – most difficult form of programming of all. To become a great game programmer is an admirable goal, but also a lofty one, and you have a long road ahead of you!

Now that is not to say it will take you years of studying before you can write a good game. The key is to pick something that you can reasonably program without setting  unrealistically high expectations. Coding a 2D puzzle game is going to be a much easier task than writing an FPS (first-person shooter) in 3D. So if you are planning to write your first game, try to set your ambitions to something that is achievable.

Learning to program is only the first step to being able to write games. You will need:

  • a very solid knowledge of C or C++ (Windows, PlayStation, Wii), C# (Xbox, PlayStation Vita), Objective-C (iDevice) or Java (Android)
  • a solid foundation in 3D graphics math (vector and matrix algebra, projections, co-ordinate systems, lighting, texturing, shading algorithms, physics modelling, collision detection etc. etc.)
  • a working knowledge of the graphics API you want to use (DirectX, OpenGL, others)
  • if using an existing off-the-shelf engine on top of the graphics API, a knowledge of this (for example, you can download CryTek’s CryEngine – the engine used in the Crysis series of games – from www.crydev.net)
  • knowledge of how to integrate sound and music into your applications
  • knowledge of how to take mouse, keyboard or joypad input
  • knowledge of networking if you plan to write a networking-enabled game
  • friends or colleagues who can draw both 2D bitmap graphics (for logos and user interface elements, heads-up displays, 2D game sprites and so on) and create 3D models for you (for 3D games), OR a good knowledge of how to use products such as PhotoShop (for 2D) or 3ds max, Maya or Blender (for 3D) to make your own (NOTE: these products are expensive, but there are free alternatives; Blender is a good freeware 3D modelling package)
  • friends or colleagues who can make the music and sound effects for your game, OR a good knowledge of how to use products such as FL Studio (formerly Fruity Loops) (for music), Adobe Audition (formerly CoolEdit Pro) (for sound effects) and so on to make your own (NOTE: these products are expensive, but free alternatives are available)
  • knowledge of game engine design if you are not using an off-the-shelf engine, unless your game is quite simple
  • knowledge of game design itself
  • if your games need maps, levels or scenes that cannot be easily generated in code, you will also need the skills to write your own tools such as level designers and map editors
  • …probably other things I have forgotten

This is just a taste of the road to game programming! The challenge is formidable, but if you have patience and tenacity, the payoff is worth it – there is nothing quite like seeing your creation come alive!

Final Thoughts

I hope this brief outline has given you some idea what is involved in programming. Don’t be put off by the size of the task! You can do a little bit at a time, and there is no obligation to learn everything (indeed, that is not even possible, technology moves far too fast; even experienced professional programmers must always learn new things to stay up-to date). Just take it step by step and do an amount you feel comfortable with – there is nothing to lose by trying!

Are you interested in learning to program? Do you have questions I didn’t mention above? Leave a comment with your questions and I’ll update the post with the most popular ones as time goes on. Good luck!

Solutions To Problems In The Article

* If we want to draw a 300-pixel wide image in a 400-pixel wide window, and have it in the centre, we will need 50 pixels on the left of the image and 50 pixels on the right (50 + 300 + 50 = 400 – the width of the window). Therefore the left-hand edge of the image should be 50 pixels from the left-hand edge of the window, so the answer is 50.

** Using the above example, the solution can be generalized to a window of width Y and an image of width X. We know that we must have the same amount of pixels on both the left and right of the image for it to appear centered, and we can use the answer above, and substitute in X and Y, to get an equation like this: L + X + L = Y. Here, L is the amount of pixels from the left-hand edge of the window that we want the left-hand edge of the image to be at. L is the value we are trying to calculate, so we have to re-arrange the equation to get L on its own, like this: first subtract X from both sides: L + L = Y – X. This is the same as 2L = Y – X. Now divide both sides by 2 like this: L = (Y-X) / 2. This is the answer to the problem. We can verify that it works by using the 300-pixel wide image with the 400-pixel wide window as a test. Replacing X with 300 and Y with 400 we get: L = (Y-X) / 2 = (400-300) / 2 = 100 / 2 = 50, which is correct.


Pages: 1 2 3 4

  1. mau
    October 4, 2012 at 02:09

    This is a very nice post, even for a programmer like myself :p
    I was looking for your WMI cleaning but it seems either the link is broken (http://www.djkaty.com/wmicorruption redirected me here) or the post doesn’t exist anymore.

  1. May 15, 2012 at 10:03

Share your thoughts! Note: to post source code, enclose it in [code lang=...] [/code] tags. Valid values for 'lang' are cpp, csharp, xml, javascript, php etc. To post compiler errors or other text that is best read monospaced, use 'text' as the value for lang.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: