What is game programming

What is game programming

What is game programming? Well, I suppose game programming is a little bit of everything in the computer science world. Programming games is one part science, one part art, and one part fun (most of the time!). Programming games is much different than “normal” programming. Traditional business apps today are largely event-driven programs. In a game, you don’t wait for events. The game has to continually update the screen, check the network, respond to user input, run game logic, play audio, and many more things some 30 to 60 times a second. It’s quite a challenge, especially considering some games run on devices with constrained resources like a smart phone.


If you are really interested in game programming, be warned, it’s a lot of work. It’s hard. But, it’s also very rewarding. There is something unique about watching your users “play” your software as opposed to watching your users “use” your program, so to speak. Anyway, I’ve provided an outline below if your interested in getting started with game programming.

Getting Started

The first thing you need to do is learn a programming language. A game can be programmed in just about any programming language. Some of the more popular ones are:

C/C++ – This is the traditional language (actually they are two distinct languages) used to program high performance games. Most of the AAA commercial games on PC, PS3, XBox, etc are programmed in C++ or C. Many people starting out consider these hard languages to learn and they are also considered the most costly to develop a game with. Check the links below for more information.

www.cprogramming.com
en.wikipedia.org/wiki/C_(programming_language)
www.cplusplus.com
en.wikibooks.org/wiki/C++_Programming


Java – Java is a bit easier to learn when compared with C++ but you don’t generally get the same level of performance. I don’t know of a lot of commercial/successful games written in Java, although that may change soon with the proliferation of Android devices. If you are going to write a game on Android your most likely going to be using Java. If you know of any great Java games for the PC let me know! See the following links for more information about Java.

en.wikipedia.org/wiki/Java_(programming_language)
http://java.sun.com/docs/books/jls/
http://www.javabeginner.com/


The list goes on: ActionScript for programming Flash games, python, C# (which you can use with the XNA Framework to create games for the XBox 360). Have a look at all of these languages and pick the one that makes the most since to you to start learning.

AS3
Python
XNA



Data Structures and Algorithms

Next up, you will want to hit Wikipedia (or just search Google) and check out some of these data structures commonly used in video games. If you have taken any computer science classes in college, you most definitively are already comfortable with many of these structures/algorithms. The ones below are fundamental though and you should really get to know them inside and out. As a game programmer you will make use of these over and over again.


Specific Skills

You may want to think about some specific skills required in game programming as well. Think about which ones interest you the most or sound like they would be a lot of fun. A few of those skills would be:

  • Graphics – This is mostly concerned with getting stuff on the screen. There is a lot to it, especially when you are making 3D games. You have to think about how to store your data so it can be accessed fast when the game is running, how to quickly determine what things on the screen should be drawn, handle lighting, and lots of other things. You even get to write little programs called shaders that run directly on the video card! Graphics programming is a huge topic!

  • Physics – This is basically what you think it is. You program the rules that govern your game world. It can get very complicated though, just think about how you would do collision testing if you had 3,000 objects in your game world that all had to be tested against each other!

  • Network – Online multiplayer gaming is a huge thing these days and programming it correctly is not easy. Think about the scenario in which you have a server and several clients playing the game. You have to manage security so people can’t cheat, synchronize the game state for all players involved, manage the network bandwidth usage. And this is just a small glimpse into network game programming.

  • AI – Again, this one is straight forward. You get to program the brains for the game world “inhabitants”. Just getting an AI character to chase an enemy in a 3D environment is a pretty tough thing to do. How does the AI know where walls are? How does the AI know he can jump to get close to the player? Does the AI know he is low on health and should run away? Oh, the possibilities.

These are subjects people devote their entire careers to and they are not the only sub-disciplines in game programming. Lots of fun stuff there to explore if you’re interested.


The Fun Part

Now it’s time to just jump in head first. Start with a simple 2D game and have at it. Something like Pacman or Tetris might be appropriate. I would stay away from 3D games to start with. The number one thing is make sure you finish the game. It doesn’t matter how bad it is just get it done and start small. I would also stay away from things like OpenGL and DirectX when your starting out. They’re nice but they complicate things a lot. If you use say C++ for example, then you should check out SDL to handle audio, graphics, etc. Another possibility is to start out with Javascript and the new HTML5 canvas element.



After you have that first game under your belt, you can have a look at the many open source games out there and try and contribute to a project. Heck, before you even finish your first game you should join an online game development community and get to know people. See what they are working on. Have fun, ya know? Check of the TigSource Forums. That’s a great little online community focused on game development that’s very active. Oh yea, I believe the infamous game Minecraft began there as well.

One more thing, don’t be embarrassed by how awesome your programmer art is! :) Programming games is fun, right?


Conclusion

So again, what is game programming? Glad you asked! Well, finish that first game and if you still like programming games then come back here and let me know!

Here are a few links to some helpful tools and websites:


Visual Studio – You can use to program games in C++, C#, and more. There is a free edition.
Eclipse – Make games with Java (but handles many more langagues).
SDL – Helpful library for graphics, audio, etc so you can focus on your game!
GameDev.Net – Nice game development community.
Gamasutra – Another nice game development community.
XNACreatersClub – For Xbox360 development (although PC, Windows Phone also included).

August 27, 2011 · crow · One Comment
Tags: ,  Â· Posted in: Game Programming, General

One Response

  1. Kam - January 12, 2012

    well said. Programming game is not the same as developing an event application.

Leave a Reply

Connect with Facebook

*