How to get started in game development!

Moderator
Posts: 508
Joined: 2002.09
Post: #1
Edit: There's a more thorough article, here: http://www.idevgames.com/articles/for-beginners


0. An idea

When you think you're finally ready to create a game, or to start your journey in game development, the first problem you'll encounter is come up with a good idea. All too often the first ideas that come up are copies of the current state of the games. The idea here is to stay with your feet on the ground.

You either fall into 2 categories:

a) you're a complete beginner with little or no programming experience

In this case, start simple. Try to copy an old school game like Pac Man, Missile Command, or perhaps a simple board game like checkers.. You would surprised how much success a game like these can have. Not only will you be making a game that most people will be able to run, but also most of them will already know the rules and can start playing immediatly.

b) you're an expericed programmer or have at least read a book about C

When you already know what programming is all about then it's a little easier for you to get started on the more advanced games. Even when you are an experienced programmer, it doesn't hurt to start off simple, just to get to the feeling how programming games differ from boring administration applications.
In some cases you may want to learn a new language or learn about some specific topics.

1. The languages

There are so many computer languages that many beginners get lost in them and never learn anything. I'll cover the most appropriate languages here. If you thought you could make a game in COBOL, you are in the wrong place.

a) C

This is one of the most prefered languages by programmers. While it may look complex at times, it's actually very logical. Most games are written in C, Marathon and Duke Nukem 3D to name just a few.
One of the most difficult parts to understand, at least for beginners, are pointers. But once you know them well enough, you will write your game in no time.

b) C++

When we talk about OOP (Object Oriented Programming), C++ is one of the first language to be picked. This language offers a way to structure your game objects in classes. But there a few caveats to this language.
There's a lot that's happening behind the screens and sometimes your app may behave differently, making your debugging life a living hell. C++ is also a very complex language. Once you get into multiple inheritance, templates, operator overloading... you'll quickly discover why some forum members dislike C++ and would rather use C

c) Objective C/Objective C++

Objective C is what's used when you develop Cocoa applications. Its syntax is very much like C, but it's a little different. You could say that this language is like an OOP version of C, without the dangers of C++.
It's a very clean language and is often used by beginners, since Cocoa offers a simple way to do complex things, or things that would be complex to do in other languages.
The cool thing about this language is that you can combine it with C. In case you want to combine it with C++ you'll need to use Objective C++ (which isn't very different from Objective C).

d) Java

While Java is a relatively new languages. It's a good choice to write simple 2D games. Don't expect it to work fast, but it's an interesting way to create cross platform games without having to deal with porting. Also, if you want to create a complex 3D game, DON'T use Java. (Java can be used for simple 3D games. Runescape is an example of this). An excellent IDE and library to get started with Java is Processing, free at http://processing.org.

e) Python and PyGame

One language that is growing ever more popular among newbie game developers is Python and the game library, PyGame. Python is a pretty simple language to get a hang of, and it's powerful enough to write really good shareware games. Starting in Python will also be a good stepping stone for moving on to C++ later. Google for Python and PyGame tutorials, and you may well be on your way.

f) Scripting languages

Some members that have written games have also made use of scripting languages. The way this works is that you write you game in C (for example) but the AI (artifical intellegence) or the way a level loads is done via a script.
I won't go much further in this, but you are welcome to ask about them on the forum.

2. The Tools

There are a lot of tools outthere, so again I'll cover the ones that are used more:

a) Xcode

This is the IDE (Integrated Development Environment) for developing apps in Mac OS X. You can write things in C, C++, Objective C, Objective C++, Java and even AppleScript.
The IDE is quite good and has integration with SCM (Source Control Management) systems, like CVS, SVN, ...
Xcode is currently the only tool that allows you to create Universal Binaries (ie apps that work on both PowerPC and Intel CPU's).

b) CodeWarrior

Before Xcode, the CodeWarrior IDE was the defacto standard for development. You could do Windows and Mac OS apps, and there were version to develop for specific game systems.
Unfortunatly, CodeWarrior is a dying breed. And since it will never be able to make Universal Binaries, you should avoid it at all costs.

c) Make

Make is a UNIX command that's used to compile applications on the command line. So essecially you don't need an IDE to do some programming. A copy of GCC and a good text editor (not Word!) is probably all you need.

3. The Libraries

So, at this point you should be ready to start a project. But, there's one thing I haven't covered. How can you turn your game into a multimedia experience? You'll need 2 things, graphics and sound.

Graphics

a) SDL

This is a good framework for making 2D games, although it can be rather slow when used alone. For the best experience, you should use it together with OpenGL.

b) OpenGL

This is what most game developers use. It's a very good framework that can be use for 3D games aswell as 2D. It has many extensions and is, what's most important, very fast.

For starters, NeHe offers a great list of tutorials to get you started with OpenGL.

c) libpng, libjpg, ...

There are a bunch of other graphics libraries. These are usually used to load an image from your hard disk and convert it to a texture so you can use it in OpenGL. Do a Google search and you'll find some interesting links about them.

Sound

a) QuickTime

By far the easiest way to get sound off your game. There's isn't much setup required and it can read various formats.

b) OGG/Vorbis

This is a different format, much like mp3 but smaller and sounds equally good. It's a C API so a good grasp of the C language is welcome.

c) OpenAL

Like OpenGL but for audio. This framework allows you to put virtual speakers on a 3D enviroment. It can only read WAV files, but search on the net and you'll find how you can enable it to also read OGG file.
This is what most games use.

4. Now that you know this...

Once you've picked and learned a programming language, the next step is usually to pick the libraries you want to use. This is not necessary in some occasions. Many beginners, and also some advanced game programmers, will use Cocoa to create their great game. With Cocoa, you have the best of all worlds. Not only does the framework already know how to load images, sounds and other assets, but you can easily combine it with other libraries.

Not everybody likes Cocoa though, and even worse Cocoa may not be the ideal solution for certain types of games. In fact, there's no Eutopian environment for creating games. The old saying "the right tool for the right job" is very true in game development.
I didn't cover it, but what some guy can do in C++ another guy can do exactly the same thing using Flash. There's a reason why I didn't cover Flash in this thread. Flash is more likely to be used in a web environment. While you can save a Flash project as a standalone application, it's not done so much.
Remember what I said: "The right tool for the right job"!

You now have enough information to create games. Experiment, try something new, go nuts... You're only limited by your imagination. The best thing for a game developer is to team up with someone who can create assets for your game. Very few programmers tend to have artistic abilities, but if you are one of them that has, the better!

Happy coding and don't forget to let us see/test your work!

To be continued

Useful links:

http://www.idevgames.com/forum/showthread.php?t=10561
http://www.idevgames.com/forum/showthread.php?t=9165

PS: Thread is open for discussion. Please stay on topic.

Edit: Fenris added Python/PyGame

"When you dream, there are no rules..."
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2008.11
Post: #2
hi...

thanks for the valuable details posted here....

its like a book in hand...

simply superb...

update it regularly...

thanks in advanceSmile
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #3
There is a lot to add and discuss here. Lots of useful pointers, but also quite a few personal opinions (best avoided in a text like this IMHO) and a bunch of downright incorrect statements. I don't want to be impolite or negative, so... Should we start with the factual errors?
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #4
Well, the thread is open for discussion, so you might as well have at it if something is bugging you about it. Smile
Quote this message in a reply
Moderator
Posts: 679
Joined: 2002.11
Post: #5
Well, I would start by saying that PyGame may not be the best Python game programming library anymore, and pyglet should be listed as an alternative.

I'm not a fanboy, no way...I just made a couple of games in it...

My web site - Games, music, Python stuff
Quote this message in a reply
Member
Posts: 260
Joined: 2005.05
Post: #6
A few opinions of mine:
Taxxodium Wrote:There are so many computer languages that many beginners get lost in them and never learn anything.
This tells the reader to avoid knowledge and go for ignorance. Knowing one more language is one more tool in your toolbox. Too many programmers can't see beyond {}.
Quote:If you thought you could make a game in COBOL, you are in the wrong place.
Why? Of course you can make a game in Cobol. Few people have the tools, but if you like it, why not? Not that I would, but I don't mind if someone does.
Quote:Xcode is currently the only tool that allows you to create Universal Binaries (ie apps that work on both PowerPC and Intel CPU's).
Not correct. No serious, reasonably up-to-date IDE prevents you from building universal binaries.
Quote:b) CodeWarrior
You can skip this. It can't be bought any more. The IDE is better than Xcode in just about any way I can think of, but since you can't find it, beginners don't need to worry.
Quote:c) Make

Make is a UNIX command that's used to compile applications on the command line. So essecially you don't need an IDE to do some programming. A copy of GCC and a good text editor (not Word!) is probably all you need.
Make is step 2. Calling gcc directly is step one. You can also use a bearskin and a stone axe or rub two sticks together. (Is the Unix command line really the best place for a beginner?)
Quote:a) SDL
I have nothing against SDL, but out of curiosity: Why is GLUT game mode not mentioned?
Quote:For starters, NeHe offers a great list of tutorials to get you started with OpenGL.
I think a few good books on linear algebra and computer graphics is a better starting point. Much will be hard to understand otherwise.
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2009.04
Post: #7
Hello,

Just wanted to drop you a quick line Smile this was really good and informative thanks a lot, its kind of like a complete guide which is very good!

So yeah thanks!
Quote this message in a reply
Apprentice
Posts: 7
Joined: 2009.06
Post: #8
I'd like to mention Code::Blocks as a decent alternative IDE to Xcode if you are just starting out. It's free, multi-platform, and there are a lot of project templates, and set-up tutorials out there.

It's really good if you're starting to learn C++, as many books start you out on command line apps, and Code::Blocks is pretty nice for that sort of thing.
Quote this message in a reply
Member
Posts: 26
Joined: 2010.01
Post: #9
This is a huge topic, but I'd add a few helpful tips from my 10 years (or rather 12 now - time flies) as a games industry professional:

1. pick one language and become expert in it, before you try to learn more
2. be realistic - most beginner game projects fail because they are too ambitious
3. try not to write code more than once - package code up so you can easily re-use it
4. know your middleware - an easy way to add features is often to buy or borrow them
5. be aware of your data pipeline into the game and where you spend your time

Some of these things are harder than others, and many of these one liners are just pointers into large subjects that many professional development studios still struggle with. But there's nothing like at least knowing the big issues Wink

If you're really interested, I'd recommend you read Game Coding Complete, by Mike McShaffrey. Out of all the books out there, this is one of the few that contains enough real, nuts-and-bolts useful stuff that I'd be happy to recommend it.
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2010.02
Post: #10
That's a very informative thread with great starting points - thank you guys!
Once question thought - what are the alternatives to Cocoa?
Quote this message in a reply
Member
Posts: 20
Joined: 2010.09
Post: #11
I'd like to add than as a newbie myself to game development (C/C++ expert tho) that I got a lot of mileage of the book "Game Physics Engine Development" and the "OpenGL ES 2.0 Programming Guide". I ended up rewriting my physics and math libraries after reading through the physics book. At least these kinda references foretell the math, data structures/organization, and operations that any game will require. Good Luck.
PS. Taxxodium, your post was awesome.
Quote this message in a reply
Nibbie
Posts: 3
Joined: 2011.01
Post: #12
Hi all,

This topic is a huge topic as everyone know. Thanks for the tips but I think it would be more efficient if you specify one subject. You wanted to present a little piece from every platform and it makes this topic just an idea of game programming world.

Maybe it would be better to explain just the tools needed for specific platforms. For example if some one wants to develop Iphone games better to offer him to use xcode, cocos2d library... etc. and explain them for short.

as I told it is a huge topic.

Thanks for your hard work.
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2011.03
Post: #13
Quote:C++ is also a very complex language. Once you get into multiple inheritance, templates, operator overloading... you'll quickly discover why some forum members dislike C++ and would rather use C

But that's the beauty of C++. You pay for what you use. Been programming for ten years with it and have never used multiple inheritance and only rarely overloaded operators. OTOH, others make heavy use of templates, MI, operators, etc. You don't have to use every feature of a language to be productive with it. Far from it. Use what works for you.

My advice for a beginner would be to stick with with the STL instead of rolling your own containers, smart pointers instead of raw pointers, and enforce RAII and you will not have the legendary coding nightmares that haunt many beginners. Another tip - disable the copy constructor and op= by default in your classes and pass by const reference. You'd be surprised how rarely you need a true copy of another object.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #14
And the mere fact that you have to make those suggestions (which are utterly useless to someone new to C++, by the way) is very good reason to avoid it entirely.
Quote this message in a reply
Moderator
Posts: 434
Joined: 2002.09
Post: #15
(Mar 11, 2011 05:24 PM)OneSadCookie Wrote:  And the mere fact that you have to make those suggestions (which are utterly useless to someone new to C++, by the way) is very good reason to avoid it entirely.

Well said. :-)

I've used C++ for many years, and was pretty stoked about it coming off of C. And I'm still using it for my day job. But I'm with OSC on this one. When something goes wrong in C++ the conclusion is often that you shouldn't have used that feature of the language at all, or in that particular way.. but the language always lets you hang yourself in that way.

Huge improvement over C, mind you. But that's not really a big selling point any more.

Not arguing that it doesn't have it's place. (And I have serious reservations about turning compile-time errors into runtime errors, which is the new fashion.) But as a first language C++ is a poor choice.

Measure twice, cut once, curse three or four times.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Switching developers mid-game development fauxdev 4 639 Feb 17, 2014 05:46 PM
Last Post: funkboy
  [Book] Cocos2d for iPhone 1 Game Development Cookbook NathanBurba 1 4,830 Jan 8, 2012 05:40 PM
Last Post: mmztech
  Help with getting started Filsk15 9 7,541 Nov 19, 2011 10:38 AM
Last Post: fugufish
  iphone game development on Windows? Briksins 22 20,977 Dec 19, 2010 01:43 PM
Last Post: sefiroths
  Learning Cocoa game development Miglu 17 15,408 Aug 8, 2010 02:25 PM
Last Post: Miglu