Game Programming 01 - Introduction

About Amateur Game Programming

Ever wanted to create games? Well, you've come to the right place. I'll teach you how to create games your own. The whole serie will cover various subjects about game programming. This first article is going to cover most of the basics to get you started on your first game.

First, we should cover what a game is.
  • 3D Engine : The 3D engine is a library that will allow manipulation, animation, rendering of 3D objects and textures.
  • Game logic : Game logic is where all the logics happen, it contains the physics engine, algorithms about how the game should react to player input. It outputs to the 3D engine so that the result can be displayed on the player screen.
  • Game tools : Most game will require specific game tools to be created. Those are primarily object, map and script editors.
  • Art : Games contain some Art: 3D models, textures, shaders, sounds, music.

Prerequesites

Game programming, will require some prerequesites.

  • Programming experience : Needless to say, before you start to make a game, you should learn how to create programs.
  • Math knowlege : Matrices and more (nothing very very complicated though)
  • Graphics API knowlege : Even though it might be wise to use a ready to use engine, it might end up useful to understand how graphical API's work. I suggest you take a tour on NeHe's website about OpenGL Programming.

Software

You are also going to need some software. There are numerous choices that can be made here. Mainly, you need to know what platform you will be working on. For a beginner, I would advice some GNU/Linux based operating system as you can get all the software easily and legaly (for free) (I mean, high quality software). Software will depend on what language you are willing to use. The software I present here will be for ++ game programmers. Language is a subject that will further discussed later. Basically, you need a programming environnement, I would recomment Anjuta.

If nevertheless you were to choose to work under some Microsoft Operating system, the Visual Studio suite is quite nice (but expensive).

Strategy

So you want to make a game. As you might already know, game programming is a costly process. To the devloper, the costs are primarily about paying programmers and license. I will assume that you have little to no money. This is why it would be proper to search for a proper strategy.

Except for your "learning curve" where you are likely to be working alone, constructing a team for amateur game development is quite a way to go. Your game will build up faster if it has more developers. Opensourcing your project might be a very interesting solution. Doing so, you would enable virtually anyone to help you. Better even, you will be able to get hosted and to use Sourceforge.net's powerful tools.

The target operating system is also something you should watch for. We currently tend to a diversification of operating systems. Making code portable from one to another is not that hard as long as you follow some guidelines from the beginning. It is mainly about not using closed graphical API's (which translates basically in "do not use Microsoft DirectX").

The language

You should choose some Object Oriented language for your game. It is so much more easier that way. I would recomment C++, it's fast, easy (easier than C), efficient. Commercial games use C++, you should too. Nevertheless, it wouln't be a problem to use a higher lever language for your tools, you probably want them to be done as fast as possible. C# nice for that, you can use OpenGL and everything, but I cant' stress you enough not to use Windows native drawing fuction, they would compromise portability of your software. I'd rather advice you to use the GTK# API.

Starting the game creation

The game creation process (any programming tasks in fact) can be decomposed in a few steps.
  • Plan
  • Design
  • Create
  • Test

Planning

You need to layout on paper your goals. Start simple if possible, if your code is well designed, you will allow your code to scale well. Planning consists in knowing what kind of game you are going to make and what tools will you use to make it.

The 3D Engine
First question is about the 3D engine. Are you going to make one or are you going to use an already made one. Creating an engine is a very time consuming project. Unless you have very specific needs, you should be using some engine, otherwise, you might spend a long time making an engine rather than making a game. There are a lot of engines available out there, and good ones (opensource). It will require you to understand how the engine works. It will take some time, but much less than if you chose to create your own.
  • ID Software's Quake III Engine : Formerly a commercial license engine. It was recently released under GPL. It has been used by a plethora of commercial games. It might be a wise choice.
  • OGRE : OGRE is a LGPL 3D Engine. (http://www.ogre3d.org/)
  • Irrlicht Engine : Irrlicht is a cross platform 3D Engine, it supports shaders and all you could need.
Actually, Devmaster holds a list of 3D engines, you should have a look.
Art
You will also require tools to make art for your game. Sure sound and music are important, but they are not to be covered currently. I will concentrate on graphical solutions.
  • Blender : Blender is an opensource 3D Modeller. Advantages are that it is free.
  • Softimage XSI : Softimage XSI is a very very good graphical package. They made a free game oriented release which will allow you to use it in your game. It might be the best choice if you can output the models easily into your engine. And if you ever intend to go professional, XSI will be THE software to own.
  • The Gimp : The Gimp is a great open source image editing program. I would recommend using it with some plugins such as Resynthesize that will allow you to create tilable textures from various material very easily.
  • Photoshop : Quite good, but if you can get used to the gimp, well, use the gimp. Not only is photoshop expensive, but it isn't even cross platform.
Programming Software
There are a few Integrated Developpement Environnement around. You'll have to choose one.
  • Anjuta : Anjuta is a C/C++ IDE. It's very nice, it includes a gdb frontend (debugger) that will allow you to solve most of your problems.
  • Visual Studio : Microsoft's Developpment Suite. It's also a great choice if you go for windows.
  • monodevelop : A great .NET IDE. (it's a port of sharpdevelop in fact).
Planning the game
You also have to decide where you are going for your first release. What are your goals. Expecially the order work should be done. Do you need the tools first or can you start the game right away and make the tools later (Hardcoding stuff into the game is not a good choice). You will also need to split work among the different team members.

Conclusion

Now that you have the software and everything, you are ready to go. Part02 will cover designing of your code. Note that Art creation and design may occur at the same time if you can already lay guidelines for the artists. It is recommended to do so as you will be more than happy to have art ready to get used as fast as possible when you get your first build running.