Dec 29, 2009 (last update: Jan 6, 2012)
The Act of Game Programming
Score: 3.5/5 (198 votes)
NOTE: This article does not teach about game programming techniques.
What is "game programming"? Well a game is often some form of input given from a person to provide output to achieve some sort of goal, giving the person a feeling of accomplishment. Programming on the other hand is the act of writing instructions for the CPU to cycle through. Put those terms together and you get: the act of writing instructions to take input from a person to provide output and allowing the person to accomplish some sort of goal.
The problem I'm going to discuss is about the overly motivated persons who wish to jump into game programming. Game programming is no simple task. It requires both time and effort. Jumping into with just the idea of motivation is not enough.
I believe this problem is caused by ignorance caused by desire. It's like wishing for a pony every year for Christmas but in reality, it's unrealistic without real motivation and want. You keep wishing for it because you aren't knowledgeable about the cost of a pony.
The solution is to inform you and as a result, scare you a little bit. I don't plan to be a Debbie downer or sad Stewart. That's not my intention. Programming is something that's very "real". There's not many miracles or fiction to it. I remember a story about a horse who's leg healed and was able to miraculously race again. There's no such stories in programming in general and even more so for game programming. So, I need to be realistic with you.
While simple games only require basic mathematics, you still are required to understand some trigonometry and collision mathematics. You must also understand some of the underlying effects of the API that you're going to use if you want anything more than basic quality.
3D graphics takes a certain amount of physics and advanced collision mathematics for just the basic stuff. Knowledge of lighting, matrix arithmetic, and various other things are needed for more intermediate things, which is just the tip of the iceberg. In other words, you will need at least college level physics (which is actually not that complicated...), some calculus, and tons of triginometry. You will need to understand the underlying nature of the 3D API, especially in OpenGL (of which I recommend). For instance, what a clipping zone is, what the fourth dimension on a vector means, and so on.
You must also understand the concepts of sound. How to buffer and cache sounds, how to stream larger sounds, and how to handle sound in a 3D space. You'll probably use a library that does most of the advanced mixing for you (since it's repetitive anyways) and sound in concept isn't a hard thing to grasp. However, finding quality noises and music is a very difficult task.
After that, the essence of making a game is really simple. You must provide the user with output with the given input. This means you must be able to properly handle input. Thankfully this isn't hard yet you'll still see games that do not properly handle input. You must still consider what type of input you're going to receive. Is the user going to use a Joystick, Keyboard and Mouse, or Gamepad? Should I enable the use of force feedback if he's using a controller that is capable of force feedback?
You must be able to deal with threads. Threads are an excellent way to boost efficiency but they can become complicated. They're hard to track down bugs in.
After that, if everything didn't go just perfect, you must be able to find problems. Problems that can take anywhere from just a few minutes to find to several days, sometimes weeks. Programming is patience altogether.
Now, let's take a hypothetical example. You want to create the next big game. You start on January 1, 2008. Considering that most large game companies take a few years to create a game that the public can often consider mediocre, how well do you think you'll do in the same amount of time with as an unpaid person or team without the best tools?
Let's face it. You're not making the next big game. However, you can still plan and start on a reasonably sized game. You must know though that the time and effort required to make a game is significant. Starting a game project just to drop it because you don't have the patience is a waste of time.