Alright, this one is a bit tricky, as frankly there are literally hundreds of programming languages, but I will cover off the most popular ones.
I want to learn game programming, what language should I use?
Once you get a bit more advanced, check out
At this point I would recommend buying a C++ book such asthis one.There are a ton of resources on the web, but many are outdated or wrong and the sheer volume is overwhelming. Having at least one good beginners guide is ideal.
Alright, back to being negative again. You cant create an MMO. You and 10 of your best friends cant create an MMO, unless of course your 10 friends are all A-list developers and even then frankly you still cant afford to create an MMO. Got a few million dollars? No? Then drop it, an MMO isnt the way to go. Now, some day you may be able to work on a Warcraft killer, but as your first project well frankly thats like trying to find a cure for cancer in your high school chemistry class. Aim lower, much much lower.
Currently in its 8th edition, this is a pretty good first book for a programmer to learn with. It covers pretty much all of the language features and even covers Boost libraries, which is a valuable addition. Keep in mind, this book, like most introductory texts, does not cover GUI programming of any form.
This is Microsofts primary game SDK ( Software Development Kit ) for creating games on Windows and Xbox using C++ ( not be confused with XNA ). Unlike OpenGL, DirectX also supports Input and Sound. Microsoft has providedsome fairly good tutorials.One thing to be aware of, DirectX 10 and 11 require Vista or higher, so no XP support! That said, DirectX is no doubt the most popular SDK to use for commercial Windows games.Beginning Game Programmingis probably the best beginner friendly DirectX book, but keep in mind, you do need to understand C++ already!
Delphi was a time I would highly recommend this language, but this havent progressed well for Delphi. Ironically, the guy that invented C was the guy behind Delphi. Support just isnt there, which is a shame as the language is very friendly to newer developers.
Netbeans for C++NetBeans is another Java IDE that supports C++. Its actually surprisingly new user friendly but now that Oracle is in charge, expect that to end!
At this point, you should be ready to consider making a game. Start with something small, like creating a PacMan clone or something similar.
EDIT:If you are interested in Lua, be sure to check outBattle of the Lua game enginesfor more details.
Oh, and Oracle own them now of all the tech companies in the world I would want in charge of my language of choice, Oracle sure as hell wouldnt be the company I would pick. For people that think Microsoft are the devil they dont know Oracle! Their throwing around lawsuits left, right and center ( including Google/Android ) would not make me feel good about things.
Of the two, I would recommend Visual C++ personally, unless of course you arent running Windows. There are a few other options, but they all require a bit more work or installing plugins, but I will list them for completeness
I will try to address all of these questions and more in the following post.
Alright, back to the whole C++ question. Should you start learning with C++?NO.See, no maybe, no wishy washy answer or caveats, its simple, C++ is an epically stupid language to start with. Its about the same as starting to learn math by starting with advanced calculus. Again, dumb. If you are going to listen to a single piece of advice I give, its DO NOT START WITH C++. I know, of course, that you are going to completely disregard this advice and start with C++, but in 3 or 4 years when youve got the scars and trauma from ignoring my advice, Im going to smugly *tisk tisk* and give you my best I told you so!. I will offer another piece of advice while I am at it anyone that recommends you start with C++, in the future ignore their advice!
One last point I think should be made here, your choice of IDE has absolutely no affect on how cross platform your code is! Code ( properly ) written in Visual C++ can be later compiled for Mac OS and Linux, for example.
Udemys Beginners Guide to C++is an effective single page C++ language primer.
C++.NET On the topic of .NET languages, C++ also made a special version of C++, with additional keywords to make it compatible with .NET libraries and a mode that makes memory management automatic. That said, it was a kind screwy-hackish implementation and nobody really took to it, so you can probably ignore C++.NET completely. The only real use case I can think of is, if you only know C++ syntax and want to do GUI development with WinForms, this may be the way to go. That said, thats a pretty damned minor use case!
When it comes to tools, the choices are pretty clear with C++
This is the book by the language creator himself. It is considered the language bible of sorts. It may not be the best book to learn on, but it is a book every C++ programmer should have on their bookshelf.
In that case, you shouldprobably start here.Pick out an application and go with it. Many of the programs on that list have free/demo versions available. Also, the GFSlist of applications usedis mostly full of free applications used to create games.
Let me get the 800lb gorilla out of the way first of all. C++. This is one of the most controversial and repetitious questions of all. New developers hear from other developers that C++ is what the pros use and therefore want to use that. To make matters even worse, people answering the questions are often new developers as well and will recommend what they know thus pushing people to use a language they probably shouldnt. Frankly, if you have only ever used a single language, you really shouldnt be answering these kinds of questions!
No doubt you have seen this title and in your future career as a C++ developer AND a game developer, this sounds about perfect. It isnt, but it is not bad. Lets put this out there right away, this wont teach you how to program games, but what it will do is teach you to program C++. As an introduction to C++ text, its not as good as the previous two books. As a game programming text its all but useless. So why am I recommending it? Its a decent introduction to C++ programming that uses simple games for all of the demonstrations. So, instead of fairly abstract or contrived examples you see in other texts, all the examples are game related. For example, pointers and references are taught by creating a Tic Tac Toe game. Many people will find this a heck of a lot easier to wrap their head around than many examples in other books.
Again, these are just my opinions ( and those of the vast majority of people that went down this road themselves! ) and I know you are going to start with C++ anyways, but dont say I didnt warn you, because you are making a really stupid mistake.
MIT C++ Introductioncourseware. They have other more advanced lessons as well.
to be honest, since , this language effectively died. Using VB6 is frankly just too outdated to bother with these days, which is a bit of a shame, as it filled a very nice niche that hasnt completely been filled. Now, VB.net is basically C with a VBish skin applied. I am sure VB.net developers will disagree, but they are wrong.
Freely available resources for learning the language ( Books and Tutorials )
Java Java is a tricky one to write about, because of my C bias. I used Java before C came around and I could see how it was more productive than C++ and appreciated the encompassing libraries, especially as I was moving over from C++ at a time theStandard Template Librarywas anything but standard that said, since C came along, it feels to me as a superior language in just about every way.
A physics engine for 2D games. Free, powerful and quite a bit easier than working in 3D.
Originally developed by Silicon Graphics in the early 90s, this is the grand daddy of 3D APIs. Its biggest advantage is its cross platform nature, as OpenGL is everywhere. This is especially true on mobile devices like Android and iPhone, which both implement a stripped down version of Open GL called OpenGL ES. You can view thegetting started guide here.If you prefer in book form theOpenGL Programming Guide( Red Book ) has long be viewed as The OpenGL Bible, the one book all OpenGL programmers should own. That said, in recent years OpenGL has changed quite a bit and the old cruft and obsolete instructions havent been pruned out of this book yet. TheNeHe tutorialshave long been the goto resource for new OpenGL developers, although in some ways they suffer the same problem as the Red Book, time waits for no docs!
Dont get me wrong, I totally understand why you want to go with C++, Im just as guilty. Recently I purchased a set of golf clubs and Im a horrifically meh golfer, but I got a set of blades cause thats what the pros use. The gotcha? Im no pro golfer, and my god did these golf clubs totally ruined my golf game. Sometimes using what the pros use isnt the right thing to do. Alright, off that tangent.
Are two freely available physics engines for accurately modeling real world physics in your game. ODE is open sourced as well. There is alsoHavokwhich is included in Unreal (UDK), but its licensing isnt so straight forward.
C++ Without Fear: A Beginners Guide That Makes You Feel Smart (2nd Edition)
The most important take-away from this section is, if you are new to development, put a bit of time into learning programming, then ask this question later!
LUA/Python/Ruby In all honesty, Ive only really dabbled with these 3 languages and while all 3 are ( and commercially have been ) good languages for embedding within a game, only Python really has a really solid game development community built around it, so is probably the best recommendation for new developers. All 3 languages should definitely be on your radar. My experience is very limited in all regards, so I dont really feel comfortable making a suggestion one way or the other. If you are an advocate of any of these languages and want to write a section on them, send it to me for inclusion!
KDevelopa linux based IDE, heavily copied from Visual Studio in style
C -See C++, which is a superset of C. There are reasons to use just C and frankly its a bit easier to come to grips with, but it is like taking a trip back to the stone ages.
Eclipse IDE for C++a cross platform ( Linux, Win, Mac) IDE, mainly for Java, but supports C++
Its cons? Probably the biggest is, its tied to Microsoft and that makes many people uncomfortable. As a result, its best implementation is on MS platforms, although it is available on OS/X, iOS, Android and Linux, you do have to jump through a few more hoops outside of MS-land. Next up, its garbage collected, meaning you dont implicitly allocate memory. Finally, in some regards, it can be slower than C++, although I think this point is way over blown these days.
That said, if you are looking at it as a learning exercise have at it! You will learn a ton of interesting and useful things working on a engine of your own. Generally, if its a learning exercise, it totally makes sense to do things that make no sense!
C full disclosure, all things being equal, this is the language I go to. Generally, this is the non-C++ language most people will recommend and for good reason. C is a modern derivative of C++, in that it was based on C++ ( and not Java as commonly held ).
Boost is the future of C++, 10 of the boost libraries are already part of the C++ standard, with more coming soon. Boost libraries perform dozens of common tasks and make up for a giant flaw in the C++ language ( the standard libraries are crap compared to other languages ). That said, they arent the easiest to learn and even harder to understand. Many Boost programmers are amongst the best in the field, and it shows.There are booksavailable for Boost too, although the website actually has extremely good documentation for the majority of the libraries.
Thisis nota beginner text. This is an old text, outdated even as it doesnt cover the latest C++ standard. Heck, its 6 years old! So why am I recommending it? Simple, every good C++ programmer owns this book. Once you grasp the basics of the language, buy this book and it will make you a much better C++ programmer. Seriously. Hopefully Scott is working on a 4th edition as we speak. On the bright side, its 6 years old so you should be able to find it cheaply. In addition to Stroustrups book, this is the C++ bible.
The pros? EXCELLENT standard libraries. Probably the best on any platform Ive ever used. So things like working over the network, manipulating strings, loading files, etc are by far easier than C++. Oh, and LINQ, generics, anonymous methods and various other new language features are pretty great.
Ogre3D sits in a weird spot. It is not a full game engine, but it is not like OpenGL or DirectX either. In fact OGRE uses both. Ogre is a 3D rendering engine. Written in very clean object oriented C++, Ogre handles a number of tasks that neither DirectX or OpenGL do, like a scene graph ( the data structure your world is stored in ), importers for almost all major 3D modeling applications, landscapes, LOD ( level of detail ) support, etc. If you are using DirectX or OpenGL to create a 3D game, these are all things you would have to write yourself. Ogre is cross platform and has been used to create a number of published games. The have a pretty goodmanual online.There are alsoa beginneranda probook available, neither of which I have read though.
Now once youve got the gist of things and are starting out creating a new game, this is a very valid question. One thing to keep in mind, an engine like UDK or Unity are tens or hundreds of thousands of man hours worth of work do you want to replicate that effort? Generally, especially for a small developer, you are best off to use an engine, doubly so if trying to make a commercial quality product.
C++ this is the language you shouldnt pick, but no doubt will.
Anyways why do I bring this up? Simple, before you can program games, you need to be able to program. I know that sounds horribly obvious but you would be amazed by how often people jump straight in to game programming without learning the basics first. That said, my very first line of code was in the attempt to create a game. I still remember it to this day:
One big advantage to all three of these languages is you can program them interactively, which means type some code and see a result. When you are just trying to figure things out, thats pretty powerful! Later on in this post, I will mostly just cover Python, the most popular of the three, especially in regards to game programming. There is alsoIron Pythonwhich is an implementation of Python on the platform, which means you get all the libraries available to C and VB.net.
The cons? Java just has this way of annoying you, of getting in your way because it thinks it knows better than you. Parts of the language are kludgy, overly verbose and again just annoying. In recent years, it has been evolving much less elegantly than C, so the newer language features seem like half assed poorly implemented ugly step children compared to C ( and in some regards, C++ ). Also, Java is the language of academics and enterprises and it shows so many things are so overwhelmingly OVER engineered as to drive you insane, as I said earlier, there are nine ways of doing everything, but 5 of those ways are outdated, 3 are awful and figuring out what the good choice is, is up to you. Finally game library selection is pretty limited.
Microsofts getting started with C++ pageincludingBeginner How Do I?videos
This one all comes down to the language you pick. Ill break it down by language in just a few minutes.
One really nice thing about working with Microsoft technologies is Microsoft know documentation! The number of tutorials and how to videos they make available is extremely vast. This link alone should have everything you need to know to get up and running. They also have more resources, includingthis introduction videoavailable at theBeginner Developer Learning Center. Once you are ready to move on to XNAgive this tutorial a shot.To be honest, they probably provide everything you need to succeed.
A free book from a professor at the University of Hull about learning to program using C. Its actually pretty good and he updates annually. Very good first step for a C developer that doesnt want to spend money.
Well, thats about it. If you are working on Windows, I see no reason to use anything but Visual C++ personally. A number of tutorials out there will recommend Dev C++ DONT under any circumstances use DevC++, its old, unsupported, buggy and has little to no advantages over the other choices. It was popular at the time because back then, there was no freely available C++ IDE, times have changed.
Assembly If you as a beginner pick assembly in this day and age, you did something wrong, extremely wrong! Choosing assembly as your first language makes C++ look like a wonderful choice! That said, this is about as close to the metal as you can reasonably get. In this age of i7 quad core processors though, getting close to that metal is a pretty stupid thing to do. At some point Assembly may become important to you, but I highly doubt it. Until it does, pretend it doesnt exist.
Rob Miles also made this ebook available for free download as well. It is all about learning how to program by creating games in XNA. Personally I think this is kinda a bad idea, but the price is right! Definitely give it a shot, it is a very thorough text and if i
Now start running throughthe other tutorials.
The pros? The ecosystem is massive, the tools and library support are legion. There are nine ways of doing everything in Java, and the number of free tools ( Eclipse, NetBeans, Ant, etc ) are truly staggering. Language wise, its much like C, libraries are much more capable than C++ and the language is much less likely to bite you in the ass if you make a slight mistake. Also, if you are doing Android development, well until very recently ( with added C++ support ) it was the only game in town.
The Rest- I hope I didnt miss your language of choice, as theres Objective-C, D, F, CAML, Smalltalk, LISP, Perl, PHP, Haskel, Pascal and a few hundred other languages available. Many of them are domain or platform specific languages, or have fairly poor game library support. ObjectiveC is gaining in popularity based on it being the main language of iOS platforms, but outside that world it is virtually unknown and frankly I hate it. I dont recommend against any of these languages, but none are really well suited or very popular for game development.
This one I recommend with a caveat. It is probably the single best conversational introductory C++ texts out there. It is very approachable and the pacing is quite good. Nothing is implemented before its explained which is very nice. That said, some things are wrong or outdated, occasionally teach you The C way of doing stuff instead of the C++ way. Finally, the author recommends DevC++, which is really really really bad. Those flaw aside, if you find all other texts to dry, confusing or technical, you may want to check this one out. Again, no GUI coverage and no Boost, but many of the newer language features are covered, plus it spends a couple chapters at the end implementing more full solutions, which is a good thing.
All this really means is, the very first thing you are going to have to learn is the basics of programming. No worries though, Ill cover that later too.
Now go and downloadSFML ( Visual Studio 2008 )- until 2010 update occurs.
This is the library ( and Fastgraf ) I started out using many many many years ago. It was originally written for the Atari ST and I am simply floored that it is still around and in active development. That said, it was good then and it is good now. Interesting trivia point, the guy behind Allegro way back in the early 90s, went on to become one of the main programmers behind XNA. Anyways, this much like SDL, covers just about everything you would need for 2D game programming. Also like SDL, its very much a C library.
A Beginners C++( 1996, outdated, but free )
Its pros you can get close to the metal, its the pro choice, lots of 3rd party commercial and free libraries and it is well supported across platforms.
Now, if you did in fact make the decision to go ahead with C++, for the love of all that is holy, DO NOT USE DevC++. Its old, unsupported and a vastly inferior choice on every measurable level. Dont worry, Ill cover the options off later.
Introduction to Programming Through Game Development Using Microsoft XNA Game Studio
Run throughthe SFML configuration/starting tutorial.
EDIT:This site now has a completegame from scratch using SFML tutorialavailable. You need to have the basics of C++ down, but it will hopefully teach you quite a bit. It is a good place to go once youve run through a couple C++ tutorials or a few chapters of a book.
With people looking to get into game development the same questions come up over and over, so Ive opted to put my thoughts on the subject in one place and to compile a list of resources for new developers.
Assuming you are a new developer, frankly, this is a premature question. Grasp the basics of programming before you even think about using or worse, creating an engine. Otherwise you are doubling your workload, as you learn both a language AND an engine. As a new learner, you should be minimizing the number of subjects you need to study at once, as you can quickly get overwhelmed if you try to learn everything at once.
Alright, keep in mind this is all entirely my opinion, but as a game developer learning C++ you should:
Go through that book and do some basic exercise, create a few console applications and get a feel for the language.
For those of you that like skipping ahead to the last page in a novel, these links are for you!
Your first game wont be good. Your second game wont be much better. But if you finish a single game, youve done better than 95% of people that came before you. Dont plan an MMO, its way beyond you, even with a team of a few hundred people. Hell, aiming much higher than Pong is setting yourself up for failure. Pick something small and execute. Again, there is a 99.99% chance your game isnt going to be published, so approach it as the learning experience it is.
I will fill this area in over time. Much of the free resources are terrible, or outdated. If you have a good suggestion, email me or comment below and I will add it.
Its cons? Just about everything else. It takes 10x as many lines of code to do simple things, its like juggling live hand grenades safety wise, its compilation process is primitive and unwieldy, its syntax is painful, its learning curve is steep and its standard libraries are awful.
If you are just learning, you probably shouldnt be working in 3D right now, yet here are the primary libraries in use today.
Nothing frustrates new developers more than the lack of progress. This is why small, doable goals are so important. Nothing motivates like success!
XCodeApples IDE, supports C++ but is obviously Mac OS only
The new kid on the block, and frankly, I have zero personal experience with this library. Like the other two, it handles just about everything you would need to implement a 2D game. Unlike the others, this is an object oriented library ( C++ ). A quick look at the classes and it looks like a very modern and clean design. On that level alone, I would probably go this route if I was starting out today. It is event driven, which is a very handy thing ( and something Allegro is moving towards ), which should make your game structure easier to implement.
(*) figuring out WHAT to use, from the hundreds of libraries, deprecated features, tools, etc.. is overwhelming and is probably going to be as big a challenge for a new developer as learning the language itself
Oh, and just to be thorough, there are alsoEmacsandVi(m)which are actually just really powerful text editors that you then call out to the likes ofGccor theMinGWcompiler. I mostly just mention these for completeness; as if I didnt some guy with a beard and plaid shirt would no doubt scold me over the omission. In no way do I recommend a new developer start with any of these items!
So, you are here for game programming advice and all Ive talked about is C++, now I will rectify that. First you need to decide if you are working in 2D or 3D. Just starting out, I highly recommend sticking to 2D for now ( or stick to console apps until you get the gist of the language ), yet once you decide to make the graphical plunge, there are 3 major ( and a few thousand other! ) 2D graphic libraries out there. I know this sounds like a cop-out, but all three are equally good, so you cant really make a mistake here.
Beginning C++Through Game Programming 3rd Edition
Egads, you just wont listen will you all right, we all make this mistake when we start out. If you insist on going the C++ route, learn the language first, using the following recommended tools and libraries.
Should I use an engine, or create my own?
Do something. Really, the most important thing you can do is start writing code, start learning, jump in. All the planning, dreaming and forming of teams is all fun and such, but the most important thing you can do is, um do. Jump in, learn, make mistakes, the experience will be invaluable.
Its beginner friendly, simple ( relatively ), cross platform, well supported and is used to make commercially shipping products ( like the recently release Dungeons of Dredmore ). It handles just about every aspect of creating a 2D game, graphics, sound, loading files, networking you name it. It is very much a C based library. You can use it from C++ without effort, just dont expect any object oriented features.
Go hereto download and install Visual C++ Express.
Now start making more complex games, or using or creating a game engine.
The C section is a lot easier to right than C++, as its a newer language, there are fewer tools and one library dominates the game ecosystem.
SFML – Simple and Fast Media Library
A free e-book, covers the basics of C pretty well. A bit dated but still free. Nicely many of the changes to C over its evolution are complementary to the old ways, so not as many ways of doing things have been deprecated.
EDIT: 8/16/2011To be honest, I have been overly hard on C++. Dont get me wrong, this does not mean that I am endorsing it for new developers, that is still a seriously bad idea! However, with the rise of iPhone ( which is Objective-C based, but supports C++ ) and Android ( which is Java based, but also supports C++ ) as gaming platforms, C++s popularity is on the rise.
Congratulations, if you got to this point, you are now a game programmer!
Take theguided tourthat will introduce you to using the IDE and language.
a surprisingly comprehensive site dedicated to C++. Thetutorials sectionis a good place to start.