Archive | Games RSS feed for this section

Minimum requirements for game programming

26 May

“I’m interested in learning programming but I’m not sure how or where to start.”

This is an interesting statement, often come across by most programmers on forums, blogs, social media and pseudo-forum sites and most of the time the answer is the same. What I want to do is answer the question from a game programing perspective, firstly to disclose I’m not a professional or a graduate as yet however from my various searches and intrusions and questions asked and read on the above mentioned site I have gathered a fairly complete idea of what is requested. So lets begin leveling up.

Armour – Get the right Hardware

Samus and her trusty Powersuit

Chances are since your reading this that you already have the necessary hardware requirements covered. But if you’re looking for facts and figures this is what I would recommend.  These requirements are future proof so as your skills improve and you start shifting towards more graphically and mathematically complex games you don’t find yourself needing to upgrade your machine to use a more powerful development environment.

  • Computer that has a 1.6GHz or faster processor
  • 1 GB (32 Bit) or 2 GB (64 Bit) RAM (Add 512 MB if running in a virtual machine)
  • 3 GB of available hard disk space
  • 5400 RPM hard disk drive
  • DirectX 9 capable video card running at 1024 x 768 or higher-resolution display
  • DVD-ROM Drive
Most netbooks support these specifications and are a cheap low-cost investment. I would also recommend getting a netbook which can be connected to a monitor (most netbooks already offer this, I think?), preferably one which supports a resolution of 1280 x 1024 pixels.

Weapons – Basic Sword to the ultimate Blade

There are a few ways to tackle programming, the easiest and most direct route would be to learn Python. Python is a simple, dependable and compact language where most complex code is already done for you, it has a few popular graphics libraries (Pygame, Pyglet), which have been tried, tested, taken apart and put back together.  I strongly discourage you to start of in Python, I dislike the language you can read about it here, other than the reasons mentioned in that blog post I feel that Python, particularly in game programming gives a false sense of accomplishment which will cause disappointment as you start to expand your horizons and find that other lower level languages add a new level of complexity.

My recommendation is to start by learning “the C language“, it has a much steeper learning curve but allows you much more flexibility and a wider variety of libraries, game engines and scope if you decide to go professional. It also allows you to branch out to most other popular programming languages like Java, Objective – C, D, C#. It also allows for natural progression to learning and using C++, the professional grade language used by your favourite game programmers or development houses.

Level 01 – Learning C

The easiest way to learn C is to learn by example. Start by taking a book read chapter, do the examples and then the questions and repeat. This is going to be tedious, difficult, and tiring but by the end you should have covered:

  • Variable
  • Loops
  • Functions
  • Pointers (Very Important)
  • Reading / Writing to Files
  • Arrays
  • Structures and Unions

Level 2 – Learning C++

Using the same method as before. You should cover the following:

  • Classes
  • Strings
  • Templates
  • Operator Overloading
  • Function Overloading
  • Exception Handling

Level 3 – Data Structures & Algorithms

Once you get comfortable with Level 1 and 2 your ready to progress to level 3, the most important level in game programming. This is absolutely brutal and probably the hardest part of programming but the most essential, efficiency, searching and retrieval of data, decision trees and many others. Learning a few of these topics wont hurt.

  • Linked Lists
  • Searching & Sorting Algorithms
  • Hash Tables
  • Recursion
  • Trees
  • C++ Standard Library
  • Boost’s C++ Library

Level 4 – Graphics Library

At this point you have a couple of options, you can continue going slow and steady or jumping right in. If you want to continue going slow and steady you can try learning SDL, it’s a basic graphics library that allows you to create 2d games and even simple 3D ones, it is a tried, tested library which is being prepped to work with the iPhone.

The other alternative is moving straight to the meat of game programming and start learning DirectX or Open GL.

The third option that you have is to use a game engine, there are plenty of options depending on your requirements 2D, 3D, Isometric. Engines that have a large user base and well written tutorials are the Unity Engine, Unreal Engine, Panda3D amongst many others.


By this point if you have covered and are familiar with many of the intricacies of a programming language and graphics library and or and game engine your well on your way to becoming a game programmer, the road is hard and difficult but make google your best friend and you’ll be able to bring you ideas to life in no time.

If you have any questions or think that something is wrong do let me know.

12 Months, 12 Games

2 Jan

Programming requires motivation, and motivation requires an idea that your interested in, and I’m interested in video games. Taking my interests into consideration and to fatten up my portfolio, I’m going to start a second project for 2011, 12 games in 12 months 🙂

Most of what I program doesn’t really interest me or make me want to pick up a new skill or challenge myself. It becomes mundane and everyday. In order to inspire myself and get those creative juices flowing I decided to start this project. The language that I have decided to use is Python 3 and most games will have a text-based gui, or be in 2D using pygame. The source code for the games will be available publicly on my git. One of my goals for is to make these games as casual and accessible as possible, with high replay value.

The games / genres / clones that I would like to make are listed below, I may change some of these around as time goes by removing the less challenging ones.

  1. Text Based Adventure
  2. Hangman
  3. Battleships
  4. Pong
  5. Asteroids
  6. Sidescroller
  7. Shooter
  8. Rougelike
  9. Children’s Game
  10. Racing Game
  11. Tamagotchi
  12. Tetris
  13. Snake
  14. Scorched Earth
  15. Minesweeper

It’s a little more than 12 games but I’m bound to remove a few at a later date. The order might change as well but I’m going to start with the Text Based Adventure.

First Programs I’ve written

8 Apr

Recently, as in today while cleaning up my Code folder I can across a simple Hangman game that I had written a long time ago back when I was just completing my course in C++ and trying to make sense of it all.

Mind you it is very basic and needs a lot of work to make it more efficient and meet the standards required. So without further ado, cast your eyes down upon my very cool code :).

	Author: toughaspixels
	Purpose: To study and understand the use of STL ad Vectors
	Date: October 26th, 2009
	Modfied: April 7th, 2010
        License: Just let me know your using it please, feed my ego

using namespace std;

int main(){
    const int MAX_WRONG = 8;
    vector<string> words;
    random_shuffle(words.begin(), words.end());
    const string THE_WORD = words[0];
    int wrong = 0;
    string soFar(THE_WORD.size(), '-');
    string used = "";
    cout << "Welcome to HangMan. Good Luck!" << endl;
    while((wrong < MAX_WRONG) && (soFar != THE_WORD)){
        cout << "You have " << MAX_WRONG - wrong << " incorrect guesses left." << endl;
        cout << "You have used the following letters " << used << endl;
        cout << "So far, The word is:\n" << soFar << endl;
        char guess;
        cout << "\n\nEnter your guess: ";
        cin >> guess;
        guess = toupper(guess);
        while(used.find(guess) != string::npos){
            cout << "\nYou have already guessed " << guess << endl;
            cout << "Enter your guess: ";
            cin >> guess;
            guess = toupper(guess);
        used += guess;
        if(THE_WORD.find(guess) !=  string::npos){
            cout << "That's right! " << guess << " is in the word." << endl;
            for(int i = 0; i < THE_WORD.length(); i++){
                if(THE_WORD[i] == guess)
                    soFar[i] = guess;
            cout << "Sorry, " << guess << "is not in the word." << endl;
    if(wrong == MAX_WRONG)
        cout << "GAH!! GUH! NOOOOOooooooo\n Your hanged : ) HAHAHAHA" << endl;
        cout << "\nYou guessed it : ) Your awesome." << endl;
    cout << "\nThe word is " << THE_WORD << endl;
    return 0;

There you have it folks, enjoy.

Please feel free to use my code, just make sure I get credit or at the very least let me know whose using it.

Get into Game Programming

10 Nov

Information, especially finding good information takes time and patience especially since it is spread all over the internet, creating and maintaining a list of this is hard and extremely time-consuming. This guide attempts to educate you in-game programming, how to start, what to do and eventually how to break in and build a portfolio.

About Game Programming
The games industry, is a very profitable, very competitive industry. It has very high barriers to entry, because it is a very difficult field. Programmers are constantly learning and becoming fluent in programming languages, scripting languages, game engines, graphics engines, tool kits, directx, opengl, openal, ai, various API, SDK’s, methodologies, math etc. By keeping the barriers at such a hight they manage to separate the motivated (ie. those who want to get in) and those who just feel like it (ie. those who think its cool, easy or are just lazy). A few things that you should know are the long stressful hours through out development and more so during milestones and crunch time, salaries are also not high by comparison to other fields of development.

But it has its advantages, programming games is very cool and a lot of fun and like me I’m sure other programmers hobbiest or professional get that happy, fuzzy feeling when they see something they created being played and enjoyed by others. It is also a very dynamic work environment where you are surrounded by like-minded, smart and creative people, the work itself is challenging and no two problem are the same. More importantly these people will get that obscure Star Wars or Doctor Who reference 🙂

How to Start
At the heart of any game is the engine, which does the herculean task of rendering images and processing input. To have any interactivity at all you need to know how to program.

Which Language should I use?
You have countless choices of programming languages to learn for a variety of platforms, fortunately these languages all quite robust share common elements, learning one means that you can quickly pick up and learn another in a relatively short time.

I have adopted a five star system where one is the easiest and five the hardest, these are my opinion and I have tried to make them as beginner friendly as possible.

Compiled Languages
C ****
Regarded as many as the greatest of modern programming languages, It is very robust and portable, the same code can be ported to Linux or Windows with very little changes being made. It has a community online whom you can get help from and countless tutorials and lessons. You have access to thousands of libraries written over the last 30+ years that will make life easier. Used to be the industry standard.

C++ *****
This is the industry standard today, it is used in almost all major platforms from the PC to the Pandora. As a result of its wide spread use it is a very powerful language that is a superset of C, as a result you have access to thousands of libraries written for C and the thousands more written for C++, can write extremely portable and reusable code thanks to Object Oriented Programming features such as data abstraction, encapsulation, polymorphism, and inheritance. Unfortunately it is not one of the easier languages to learn.

Java ***
Java is a strange language it is not exactly a compiled language and nor is it an interpreted language.
I’m not entirely familiar with and nor am I fond of Java and this may colour my opinion. It is a very powerful language but its scope in-game development so far has been extremely limiting, however it is used for a lot of web-based games, applets, mobile applications and the Android OS contains sections of code written in Java. It is not very difficult to learn in fact John Carmack suggested that beginners start learning programming using Java, as you can immediately start making simple 2D games, but unless utilized properly it is very slow.

C# ***
This is Microsoft response to C++, it is a very robust language and you can port your game from the Xbox 360 to the PC or vice versa with almost no trouble. It is a fairly easy language to learn and also integral to the industry. You also have access to XNA framework which is used by companies to make Xbox Live games. You can easily create Windows applications with speed and without hassle compared to the other languages.

Interpreted Languages
Python **
Python is a hybrid, an extremely powerful language with EVE Online being coded entirely in Python, Civilization 4 also has python bindings as a part of it to allow the mod community to easily modify and create for the game. In my opinion python has not exactly found its place in the industry because it can do so much, but common uses for it are in scripting and indie gaming.

Lua **
I have never used Lua so I am unable to judge it, but from what I read and the few tutorial I checked out, it is not very hard to learn and a very strong scripting language.

Order in which to learn
This is by no means the best order to learn the languages, but it allows you to get familiar with the concepts of programming and the methodologies without getting bogged down and hopefully motivate you to pursue the other.

1) Python
2) C
3) C++

I have not included Java, C# as you can study those after you master the languages above. Java and C# have been excluded particularly because they were created to make the developers life easier tend to lull beginners into a false sense of security as a lot of the backend and low-level development is hidden. While this has its positives in the hands of an experienced programmer in the hands of a beginner it can cause all sorts of headache and code bloat. There is a reason that C++ is the industry standard not just in games but also in various fields of software development because of its low-level access.

Lua is not mentioned as until you have knowledge on programming you wont know how to include it in your game.

A word of warning though, once you learn the three languages above you still have a very long way to go before you can make a full 3D game or even a 2D one, most of the code you will write in the beginning will only run on the command line. But don’t fear once you master the basics you can advance to the fun stuff.

Which Books should I read?
The following is a set of Books that I have read, No review is given just how easy is it to follow, also most of these are not about game programming they are about learning the language.

Language Title Author Ease of Use
C How to program in C Dietel *
C The C Programming Language Kernigham & Ritchie ***
C++ Accelerated C++ Koening & Moo ***
C++ The C++ Programming Language Stroustourp ****
C++ Beginning C++ Game Programming Dawson **
C++ Thinking in C++ Vol. 1, 2 Eckel ***
Python Learning Python Lutz *
Python Programming Python Lutz **

Check the following for more recommended books with review.
Daniweb Recommended Books C

Daniweb Recommended Books C++

Peer Reviews

Reviews and Recommendations by Yaustar – Also has link to free ebooks

GameDev Books

Which Online tutorials should I follow?

In all honesty it is better to follow a book rather than a tutorials as it may lead to shortcuts and bad habits, but a few that I check out are:

Language Website

I N33dZ t3H h3lP?!!@??
First off, never start a forums topic like that, your going to get banned. Secondly read this.

The best forums for programming help are:

In the next few days I will add information on game engines that will be a natural progression to what you’re learning and a proper list of web resources.

Feel free to comment, question, suggest or criticise.

Mod Spot: Kotor 2 Fix

14 Oct

Knights of the Old Republic 2, we feel, is a fantastic game. It’s also undoubtedly a wounded game: a lonely game that knows it’s incomplete as it is but just can’t bear to admit it to itself. It’s okay, KOTOR2. We’re here for you. Shhhh. We’re here.

These are the brave words by the developers trying to fix the game for us all.

Knights of the Old Republic (KOTOR) was an RPG created by Bioware that takes place about 4000 years before the Star Wars movies. The game broke countless boundaries and won numerous awards, needless to say a sequel was in the works and expectations were very high.

For KOTOR 2, the developers behind the Never Winter Nights series were given the reigns, but they had to rush in order to meet the holiday deadline and needless to say the game was incomplete and felt unpolished. Fortunately they had made a nearly complete game and the modders took it upon themselves to add this missing content.

To see whats missing visit the team gizka website.

Also check out the trailer for The Old Republic, it looks amazing but proceed with caution. It will get your geek on 🙂

Programming Challenge: Battle Ships

14 Mar

I have been studying programming for about a year now and want to challenge myself to see how much I know and still need to learn so I decided to make a small game based on battle ships.

Its going to be a fairly simple console based version to which I am hoping to add features and functionality as I learn more and more.


  • Written in C language to be ported later to C++ or C# and made a console program
  • Should display the screen using X
  • The ships will be displayed using DDDD for destroyer, and be allowed to place vertical or horizontally
  • Basic battleships rules apply
  • It will have single player initially and hopefully multiplayer on both the same machine and over a network
  • Cross platform compatibility on Linux and Windows
  • Specs maybe changed or updated at a later date

Software Used:

Sakura the saving grace

25 Feb

Anyone who has seen Smallville can attest to the fact that it has got a basic formula for every episode, somethings happens and Clark has to solve it and spend the last 10 minutes talking the Lana about it and their relationship while the audience snoozes.

He would have made a better choice 😛

Now they expect Kirsten Kruek (Lana) to carry the first Street Fighter movie after the critically acclaimed Van Damme version to succcess and any any future movies fans would want to watch such as *cough Ryu and Ken would be made only if this movie which seems to be going the Halle Berry Catwoman way.

Now I have no problems with them basing movie on the background of Chun Li as she is one of the title characters of the games but the casting as any google search will prove is all wrong and leading towards one big box office catastrophe. Just watch any of the trailers they are all bad. Kirsten Kruek just can’t show the strength, power and depth of Chun Li’s character.

Capcom has probably finally seen the movie and realised that the movie is not working out at all and they need to help give it a push to cover the budget and are releasing an animated short on Sakura at the end on the movie after the credits roll. This will be done by the same company behind the animations of the Street Fighter 4 game and should be far more pleasing than the live action disaster.

%d bloggers like this: