Subscribe to So you want to be a game programmer?        RSS Feed
***** 3 Votes

I want to program games as a career!

Icon 23 Comments
Introduction

At </Deam.In.Code> we see many posts to this effect where those new to programming at least initially seem strangely drawn to the prospect of writing their own game. They often come on board seeming to think that although it clearly takes more effort than your average application to code it can still be done. The purpose of this article is to define the scope of what game programming is, if it’s possible for everyone, and whether you could potentially make money programming games.

What is a ‘game’?

In terms of computer games a game is nothing more than an interactive program that employs gameplay rules in order to determine if a player wins or loses. Notice there is nothing in there about artificial intelligence (AI), physics, graphics, audio or whatever? They are simply the icing on the cake that makes the gameplay experience more immersive. Let me illustrate with the following (C++) code:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;

int main()
{
    const int RANGE = 2;
    int randNum, guess = -1;

    cout << "You need to guess right to quit.\n\n";

    // Randomly generate number between 0 and 1.
    srand(time(NULL));
    while(guess != randNum)
    {
        cout << "Enter your guess between 0 and 1 to be free! > ";
        cin >> guess;

        randNum = rand() % RANGE;

        if(guess != randNum)
            cout << "Incorrect! The number is: " << randNum << endl;
        else
            cout << "Correct guess! You are now free!\n";
   }
    return 0;
}


Which is a simple game asking the user to guess between the digits ‘0’ and ‘1’ to win the game and be free. Although it is unlikely to represent the image in your mind as to what you would wish to achieve when programming games, it certainly fulfills the requirements in being an interactive application that employs gameplay rules.

Although this article isn’t about ‘bare bones’ games, it does illustrate that actual game programming in itself doesn’t start with spectacular effects of various kinds running on cutting-edge hardware, it in fact starts at making a program that is entertainingly interactive. Luckily though, we are here to discuss how to make everything that is put into a modern game and how to approach making it a successful venture.

Am I ready to program games?

That is a question that only you can answer, coming down to your ability and determination. What kind
of abilities are expected to create games? Well you certainly should be familiar with a programming language to the point where you can code very comfortably in it. If you have issues with the language it will only complicate the process of making games exponentially! You should also be comfortable with Linear Algebra (the study of vectors and matrices), this is critical for your 3D graphics programming. Also be very familiar with Logic from the theoretical sense as well as the programming sense. Study Discrete Mathematics including Set Theory – this will help you to write very tight and efficient code.

Now we move on to the tools to use. There are a big variety out there, something for every ability in making games, but there are only a few that will be useful depending on how far you want to go in engineering games. Remember that when creating games there are many components that need to be considered as part of the overall game engine:

  • Graphics.
  • Input/Output (IO).
  • Audio.
  • Resource management.
  • Physics.
  • Artificial intelligence (AI).


Some of the available tools try to do as much of the above for you as possible, some merely interface the hardware of the platform you are making the game for allowing to you control how sophisticated each respective component of the game engine is.

For the non-professional game developer wishing to eventually turn professional they really should be using C++ as the programming language along with DirectX (preferably), or maybe OpenGL with OpenAL and similar. Why these options in particular? Because if you look at any skill set requirements for a games programming job you will more than likely see C++ as a language that is a must, and surprisingly DirectX and/or OpenGL as either required or desirable knowledge. Now I hear the C#/XNA crowd screaming at me! The fact of the matter is that C++ holds way more precedence over C# because of a variety of reasons including the fact that C++ isn’t Microsoft specific, so applying for Playstation work with only C# knowledge, for example, won’t get you the job.

For making games on a novice/hobbyist capacity you can use any tools you like (GameMaker, DarkGDK or whatever), but do bear in mind that making anything substantial you will need to do a lot of learning.

Last but certainly not least, you absolutely must learn to debug you code! It is a critical skill to have when making games, and if you try to code a game without debugging skills you will end up with… no game.

So what tools should I be using?

Choosing the right language and development environment is actually very important for several reasons:

  • You want to use the most commonly used language in the industry.
  • You want to use the most commonly used development environment in the industry.
  • Following from (1) and (2), any demo work you have should be able to be built by the studio you are applying to. Any errors or even warnings could get your resume put in the bin!


Without a doubt, anyone who is a professional developer will be familiar with Microsoft Visual Studio and the C++ programming language. You should know these. Seriously. Above all else. Please especially don’t use Dev-C++ or Turbo C++ as I will guarantee you that your code will not build in a modern Visual Studio environment, instead download Visual C++ Express Edition and code solely in that. Also the dev kits for the major consoles are compatible with Visual Studio.

What about the DirectX vs. OpenGL debate? Well I would personally suggest DirectX over OpenGL because DirectX is a lot more than a graphics library amongst other reasons. Writing a demo with DirectX scores points as does OpenGL, my old demo was a full 3D game in OpenGL. Simple Direct Media Layer (SDL)? I have not seen anyone submit a demo using SDL.

To get into tools programming (creating software that will be used to make the games) then C# is certainly another great language to learn.

Where can I learn more?

There are two particular sites to get you started to find out more about the industry. The International Games Developers Association (IGDA) to find resources on networking and communicate with industry people on all aspects of game development from a professional perspective. There is also Gamasutra for the latest news, job postings and further resources that expand on this article.

Good luck with your game development ventures. :)

23 Comments On This Entry

  • (2 Pages)
  • +
  • 1
  • 2

heyoman1 Icon

19 January 2011 - 06:28 PM
What about Mac/Linux users? Using VS, you are being limited to Windows. VS uses the Microsoft C++ compiler, which can't be ran on other OS's. So by using VS + DirectX, you just said goodbye to being cross platform. I prefer being cross platform as how the users of PC and Mac are soon to be leveled off, meaning that Mac users are waiting for you to bring joy to their platform. I like to use Java. It might not be the best choice for game programming because of it's "slow speed". I am willing to invest speed for more expandable classes and an ease of programming. Also for the sake of being cross platform. This way, you are not limiting out those Mac/Linux users.

Just my 2˘
4

atraub Icon

19 January 2011 - 06:53 PM
I too am a bit curious on your thoughts about cross-platform vs, greater functionality. My speculation is that the Mac and Linux market isn't big enough to justify using openGL.
1

ishkabible Icon

19 January 2011 - 07:53 PM
Butch was aiming at showing the industry side of game dev and there isn't much money in Mac game dev and basically none in Linux. there has been some talk about the home brew/ cross platform dev and there may end up being something on it.
0

heyoman1 Icon

19 January 2011 - 09:05 PM
Leaving out Mac/Linux is like leaving out the bass and keyboard in a band. You really can't hear them, yet they are important for a fluent beat.
2

MidnightMindz Icon

19 January 2011 - 11:03 PM
That was an informative article. I'll look into linear algebra and discrete mathematics.

Your idea of what makes something a game is right on the money.
Simple or not, as long as there's a player and at least one rule, by general definition, it's a game.
1

Brewer Icon

20 January 2011 - 07:20 AM
Just because there is no money in Mac/Linux games doesn't mean that these systems can't be used for the coding. I don't know much at all about C++ but my understanding is that the language is cross-platform. Doesn't this mean that the code will be written exactly the same way in Linux as it would be in Windows?

I do all of my programming in Linux, so I am quite partial to this system. The only reason I use Windows is because I can't get Diablo II to run with Wine.
3

Fib Icon

20 January 2011 - 09:13 AM
Yes, C++ is cross platform, but it depends on the graphics/game API that you use. It will be cross platform until until you throw in DirectX, which will only run on a windows operating system.

I agree with Butch on everything he says. He is speaking about industry standards, and the standards are C++ and DirectX. There are very few companies that expand their target audience to mac/linux users.

But that doesn't mean you shouldn't branch out and code for other platforms. I know a lot of mac users who are very sad that they can't run most games. I personally would someday like to make games for mac, linux, and windows.
2

anonymous26 Icon

20 January 2011 - 09:46 AM
Wow, a lot of valid points have been made here that need addressing so I'll take them in turn:

What about other platforms apart from Windows?

Remember that video game development is a business and games will be made for where demand is greatest. Currently demand is with the major consoles and Windows PCs. The Linux environment currently doesn't have great enough demand and those very fond of open source development might resist the very 'closed source' nature of game development (this last point is my own opinion, btw). A lot of time and money can go into making a game - anything up to $4 million I've seen. To make a game for any other platform not considered in high general use greatly increases the risk of the game flopping, studios closing and people losing their jobs.

But Macs are still in widespread use, right?

Yes they are, and I admit to not know much specifically about the Mac platform per se, but I will also speculate that the vast majority of Mac users haven't bought it as a games machine, but for a very specific purpose that warranted the expensive purchase. Secondly, I do not know any Mac gamers, and lastly because of the lack of demand (and maybe some other rights issues in accessing Mac OS tech to make the games in the first place) and games that are developed for the Mac tend to be a lot more expensive than their Windows PC equivalents - therefore weakening the market further.

Cross-platform vs. greater functionality and OpenGL.

It's important to remember that games are made for all platforms to some degree, but it's the business of game development that dictates the target platforms. OpenGL had its day in major game titles like Quake and I understand is still used as a basis in some tech today; OpenGL ES is used for many mobile titles, so there is still very much a use for it primarily because of its cross-platform nature. One of the good things that I am seeing, particularly for Linux is the variety of tools out there to make goes with that allow you to control audio, IO and what have you. The problem with Linux though is the lack of strict standardization of its tools which is something that games do require to avoid ugly bugs.

So games that aren't made professionally have no relevance to video game culture?

It would be ridiculous to claim that, but it is important to not that those who have made themselves rock stars though hobbyist game development through to professional are very few and far between. One of the amazing stories that come to mind are the group of modders who eventually created their own studio Splash Damage - look at them now! All they did was mod games rather than code from scratch. This fortune is extremely rare though.

Sometimes people tend to remember the old days when you could write up an simple game in BASIC, write it to floppy and sell it by whatever means for a few pennies a pop. Nowadays, gamers expect fantastic visual effects and convincingly realistic gameplay which is beyond the capabilities of any individual, this is why it is now more of a business where people have to be hired to produce successful titles, get paid, and have enough future security to repeat the cycle. :)
4

anonymous26 Icon

20 January 2011 - 09:50 AM
And thank you all for your comments so far! :)
0

anonymous26 Icon

20 January 2011 - 09:52 AM

MidnightMindz, on 20 January 2011 - 06:03 AM, said:

That was an informative article. I'll look into linear algebra and discrete mathematics.
...

Over some time I will be writing up tutorials/blogs on these topics. :)
2

Munawwar Icon

20 January 2011 - 12:13 PM
Yup, in the professional world, there are lots of considerations before going cross-platform. It includes features vs cross-platform considerations, demand for the software on the platform, effort-time(or cost) ratio, maintainability of code (code can sometime be buggy on certain platforms), the output the effort can generate, customer support too? etc. Most of the time this 'input to output ratio' is not attractive and most companies would just target windows - and that's sufficient for them.
0

Brewer Icon

20 January 2011 - 04:18 PM
My concern is more selfish than most. I do not particularly care if the programs are portable; I run Ubunutu Linux and I use WINE for all of my Windows apps that don't have Linux versions, and I don't want a Mac. I prefer Linux to Windows because Linux is extremely customizable (as we all know), it is better looking (because I customized it :P), and it seems to be a lot faster than Windows is.

All I want is to be able to do all of my coding (Java, C++, DirectX, whatever) on my Linux system. If I were to use DirectX though I wouldn't be able to do that because I would have to switch to Windows every time I wanted to test my code.

ButchDean, on 20 January 2011 - 01:22 PM, said:

MidnightMindz, on 20 January 2011 - 06:03 AM, said:

That was an informative article. I'll look into linear algebra and discrete mathematics.
...

Over some time I will be writing up tutorials/blogs on these topics. :)


I just started my first course in Linear Algebra a couple of weeks ago and I am taking Discrete Mathematics sometime next year. I look forward to these tutorials! P.S. I have an assignment due Monday and quite honestly I'm fucked, if you could help me that would be great!
1

anonymous26 Icon

20 January 2011 - 07:42 PM
Post it up on the forums and we'll see what we can do. :)
0

anonymous26 Icon

20 January 2011 - 07:46 PM

Munawwar, on 20 January 2011 - 07:13 PM, said:

Yup, in the professional world, there are lots of considerations before going cross-platform. It includes features vs cross-platform considerations, demand for the software on the platform, effort-time(or cost) ratio, maintainability of code (code can sometime be buggy on certain platforms), the output the effort can generate, customer support too? etc. Most of the time this 'input to output ratio' is not attractive and most companies would just target windows - and that's sufficient for them.

There is also the cost of porting code. Whenever a title is produced it is normally for a specific target platform, and for any additional platforms, we must alter the system calls to allow that game to run on the new platform. Porting costs can run as high as half and beyond the original cost to develop the title because porting still significantly ties up resources.
0

ishkabible Icon

22 January 2011 - 10:24 AM
lol Butch has been getting this "what about cross-platform/non-windows game dev" sense he released it the private forms. :)

it would be nice if major engines like Unreal and Crytek would add in OpenGL rendering and other cross platform stuff like audio and input, then the games could be ported easily. that's how games are made to both PSP and Xbox, the engine is cross-platform so there is no need for porting, you just re-compile the code.
1

Tesgah Icon

19 May 2011 - 03:39 PM
Thanks a lot =D
1

aaron1178 Icon

14 June 2011 - 05:41 PM
Nice article Butch, I wish you had it when I started out :) I have to agree, C++ is the game development industry standard. I will eventually start using it when I have the time to start buying some books. I had already knew C# when I started into game development, and trust me anyone new to it, have some basic knoqledge of a language before you start, it really helps.
0

anonymous26 Icon

14 June 2011 - 06:50 PM
Thanks. :)

You don't have to wait for books, aaron. I used to think the same thing - books are great for the theory, but actually writing C++ programs is the best teacher. Start now if you have the time!
2

hulla Icon

23 November 2011 - 01:47 PM
Hmm so OpenGL is cross-platform and DirectX is Microsoft only . . . I really wish DirectX was cross-platform. It would be over-powered lol.
0

aaron1178 Icon

13 May 2012 - 01:18 AM
I have to bring this up, even though it's 6 months since the last posting :rolleyes2:

Don't forget to mention about debugging your games. Sometimes when I am programming in C++ and compile my code, I get errors. The latest error I received was an Access Violation. Now, I've been learning C++ and Game Programming for nearly 8 months and I had no clue what was happening. Bellow is the main loop. (I am learning binary :) )

struct bob
{
	int id;
	float value;
	char* name;
};

int _tmain(int argc, _TCHAR* argv[])
{
	bob data;
	data.id = 2;
	data.value = 1.11;
	//string header = "Testing strings in binary files!";

	ofstream outFile("test.bin", ios::binary|ios::out);
	//outFile.write(header.c_str(), header.size());
	outFile.write((const char*)&data, sizeof(data));
	outFile.close();
	
	cout << "Written to file binary file!" << endl;
	
	struct bob* nData;
	nData = new bob;

	ifstream inFile("test.bin", ios::binary|ios::in);
	inFile.read((char*)nData,sizeof(bob));
	inFile.close();

	cout << "Got binary file contents:" << endl << "id = " << nData->id << endl << "value = " << nData->value << endl << nData->name << endl;
	
	cin.get();
	return 0;
}


*Please disregard the naming of the objects ;)

Some of you might see the error straight away, some... like me, might not. Eventually after about five minutes I had a moment where I thought of the error. Hmm, Access Violation. It's trying to access something, but it can't. So finally I scanned through my code and fount that this line:

cout << "Got binary file contents:" << endl << "id = " << nData->id << endl << "value = " << nData->value << endl << nData->name << endl;

This segment in particular nData->name. How can it access something that's not assigned?

So I changed my code to this:

struct bob
{
	int id;
	float value;
	char* name;
};

int _tmain(int argc, _TCHAR* argv[])
{
	bob data;
	data.id = 2;
	data.value = 1.11;
	data.name = "Hello All";
	//string header = "Testing strings in binary files!";

	ofstream outFile("test.bin", ios::binary|ios::out);
	//outFile.write(header.c_str(), header.size());
	outFile.write((const char*)&data, sizeof(data));
	outFile.close();
	
	cout << "Written to file binary file!" << endl;
	
	struct bob* nData;
	nData = new bob;

	ifstream inFile("test.bin", ios::binary|ios::in);
	inFile.read((char*)nData,sizeof(bob));
	inFile.close();

	cout << "Got binary file contents:" << endl << "id = " << nData->id << endl << "value = " << nData->value << endl << nData->name << endl;
	
	cin.get();
	return 0;
}



An now it works like a charm :) This has taught me a precious lesson. To read the error at hand, think it through, think where it could be coming from in the program and to fix it.
0
  • (2 Pages)
  • +
  • 1
  • 2

Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

November 2014

S M T W T F S
      1
2345678
9101112131415
161718192021 22
23242526272829
30      

Tags

    Recent Entries

    Recent Comments

    Search My Blog

    0 user(s) viewing

    0 Guests
    0 member(s)
    0 anonymous member(s)

    Categories