So you want to write a game

A forum to store posts deemed exceptionally wise and useful

So you want to write a game

Postby Radikalizm » Thu May 05, 2011 4:03 pm

Seeing as we get a lot of questions from newer people on these forums about getting into game programming, and since a lot of people have been asking for it, I thought the time was right to write this guide.
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)

Addition (08/06/2011):
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/
http://www.devmaster.net/forums/showthread.php?t=13272
http://www.devmaster.net/forums/showthread.php?t=11656

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
    - ...

All these elements pose new smaller problems which can then again be divided into sub-problems until you reach a point where the solution becomes trivial (eg. solvable by existing functionality, by some mathematical equation, logic, etc.); a good grasp of the concepts behind Object-Oriented* design will help you out a lot here, since the OO-paradigm was more or less designed to tackle problems this way.
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 :D ), 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.

Additional material:
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
Last edited by Radikalizm on Sat Aug 06, 2011 1:25 pm, edited 6 times in total.
Radikalizm
 
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Postby 3DModelerMan » Thu May 05, 2011 10:19 pm

Nice post, I definitely agree with the first two :lol: . You might also want to mention the importance of getting the general purpose stuff done right. I've run into a lot of problems before because I neglected error checking.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModelerMan/replicator#tipjar
User avatar
3DModelerMan
 
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Postby Adler1337 » Fri May 06, 2011 12:43 am

Well said Radikalizm. :)

PS:
#2 wrote:writing the damn ding

:lol: :lol: :lol: :lol:
multum in parvo
User avatar
Adler1337
 
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Postby Brainsaw » Fri May 06, 2011 6:50 am

Nice post, I totally agree with it.

1. I want to make an MMORPG


I know some people who actually wrote one, but they are 5 very experienced developers, the game is rather simple (round based, 2D graphics), and it took them like 5 to 6 years to get it to a stable released state with all necessary stuff included.

Code: Select all
3. Making games is not the same as playing games


Well ... I see programming as a game nevertheless. With some great AI btw. The goal is quite simple: try to make the computer do what you want it to do, and it'll do anything to make you fail. ;)

4. Start small


Good tip. My "best project ever" (Stunt Marble Racers) is now in a rather stable state, because it's a very simple game. It still took me almost 2 years to get into this state (OK, I'm the "lonesome-coder" type of game developer ;) ). I do, of course, have a lot of ideas of great big games, but after trying to get games finished for some years I finally realized that this is utopic.

Code: Select all
6. Write games, not engines


Agree on that, but you should always keep reusablity in mind. One of the positive points when writing games not engines is that you will sooner or later realize where you took the wrong way in the current game and can fix that in the next one, so imho the "engine" will be a neverending work anyways.
Brainsaw
 
Posts: 1128
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Postby Radikalizm » Fri May 06, 2011 10:09 am

Thanks for all the feedback :D

@Adler:

"ding" is the dutch word for "thing", I get confused sometimes ;)
I mostly speak english during the day (for classes, projects, etc.), but sometimes a word of dutch pops up

EDIT:

@Brainsaw:
Of course if you like it programming games can become your own personal game, but I think a lot of people expect that within a month they will have a complete next-gen FPS (or any other genre) sandbox set up in which they can create super-awesome encounters and situations without doing any hard work, which is just a silly idea
Radikalizm
 
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Postby Adler1337 » Fri May 06, 2011 4:35 pm

Very understandable. It just sounded kind of funny. :lol:
multum in parvo
User avatar
Adler1337
 
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Postby Brainsaw » Tue May 10, 2011 6:29 am

Radikalizm wrote:Thanks for all the feedback :D
@Brainsaw:
Of course if you like it programming games can become your own personal game, but I think a lot of people expect that within a month they will have a complete next-gen FPS (or any other genre) sandbox set up in which they can create super-awesome encounters and situations without doing any hard work, which is just a silly idea


Totally agree with that. Unlike (most) "other games" you need a lot of time to get into programming, and even more until you can see it this way (imho). I've been programming for more than 15 years (with "real" programming languages, not Basic 2.0 or Amiga Basic ;) ) before I actually started to see it this way and before I finally got a game finished.
Brainsaw
 
Posts: 1128
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Postby Radikalizm » Wed Jun 08, 2011 12:13 am

Bumpity bump! I've added some more info on the first topic about MMORPGs
I'll be updating the guide soon with some additional points as soon as I have the time
Radikalizm
 
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Postby LizardGamer » Wed Jun 08, 2011 2:08 am

This is very good for beginners, (like me), becuase before I go off and make the next quake/unreal clone, I'm going to make a very simple/fun platformer.

Great job Radikalizm!
User avatar
LizardGamer
 
Posts: 83
Joined: Fri May 28, 2010 8:59 am
Location: Perth, Australia

Postby Brainsaw » Wed Jun 08, 2011 6:33 am

Great links. Thanx for sharing.
Brainsaw
 
Posts: 1128
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Postby Radikalizm » Wed Jun 08, 2011 12:23 pm

Added another link posted today on gamedev by a developer working om GuildWars 2, again a very excellent read for both beginner and experienced programmers
Radikalizm
 
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Postby Brainsaw » Wed Jun 08, 2011 1:37 pm

Yet another great article. I think it views things from some different angle, interesting stuff.
Brainsaw
 
Posts: 1128
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Postby REDDemon » Thu Jun 09, 2011 8:11 am

Good article, as always the first tip to follow when writing games is to follow also gamedev.net
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
User avatar
REDDemon
Developer
 
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Postby Radikalizm » Sun Jun 12, 2011 3:06 am

Bump!
Finally got around to adding point 7 about problem solving!
Radikalizm
 
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: So you want to write a game

Postby Virion » Thu Jun 30, 2011 7:39 pm

very good article for beginners.
User avatar
Virion
Competition winner
 
Posts: 2141
Joined: Mon Dec 18, 2006 5:04 am

Next

Return to FAQs, Tutorials, Howtos, and external tool lists

Who is online

Users browsing this forum: No registered users and 1 guest