I am a beginner to c++ Could someone point me in the right direction?

Started by
6 comments, last by jolteon 11 years, 1 month ago

I am wanting to learn c++ and make a game like CoD or Halo. It sounds sort of cheesy trying to make a game like that, but I just want to try it. I want to try Game Development versus Web Development for my job. But, I need to be pointed in the right direction. First, Would this be impossible for a 12 year old to learn? Second, How I understand it, there are different types of C++ (like openGL). What kind should I use? Third, Would I need a program to make the graphics? I have Blender on my desktop (I made random shapes with it, I am not exactly too far down the road)? Forth, should I learn any languages before even messing with C++? Ive tinkered around with a few but stopped. The only game programing language I have attempted (and failed) was Java. I tried to make a Minecraft plugin, but quit.

Thank you,

Cameron

Advertisement

C++ is definitely not impossible to learn as a 12-year-old, that's actually when I started trying to work with it after some time with CoolBasic. It'll probably take some time getting used to and actually producing something, even a very simple game (compared to your examples).

OpenGL is not a "type of C++", it's a library for GPU-based rendering (and, as of some of the 4.X versions, general computing). It's not even restricted to C++, you can use it with C or Java or Python or very many languages. But the actual choice you probably mean is your API/engine.

This is where people differ a bit - some people are in it to make a product relatively quickly, in which case they usually choose an engine (like UDK, Cryengine or Unity) where lots of the tinkering and details are already done for you - loading an animated and textured mesh becomes a couple of calls instead of a few nights of coding that stuff yourself. Some people, however, want to write their own graphics system from ground up, and in that case they choose pretty much between OpenGL or DirectX.

I won't go too far into that debate, they're both good APIs with some pretty minor differences - DX is maybe a bit more streamlined and straight-forward to develop for and OpenGL is a cross-platform standard, but not as modernly designed and tends to actually follow up some of the thing DX does nowadays. But the main point is, both of them require you to write lots of code just to display a triangle. Or text. Or anything - though the point is, if you do this, you can do anything the GPU can - you won't be restricted at all by the design choices of a third party engine. You pretty much want to go with an engine anyways, since it's tremendously more likely to actually finish something that way - and they can do pretty amazing things.

I don't know much about 3D modeling programs, but it would seem that no matter which of the popular ones you pick, just keep at it and you can produce very cool meshes. If Blender slows you down or is an awesome program, I don't know - I've seen lots of arguments about it, but there seems to be a clear consensus.

If you want to learn C++, I'd say go with C++. Learning Python or something is not a bad idea - C++ isn't exactly the most rapid prototyping language, but it can still do everything and then you won't have to do a full rewrite after testing the idea out. Though I don't think I can emphasize enough that you should first learn "normal" C++ rather well - what pointers are, how they work and how you use them and dynamic memory together. How and why you use classes and for what entities do you want to make one. It's important to know your language before digging into the jungle of all sorts of libraries available.

@Camakeson I don't think it's impossible to learn at 12. If you really want to do this, then don't stop looking things up and just keep at learning regardless of how hard it seems to be. A decade ago it was relatively harder to get what you need than now as most software needed for the whole works that is freeware now used to be commercial only back then. Not to mention there's more sites like this dedicated to helping others learn than then as well. Trust me, I know. It was hard for me to find much back in '04. Best resources I had then were books which hardly explained stuff or did but in technical terms I never understood then. Take heed to anything Powly here has to say. I joined just the other day because I'm officially starting to delve into the world of programming and he has helped me out with some questions I have been saving for later when I get closer to my own personal project, but I dabbled with Blender back in '04 and even then it was an impressive piece of software. I'm not much of an artist myself, but if you know the 3d models for the Ace combat series I was able to create a simple gas tank (In a refinery, the big round holding tanks) from Ace Combat 4. Simple, I know, but quite impressive for the time as it was a more modern render at the time and I managed to get it done and my artistic skills are as extensive as stick people.

@powly k Blender depends on your system. My netbook that I'm on now (Which it what I'm using to practice my coding via visual C++ express 2010) can't even run Blender. A desktop we have (after fixing it back up due to a bad virus hit) will be able to run it no problem.

What do you mean, failed at trying Java?
If you didn't learn the basics of programming, and / by using that language, trying to make a minecraft plugin as one of the first things you do might be a bit tough.
Get a book explicitly teaching programming basics (one that has mostly very good ratings, in great numbers of reviewers e.g. more than 3 ;-) ), using one language as example - e.g. Java.
(didn't Bruce Eckel make a "thinking in Java" also? IIRC those books were nice, and available freely as a download, although a paper book might be nice).
If you are through with the book (some weeks? really understanding and trying everything), just start to make some not too complicated programs of different kinds that com to your mind, maybe even little games like tic tac toe, pacman, whatever.

Perhaps after that you'll be ready to tackle that Minecraft plugin thing again (I have not looked at that at all, just guessing)

But please, don't try to learn C++ as your first language. I strongly advise against it. It just has too many things which disctract you from learning *programming* and actually making some cool things on the way, instead of wrapping your head around the many peculiarities of a language. Granted, Java has some, as other languages have, but C++ has lots, and some mean ones ;-) Trust me on that.
And "failing" at Java indicates that you're not ready for C++. If you think you "failed" Java already, your frustration tolerance is probably not nearly high enough to tackle C++ ;-)
Btw., Java is taught at many universities as a first language in computer science, so I guess they think too, it's a good one to start with.

Don't give up so fast with one language, learning how to program takes *time*, you didn't learn how to ride the bike or to swim in a day, did you?

As for graphics, I personally never liked blender for the user interface, but I know people who love it and are very productive with it. Gimp is a popular 2D graphics choice within the free tools. There's at least one other notable free 3D package besides blender, it just doesn't come to mind right now...

Besides, do you know for sure that programming is what you'd like to do most? "making a game" is one thing. Which part of it another, the sort of big games you mentioned are hardly possible to be done by just one person. More like a dozen, working full time, for years.
It's probably a good idea if you try out the different sides of game development, e.g. programming, graphics / level design, game design. Really try out, not just for 1 hour and then decide "nah, too complicated" ;-)
I say this because many people would like to turn their ideas into games... but it just may be that programming (or any of the things) is not what you'd enjoy most, after all.

So try out different things, and at some point, pick one main thing (programming, or 3d modelling/animation, or level designing, or...) that you'll spend most of your learning efforts on - which you will be getting really good at.

Because, at some point, you most probably need to give up the idea of making a bigger game all by yourself. You'll need to find / start a team of developers to collaborate on a game, and before you can do that, you need to have found out what you're best at, and gotten quite goot at it, to know your role in such a team.
In these forums here, there are likeminded people, so even if you don't have probable collaborateurs where you live, you might find them here, don't worry ;-)

Ok thank you. When I put "failed at java", I didn't mean I lacked the patients or the skills, I know a few web development codes, the setback was because the bukkit API I imported was messed up or something, because I didn't get all the events I should have received.

Alright, I'm going to give you some advice I wish I had gotten when I was your age.

Just make something.

There are really two paths you can go down. One path is straight into 3D as you said you wanted to do. This is an awful idea. You're twelve, so that puts you in 7th grade I believe. This means that you probably have a decent understanding of basic algebra (which will also help you understand programming better, yes math is useful). Let me ask you this:

If you wanted to be an astronaut and plan a mission to Mars some day, would you jump into all the complex physics, calculus, etc. required to calculate the trip today? Or would you not continue with your current math education and study throughout highschool, college, and perhaps graduate school and beyond before attempting to make the trip?

I ask this because right now you are the twelve-year-old astronaut who wants to make it to Mars all by himself. I want you to know that at one point this was me too.

I got into programming at around the same age as you and I can honestly say that since then I have learned a lot about game development and programming, but have hardly anything to show for it. If you were to ask me right now to show you a game I have made in the past 8 years, I really couldn't show you more than a few crappy text-based games, and some 2D prototypes that could hardly be called games. This is because I never finished things. I only dreamed about what I could make if I knew this or that.

So what do I recommend you do? Well for one forget C++. It seams that you don't have much programming experience, so you need to actually get some experience instead of wasting time with all the complex bits of an ancient and often cryptic language like C++. If you want to make a game within a reasonable amount of time learn one of the following:

Really I think you could go either way, but both are great choices, and they make it about as easy as it can possibly be to learn programming and make small games fast. Also, the general techniques of game development you'll learn will help you no matter what platform you work on. The structure of a game written in C++ is generally the same one one written in Python, JavaScript or any other language.

Also very important:

Make reachable goals for yourself!

I really can't stress this enough. When you first dig into Python or JavaScript, do not go in hoping to make the next CoD or Halo (hundreds of experts worked on those games)! My recommended learning progression would go something like this:

  1. Learn how to write your first "Hello World!" program. (Just putting out text on the screen)
  2. Learn programming basics like variables, if statements and while loops, etc. (Very important, make little demos to test your skill)
  3. Learn how to store more complex data in things like arrays. (Also critical, keep testing your skills with little programs you make up)
  4. Learn about functions, objects and any other things you might see in your basic tutorial series. (Keep up the little programs!)
  5. Make a small text-adventure game, like one of those "choose your own adventure" books.
  6. Make another small (more complex) text-based game. (Maybe this one has combat?)
  7. Finish these games. (It's harder than it sounds, especially if you don't keep things small)
  8. Now read some tutorials about Pygame or Crafty or another game library that you want to use.
  9. Learn how to put a picture (like a spaceship) on the screen.
  10. Figure out how to move it with the arrow keys.
  11. Learn how to implement "collision detection", something that stops objects from going through each other like ghosts.
  12. Make the little image you control shoot something.
  13. Make something that blows up when you shoot it.
  14. Keep learning, setting little goals like this for yourself until you've made Asteroids! (Or some other simple game)
  15. Now make another, but slightly more complex game. (Mario clone?)
  16. Finish these games. (Seriously, it's a skill)
  17. Keep making games, and some day you will get into 3D when you feel ready!

You don't need to do this all in a day, it will take a lot of practice (just like anything else) to really understand how things work. The key thing here is that you'll be making games! By the time you do get to 3D programming (if you're even interested in it by then), you'll have a whole bunch of awesome games to show off to people (it might even help you get a job)! Just keep trucking along, setting small goals that you can accomplish and feel good about.

If you take at least a bit of this to heart I guarantee you'll have 10x as much to show off when you're my age, and you'll have learned a lot more too.

Best of wishes!

Making a game like CoD or Halo is a bit far fetched for someone who is still learning the ropes of programming, mathematics, etc. For instance, graphics programming uses a lot of trig and other types of dark magic.

I'd say start with 2D games after getting down on programming itself, and build your knowledge from there. I learned to program when I was 10 years old ( in C none-the-less because I did not have an internet connection and the only programming book I could find was for C ), though I have come a long way since then. Unless you are a gifted child ( I'm talking Harvard University graduate at 17 ), CoD is a while away for you, but do not feel discouraged! There are many interesting things to learn along the way, and hopefully by the time you start doing trig in high school, you will have enough experience and know-how to fulfill your dream.

Regards,
Daniel Kruyt

Making a game like CoD or Halo is a bit far fetched for someone who is still learning the ropes of programming, mathematics, etc. For instance, graphics programming uses a lot of trig and other types of dark magic.

I'd say start with 2D games after getting down on programming itself, and build your knowledge from there. I learned to program when I was 10 years old ( in C none-the-less because I did not have an internet connection and the only programming book I could find was for C ), though I have come a long way since then. Unless you are a gifted child ( I'm talking Harvard University graduate at 17 ), CoD is a while away for you, but do not feel discouraged! There are many interesting things to learn along the way, and hopefully by the time you start doing trig in high school, you will have enough experience and know-how to fulfill your dream.

Regards,
Daniel Kruyt

i agree

just make realistic expectations of yourself. that way you can meet your goal and feel good about it too!

This topic is closed to new replies.

Advertisement