You can find the previous guide I wrote about more advanced topics here.
I will mark some words which might be confusing to people with little or no programming experience throughout this guide with an asterisk (*), these words will be explained at the bottom of the guide
So, without further ado:
So you want to write a game
A beginners guide to game programming
1. I want to make an MMORPG
I strongly suggest you read this page; I have yet to encounter a better explanation on why you shouldn't attempt to make an MMORPG. (I know this sounds harsh, but there are good reasons for this)
I've just been in a small discussion over at gamedev.net with someone who was new to game development and who wanted to make an MMORPG with friends, and who was too stubborn to take anyone's advice; another gamedev member posted some very interesting and detailed links on MMORPG development, found here:
http://www.gamedev.net/blog/355/entry-2 ... ng-an-mmo/
These are definitely worth a read for beginners and experienced developers alike.
2. I'm going to create the next Halo
We've all had ideas of our perfect game, maybe you're thinking about epic battles, mind-blowing graphics, an amazing story which keeps lingering in your head for months and a breathtaking music score which puts a lump in your throat; you already have visions of becoming filthy rich and everyone adoring you for sharing your extremely awesome game project with the world, the only thing stopping you from making it all happen is writing the damn thing, and that shouldn't be too hard, right? Right?
First of all, to get good results you need to work hard, you have to know what you're doing (more on that later), and there is no easy way to get even the simplest project to a polished state.
Second of all, blockbuster games are built by game studios, studios which have the means to hire experienced employees (and mostly a whole lot of them), the means to provide their employees with the latest technology, the means to promote their work (through a publisher, or by themselves), and a lot more.
You have to face the fact that you probably won't be able to pull off a project like this, especially if you're a beginner and have little to no (game) programming experience.
3. Making games is not the same as playing games
Maybe you're a hardcore gamer, you need your hours of gameplay every day, you know all about flashy terms like "Gameplay balance", "Framerates", "Anti-Aliasing", etc. Maybe you've even gone as far as to join a forum about your favorite game, and have discussed numerous flaws you think the game has, and have posted threads on how these should be fixed in your opinion, you can't be far off from being an actual game designer, right?
The technology behind a game goes much deeper than what the actual player gets to see, the player only sees gameplay elements which most of the time are not too big of a hurdle in the entire creation process.
If you want to start creating games just because you like playing them, I suggest you keep on continuing what you're already doing: playing games.
While creating a game can be fun, the experience is completely different from actually playing them, game development requires you to have a real passion for the underlying technology, it requires you to have dedication towards achieving your goals, it requires you to learn and have a good grasp of scientific topics like math (yes, you will be seeing a lot of math while developing games) and logics, and it will demand countless hours of writing and most of all debugging your code for maybe even years (depending on the size of your project).
If you don't see yourself in all of the above, game programming probably isn't for you.
4. Start small
If you're still here after the first 3 topics, and if you aren't discouraged: Congratulations, we can now go on to the actual technical stuff behind game programming.
The actual plan was to put this topic a little further ahead, but since the content discussed here is rather crucial, I want to talk about this before we get to programming languages and tools.
As discussed in topic #2, a lot of people get into game programming driven by an (in their minds) awesome and mind-blowing idea which will make them incredibly rich; the thing is that like with all other disciplines, you have to build experience and knowledge before you can attempt something big; you can't run without learning how to take babysteps first, you can't build a car without knowing what an engine's for, and you can't build a house without knowing how to lay brick, it's as simple as that.
This being said, I suggest you start off your game programming career with clones of other popular but simple games, a good example being Tetris or Space Invaders.
You might wonder how making a Tetris clone could help you in creating your "super-awesome FPS/RPG hybrid", and I can admit that at first sight the relationship between the two seems rather vague, but the thing is that a game like Tetris can teach you how to design core gameplay elements, how to achieve goals, how to manage and update your game world, etc.
The experience gained by smaller project can eventually lead to a better understanding on creating games on a larger scale, which is exactly what we wanted.
5. The tools for the job
The questions "Which programming language is the best for writing games?" and "Which compiler* is the best?", together with a whole bunch of variants of these, pop up rather frequently on these forums and on other game-programming related sites.
Most people forget that programming languages like C++, Java, C#, etc. and compilers are just tools to get the job done, there is no such thing as "the best programming language", since each language has its pros and cons.
Since we're on the Irrlicht engine's board, I'm going to center this topic around the numerous possibilities for the irrlicht engine.
Natively irrlicht is written in C++, a very powerful language which is essentially an 'expansion' to the programming language C; there are however a good amount of irrlicht wrappers* available for use with other languages, like Java or the .NET family (including C#, VB.NET, etc.).
Because irrlicht is written in C++, C++ becomes a good option for actually writing applications with it; there is a downside to this however: if you're not experienced yet with a programming language, it might be a good idea to stay away from C++, since it is considered one of the more complex languages and is feared by a lot of programmers, beginner and experienced alike, and can become very confusing and frustrating when not already familiar with a set of global programming concepts.
A good alternative would be to attempt to learn C#, a C++-inspired language developed by Microsoft for their .NET framework (or the Mono framework, for non-Windows systems) which can be considered rather beginner-friendly since a lot of the lower-level concepts are already taken care of for you, and you can completely focus on learning basic programming concepts.
Microsoft provides free tools for developing applications in C# for Windows platforms in their Visual Studio Express* line of tools.
In the end, the tools you choose depend on your personal preferences, and opinions differ on which language to learn to get into (game) programming. If in doubt, you can always turn to the forums and see if you can get any advice there (be sure to search for threads which could possibly already answer your question before creating a new thread!)
6. Write games, not engines
After searching some game and game development related sites, you might have come across the term "Game Engine". For those of you not familiar with the concept of a game engine, a game engine is a library or a collection of libraries which contain re-usable parts of code which you can use to build your game. An advanced 3D game engine could contain code for drawing your world, managing your scene, updating your physics, your audio, your AI*, etc.
The presence of discussions about game engines has created a belief that in order to write a game, you need an engine, resulting in questions like "How do I write a game engine?" or "Which elements are essential in a game engine?". The answer to these questions is simple: If you don't know how to answer them yourself, you're just not ready to write an engine, and you should stick with just writing games.
You do not need a game engine to write a game, especially not for smaller projects.
A lot of game engines do not start out as actual engines, but are developed gradually by programmers or teams who have created multiple projects in the past, and who store all re-usable code of these past projects into a common library, which they can then use in their future projects.
When you have a good amount of projects under your belt, and when you feel you want to tackle something larger, you can take the re-usable code from your previous project and build an engine around it, since you should now have the experience and expertise needed to determine what a game engine should do and what it should need.
7. Think problem-oriented
Software engineering, and therefore game programming/engineering, is a discipline which requires logical reasoning and problem-oriented thinking; one of the first lessons you are taught in any software design or engineering course is to look at your project requirements as a set of problems that need to be solved, and to break down those problems into smaller sub-problems which can finally be solved independently with relative ease.
I see a lot of people these days who might have a problem with one of their implementations, and who immediately say "I'm sure someone on the forum can help me out", just to get a very basic answer which they probably could have thought up themselves, and which immediately fixes their problem.
Asking questions on the forum is ok (I'm talking about good questions here), I'm not arguing that, especially if you're new to programming in general, but once you get to a certain point you'll have to learn some essential problem-solving skills, because you can't expect other people to solve all your problems for you.
A good way to start thinking problem-oriented for a certain feature is to write down what you want to achieve, and to make a list of all elements required for that feature. Don't just mentally visualize this list, but actually write it down, preferably with pen and paper instead of a word processor, so you can easily make revisions or add or remove elements later on.
Say you want a moving animated character on-screen with a camera orbiting around it, some possible needed elements would be:
- - An animated, textured mesh representing the character
- A collision detection mechanism for world interaction
- Player-controlled movement
- The orbiting camera
You would be surprised by how much faster your problems can get solved by applying this technique instead of waiting for someone else to do it for you.
Of course everyone can and will hit roadblocks during development eventually, maybe it's because some concepts are not clear enough to you, or because opinions differ about certain implementations/techniques (or because you're working on the cutting edge where no man has gone before ), in those cases the forums are an excellent place to get help and opinions, and to discuss possible solutions to your problem, and I would very much encourage you to do so.
A gamedev.net member has written an excellent guide on beginner game development and all decisions that come with it, feel free to take a look:
I Want to be a Game Developer... now what? (by Serapth)
I will probably be adding to this list in the future, and as always additions and comments are more than welcome!
*Compiler: An application which can take your code and translate it into a language which can be easily 'read' by the computer, making it executable
*Wrapper: A code library which encapsulates or 'wraps' code written in a certain language, and making it usable in another
*Visual Studio Express: A set of free tools for writing and creating applications in various popular languages on Windows platforms, based on their Visual Studio suite. More info here: http://www.microsoft.com/express/Windows/
*AI: Artificial Intelligence
*Object-Oriented Design/Programming (OOD/OOP): A very popular programming/design paradigm where program functionality is built out of different 'building blocks' represented by classes of objects. You can read more about the OOP-paradigm here