Home | Rules and Guide | Sign In/Create Account | Write a Post | Reddit | #LD48 | #ludumdare on irc.afternet.org (Info)

Ludum Dare 30 — August 22nd-25th 2014 — Theme: Connected Worlds
  • Judging Ends: in 17 days, 4 hours, 52 minutes, 22 seconds
  • [ Real World Gatherings | Ludum Deals | Warmup Weekend (Games) | MiniLD #53 | Wallpaper (1) (2) (3) | Mailing List ]

    [ Play+Rate | Edit | View All Games | My Game ]


    How should I go about C++?(FROM SCRATCH)

    Posted by (twitter: @YarharALC)
    January 18th, 2014 9:46 pm

    I want to get started with C++ game development. I almost went with the obvious and did thenewboston’s series, but he doesn’t even leave the command prompt. What is the best way for me (having slight Java experience and nothing else) to get the ball rolling?

    P.S. The reason I am pushing learning this instant is that I am thirteen, and want to learn while my brain is still malleable.

    26 Responses to “How should I go about C++?(FROM SCRATCH)”

    1. sam1373 says:

      Well, first you should learn the basics, then learn a graphic library. After that you can do whatever you want. Don’t try to skip things, in the long run you will just waste 10 times more time in the future because of not fully understanding how stuff works.

    2. Daid says:

      I would recommend not starting with C++ straight away, there are 10.000 things that could wrong.

      But if you want, you might want to check out SFML. It helps in getting GFX and Audio up and running. C++ without any extra libraries is a no-no. You do not want to start from scratch.

      I would recommend starting out with some Unreal modding. The Unreal engine is pretty easy to mod for, you get lots of powerful tools, and a scripting language which is close to C++ but much safer as it won’t crash. It will also teach you a lot about how you can do OO in games.

    3. boringprogrammer says:

      Your brain only get more and more mallable till about 30. That is my experience anyway, so don’t worry, you will learn everything you want to know in time. Even if you wait a bit.

      Either way, start with JavaScript. It will help you way more in the long run.

      (This is coming from someone who was a hardcore c++/c programmer no less than two years ago)

    4. Jexel says:

      I started off learning c++ using http://www.learncpp.com/, then decided to go with SDL 2 before learning opengl. Here are some good SDl 2 resources that I found:
      - http://lazyfoo.net/tutorials/SDL/index.php
      - http://twinklebear.github.io/pages/sdl2/
      - http://www.sdltutorials.com/ (I’m not sure if this is for sdl or sdl 2.)

      • YarharALC says:

        Thank’s for all the resources. After reading DamnPete’s posts, I might not learn C++, but I am definitely going to look at the links.

        • Jexel says:

          You’re welcome. Even if you don’t end up using c++, I personally think it’s still useful to know some basics of a language slightly more low level.

          • YarharALC says:

            I have my mind set on C++. Period. Not gonna let myself change my mind. I did some hunting for resources and my free web sites matched yours! Good to go! Going to learn C++ with learncpp.com, then (hopefully in just a few months, but most likely not) learn the SDL library with LazyFoo’s site. Thanks for the help.

    5. DamnPete says:

      I honestly wouldn’t recommend C++ right now for you, because it allows you to do too much and in so many wrong ways. If you create a vice right now of doing things in the wrong manner, once you’re confronted to do it the right way it’ll be much harder for you to adapt.

      • DamnPete says:

        PS.: I’m sorry I probably didn’t answer your true question. If you’re still 100% decided you’re going to do it in C++, I don’t know which is the best place to start. I’d download some code snippets and study them. I like using QT for graphic windows and Boost give you lots of well implemented stuff that you’d normally wish C++ natively provided.

        I do recommend studying some OpenGL even if you go for some higher level graphics engine like Ogre3D.

        • YarharALC says:

          I’ve considered Java, and heard it’s the best to start with. How well would Java experience transfer to other languages? Web design is not much of a priority for me, as even if I did understand HTML and so forth, I would not be able to design a good-looking site.

          • Spiridios says:

            Fundamentally, the low level concepts of any language pretty well transfer to others as logic and control flow are mostly the same in any language. At a higher level, Java transfers quite well to C#, and decently to C++ and other object oriented languages. It’s a pretty decent language to get started in, probably better than BASIC, which is what I started in.

            BTW, Java is no more a web design language than C++ is. Javascript is the client side language.

            • YarharALC says:

              Thanks for the reply, my mind is now switched to Java (for now).

              PS. I mentioned web design because there is no reason for me to start with Javascript, HTML, CSS, etc. Not because I didn’t know Java and Javascript apart.

          • DamnPete says:

            Don’t let the name mislead you. Java and JavaScript aren’t equal, nor does Java have direct correlation with web. It is true you can program for web with Java (JSP), but there are so many more things Java is used for.

            Experience gained with Java will serve you well for any other language, furthermore, Java’s syntax is extremely similar to C, which you can extrapolate to C++ and C#. What is good about starting with Java is that it doesn’t allow some bad practices. I personally dislike Java, but I would recommend it as very good language to start with.

            • YarharALC says:

              I’m sorry. I had a horrible transition. I mentioned Java as I am going with that, and web design because I don’t have any intent to learn it. I am a huge geek, so I know the two’s similarities and differences (I think) pretty well.

              I am definitely going with Java now, and thank you for reassuring me.

    6. Trilby says:

      I wouldn’t worry about your brain becoming less malleable as you get older. Some people learn better than their younger selves because they have become more disciplined.

    7. Jedi says:

      I disagree with some of these comments and the attitude expressed. First of all, there’s nothing wrong with learning C++ as your first language, especially if you know making games is what you want to do. I did it that way and I’m certainly no worse for wear.

      Now, having said that, C++ is not as forgiving as other languages when it comes to things like syntax, but Java is not really a lot better in that regard. But there’s nothing wrong with learning Java at first either! (And I don’t think finding the “easiest” language is automatically a worthwhile endeavor, because the easiest languages to program in are probably not the easiest to make graphical games in)

      Starting out, you will get a lot of errors that you don’t understand at first and it will be frustrating. That will happen no matter what framework or language you use; that’s programming. Google everything you don’t understand (luckily for you everyone else will have seen these same errors before) and do get frustrated but don’t give up.

      Lots of people talk about “Learning” a language but it’s kind of silly. Computer languages change all the time, new ones come out all the time. I’ve heard it said that when you consider all the standard libraries, C++ is so big, no one person actually “knows” all of it. I don’t know if that’s true or not but I won’t argue it.

      If your mindset is, I need to learn language X, then graphics API Y then framework Z and then I can make games, you will be stuck in an endless cycle of learning that never has you making games.

      You can make a text-based game using the barest-minimum of console programming knowledge, and if you do, will RETAIN that knowledge. Then you can go back and learn a little more, and make something a little better. Rinse, repeat. Every new thing you learn, ask yourself, “How does this help me make games?” and if you can’t come up with an answer (and I know some people are really going to disagree with me here) don’t bother learning it.

      You can always go back and fill in gaps you have in knowledge, and doing that is what making games and programming in general is all about! Yes, you will have times when the gaps in your knowledge hurt you, and in that situation it may be tempting to say, “Gee, if only I learned how EVERYTHING worked first, I wouldn’t have had this happen.” However, you will have taken the wrong lesson from that experience.

      Again, if you are making something within your abilities but there is some aspect that requires just a BIT more knowledge, I guarantee that if you don’t give up you will learn what you need to eventually to get the thing made. If you set out to learn everything, I can’t guarantee you will ever make anything.

      I also agree that you don’t need to worry about brain malleability a bit. Years of practice with learning and implementing new technologies have made me MUCH faster at doing so.

      Hope that helps :)

      • Jedi says:

        Hmm I think I was responding more to the comments than your actual post. Ooops :P

        To actually answer your question, you can’t go wrong with SDL.

        Whatever you use, start by making a window and getting a colored rectangle drawn on the screen. Then move the rectangle with the arrow keys. You should be able to find a tutorial for each part of that, and once you do that much you will be unstoppable ;)

        • YarharALC says:

          Thanks for having a unique opinion. The reason I have the desire to make games is that I am a huge writer. For example, I was attracted to videos for a good two years, then grew out. I love CREATIVE writing, and games seem to be the best medium for me. I don’t truly care about which language I use, I just want to have the ability to spread my “creations” to a large audience, and that’s what C++ allows me to do. Many APIs only support C, C#, and/or C++. Thanks for the long-written responses.

          • Daid says:

            Then Java is really a much better choice then C++.

            Just to highlight the difference. In C++ your application says “oops something went wrong, no idea where”. In Java you get “You did this wong, here and there, which is why I crash.”

            Python with PyGame might also be an option for you then. There is quite some help for python around.

    8. kikiwunder says:

      I wanted to chime in because your situation mirrors mine from twenty years ago. :)

      I didn’t start with C; I jumped right into C++. I had no idea what I was doing, or what classes are, or proper programming practices. But I did have this:

      http://www.fastgraph.com/makegames/sidescroller/

      This book taught me C++. It’s not a book intended to teach C++, but a book for making a platformer game and the associated tools to go with it, like level and sprite editors. It’s very dated. However, it gave me a target to hit and every chapter gave me goals, things to accomplish.

      The trick is to never learn what you’re doing in a vacuum. I disagree wholeheartedly with people who try to teach command-line-only programming first; most people I know who’ve had a hard time learning programming have been visual learners, and would have benefited from examples that showed them visual differences in outputs.

      So, I recommend doing *up-to-date* tutorials that use a graphics library to build small games, one-screen games, and go from there. Start with Pong, then perhaps Sokoban with no animation, just tile jumps. Learn how the keyboard and mouse inputs work, and how to read them properly. Learn how to make an array, to store data for levels. Think about the simplest games you can clone and give a go of cloning them.

      Also, while SDL is a great library it’s a bit harder than Allegro, which I recommend for beginners. The recent switch from SDL1 to SDL2 also means that a lot of the tutorials you’re going to find online will be out of date and you don’t want to be fighting with the library while learning the language.

      And most importantly, finish what you start. Even if it’s crap, you’ll learn from it and the next thing you make will be less crap. Once you get a handle on the basics, start making a quick test game a month, and completing it before moving on to new ideas.

    9. MrPhil says:

      I’d get a book that walks you through making a game with C++. I’d suggest “Programming 2D Games” by Charles Kelly. It is highly rated on Amazon. If you are price sensitive there is “Advanced 2D Game Development” by Jonathan S. Harbour, not a highly rated but about 1/2 the price and covers very similar ground. I have both books and I think they’d do the job.

    10. 4ntoine says:

      I’d recommend CppDroid – new C/C++ IDE on Android. It has a lot of included C/C++ examples and tutorials. Blog: http://cppdroid.blogspot.com, Google Play: https://play.google.com/store/apps/details?id=name.antonsmirnov.android.cppdroid

    11. Hot yoga says:

      Hot yoga

      How should I go about C++?(FROM SCRATCH) | Ludum Dare

    Leave a Reply

    You must be logged in to post a comment.


    All posts, images, and comments are owned by their creators.

    [cache: storing page]