CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Join Date
    Jul 2010
    Posts
    10

    Learning to use Microsoft Visual C++

    Hello, I'm new to coding, but I really want to start learning so I can program basic games. Can anyone recommend a book or set of projects for somebody very new to using Microsoft Visual C++ 2008 Express Edition? I know there are a lot of books that come with a compiler, but I'm thinking the code they give might work or compile differently (I've never liked CodeBlocks anyway, and it doesn't like my computer :P ). I've also been told it is better to use a mainstream program as you can get boilerplate code and game engines specificity made for it. Is this true?

    I would really like to do small projects rather than read through huge chunks of dry text - I've tried that and I swear they write it in the most obtuse way possible. Just reading about something doesn't help me, I have to be doing the things they are telling me about as they are telling me. :P

    Can anyone help me get started with a really simple game-making tutorial that takes you through every step (DIY noughts and crosses or something)?

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Learning to use Microsoft Visual C++

    I'm new to coding
    Can anyone help me get started with a really simple game-making tutorial ...
    If I got a euro for every time somebody asked this I could buy a new car.

    Writing a game is not easy, even writing a really simple graphical game takes effort. It's nice to read that you are are new and want to learn something, but for writing a game, you first need to learn the basics of programming, and because you didn't give any background I assume that you're 'totally' new to programming.

    I would really like to do small projects
    Good... Did you manage to create a window that says 'hello, world' ? If not, start there. I'm not trying to make fun of you or something, but before you start to write software that actually is useful, you first need to write useless stuff just to figure out how to write software . So my adive is, find a good book that covers the basics, write a lot of useless stuff to train yourself and learn, and after you're done with that, start thinking about writing a very simple game.

  3. #3
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Learning to use Microsoft Visual C++

    If you're into making games I think XNA is a good starting point. I've never used it myself but have seen some quite good games using it. For using XNA you need C# express but I guess that's not a problem since you've started your programming career.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  4. #4
    Join Date
    Jul 2010
    Posts
    10

    Wink Re: Learning to use Microsoft Visual C++

    Good... Did you manage to create a window that says 'hello, world' ? If not, start there. I'm not trying to make fun of you or something, but before you start to write software that actually is useful, you first need to write useless stuff just to figure out how to write software . So my adive is, find a good book that covers the basics, write a lot of useless stuff to train yourself and learn, and after you're done with that, start thinking about writing a very simple game.
    I have done that! (The books have been fairly useless so far....)

    The reason I want one that does games (coin flip would be a good place to start - GetRND?) is because they seem to be the only ones worth having. I've tried two 'traditional' ones so far and the only thing I came out of that with is the feeling I could teach them more about clear writing than they could teach me about programming. :P The Dummies Guide to C++ was particularly bad.

    I really just want a guide that is mostly practical in nature!
    Last edited by Ion Zone; July 13th, 2010 at 05:53 PM.

  5. #5
    Join Date
    Jul 2010
    Posts
    10

    Re: Learning to use Microsoft Visual C++

    Sorry, that sounded flippant. :P I'm just really frustrated. I have my C++ editor ready to go and nothing to do with it.
    Last edited by Ion Zone; July 13th, 2010 at 05:50 PM.

  6. #6
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: Learning to use Microsoft Visual C++

    Quote Originally Posted by Ion Zone View Post
    I have done that! (The books were useless!)
    You still didn't say what is your programming experience at this point?

    If you're just the beginner and don't want to deal with boring C++ and instead want to go straight into making games then I would reconsider your approach. There's no book in the world that can teach you a programming language while at the same time use one of the most complex development fields, i.e. game programming. Believe me if someone showed you a book with the nitty gritty on game development you'd be swamped by DirectX/OpenGL references, vertices, polygons, sprites, etc. So listen to what people tell you here and learn the basics first. But, as I often tell people that rush straight into game development and don't want to learn a language like C++, you'll play around with the concept but in the end end up simply playing those games. So think about that...


    PS. The first Google search on "c++ for game developers" yielded this book. I'm not endorsing it though, it's just something you may want to look into. What amazes me is the difference between that book and a regular book for C++ beginners -- the author names all the classes and class variables with names relevant to the game design characters, i.e. class Enemies{}. That's a funny approach. But he might make some money with it

  7. #7
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Learning to use Microsoft Visual C++

    Quote Originally Posted by Ion Zone View Post
    I have done that! (The books have been fairly useless so far....)

    The reason I want one that does games (coin flip would be a good place to start - GetRND?) is because they seem to be the only ones worth having.
    Learning C++ means you know how to use the language properly, know when to make the correct decisions to use a certain programming concept, etc. In a game, business program, or any non-trivial program, you need to decide what structures, paradigms, design patterns, etc. to use. That is what those "boring" books are trying to teach you.

    Do you use a linked list, a deque, or a vector? Do you use templates or just dynamic binding? I could go on and on with the decisions that C++ programmers, regardless of what field they're in, have to make when they are writing a program.

    If you want an example, there are many posters that ask questions here, and they are writing somewhat complex MFC program. The problem is that these posters used wizards to generate the code, and have very little knowledge of real C++ to take them any further. So what winds up happening is that they're asking chapter 1 or chapter 2 C++ questions, while trying to write a complex GUI-based program. That is a recipe for disaster.

    If you get a book on game design and C++, and it isn't for beginners, you will see the same constructs that the "boring" books were trying to teach you -- the problem now is that those non-beginner books assume you know the language already, and not just a cursory knowledge of the C++ language, but a very broad one. You will then be thumbing through the "boring" books to figure out what the heck that function or construct in the game programming book means.

    Regards,

    Paul McKenzie

  8. #8
    Join Date
    Jul 2010
    Posts
    10

    Re: Learning to use Microsoft Visual C++

    If you're just the beginner and don't want to deal with boring C++
    I've coded a Fahrenheit to Celsius converter in C++, and before that I coded my own sites in in boring HTML and CSS with a view to learning boring php.

    That is what those "boring" books are trying to teach you.
    I didn't say the books were boring, I said that the ones I had read were written very, very, badly and didn't include basic information. All I really want to know is if there are any with a more practical, preferably games-based, approach. I know of at least one book that does, but it has its own compiler. It has a CD full of graphics sprites and it tells you how to make a game with them. It probably starts off with, for example, coin flip, which is really just an integer that can be either 1 or 2. You call random to set it and then print the result to the screen as "Heads" or "Tails". That leads on and on until, in the final project you are building a fully playable game.

    I don't see what the problem is. At the very least a guide can be entirely practical. A guide to anything is useless if it isn't practical. What's the point? Will I remember three chapters of (badly-explained, if experience is anything to go by) facts? Will I remember all the variable types if you put them in a grid? No I won't. If you get me to use them, yes I will, I'll remember them the next time I need them.
    Last edited by Ion Zone; July 14th, 2010 at 05:38 PM.

  9. #9
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: Learning to use Microsoft Visual C++

    Quote Originally Posted by Ion Zone View Post
    For example, coin flip is just an integer that can be either 1 or 2.
    You see you already don't sound like you know much about programming. Most of the guys on this forum would say that a coin flip would be either 0 or 1, which by the way is the basics of the binary system that will be an integral part of those C++ books for beginners.

    But I see your point, you don't like the dryness of the C++ language and you want to go straight to making games. Well, one way would be to download a simple C++ game with the source code (I'm sure you can use Google for it) and see if you can understand the concept. If you do, then you're one step closer to making your own game and you just skipped through the boring part of learning C++ basics.

    As books go, I do not think that anyone can point to a perfect for everyone book and the only way for you to find out if the book is good is to buy it and read it. So why don't you start from the link I posted above and give it a try? Or browse Amazon.com for more books on the subject. They all have customer reviews by the way, so you can see if a book was well accepted by the readers.

  10. #10
    Join Date
    Jul 2005
    Location
    Netherlands
    Posts
    2,042

    Re: Learning to use Microsoft Visual C++

    Quote Originally Posted by Ion Zone View Post
    The Dummies Guide to C++ was particularly bad.
    A quick google search only turns up your own post.
    I really just want a guide that is mostly practical in nature!
    Have a look at Accelerated C++ by Koenig and Moo.
    Quote Originally Posted by Ion Zone View Post
    I didn't say the books were boring, I said that the ones I had read were written very, very, badly and didn't include basic information. All I really want to know is if there are any with a more practical, preferably games-based, approach.
    So do you want a practical book or one that deals with all the basics? IMO they don't mix, at least not in the same book. If you want a book that covers the basics, have a look at C++ Primer Plus or The C++ Programming Language.
    Will I remember three chapters of (badly-explained, if experience is anything to go by) facts? Will I remember all the variable types if you put them in a grid? No I won't. If you get me to use them, yes I will, I'll remember them the next time I need them.
    So what's stopping you from practicing? It's really not that difficult to write some games once you know the fundamental stuff. All you need is a bit of creativity. I've made lots of really simple console games even before I learned about classes. No book or teacher had to tell me what to do, I just did whatever I could think of.
    Cheers, D Drmmr

    Please put [code][/code] tags around your code to preserve indentation and make it more readable.

    As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

  11. #11
    Join Date
    Jul 2010
    Posts
    10

    Re: Learning to use Microsoft Visual C++

    Most of the guys on this forum would say that a coin flip would be either 0 or 1, which by the way is the basics of the binary system that will be an integral part of those C++ books for beginners.
    Most guys on this forum know how to code. I don't. If you can learn from a book that has fewer examples than chapters, great. I can't do that. I need to be shown how to do things.

    A quick google search only turns up your own post.
    Its this one. Don't bother though, it's pretty crap.

    Have a look at Accelerated C++ by Koenig and Moo.
    Thanks, that's all I really wanted! Looks really good.

    So do you want a practical book or one that deals with all the basics? IMO they don't mix, at least not in the same book.
    They do mix! You can learn more from one good demonstration than fifty pages of dry meandering. (Wait, are you saying the book you recommended isn't practical?)

    So what's stopping you from practising?
    I haven't got anything to practice with. I don't know enough about C++ to do that.

    and you just skipped through the boring part of learning C++ basics
    I never said it was boring. I like coding. (I made it through David\Leigh Eddings book once, so I have a high threshold.) But anyway, that method won't work, there's no real Zen moment when you are staring at half a mile of brackets.
    Last edited by Ion Zone; July 15th, 2010 at 09:07 AM.

  12. #12
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Learning to use Microsoft Visual C++

    If you want to make a game, have little programmign experience, and want to do somethign useful, then you can already to some ground work.

    While actual graphical games take a lot of effort and a lot of know how (and a lot of groundwork, especially if it's 3D based), you can already progress toward your game without doing anything user interface wise.

    Which type of game are you planning. Have you thought about your game concept, which objects will you have in your game. If it's a first person shooter type thing, you would have a 'player' class, which has location, direction, type of weapon, health, inventory etc. You would also have stuff that needs to be killed.

    Thinking about that, and translating this into classes can be done already without doing anything UI related.

    If you have more simple games in mind, like a game of poker, or blackjack. then you would have cards of varying suits and values. you maybe have multiple decks you need to shuffle the deck, deal hands etc...

    If you have a game that involves playing against the computer, then you can think about the method that the computer would 'think'... The artificial intelligence... for some games this can be a really simple set of rules, for some games it can involve complex/elaborate strategies...

    You don't even have to write a single letter of actual code. just look at your intended game from a distance and think about how you would split up the entirety of the game into a collection of simple and fundamental problems, then handle each subproblem at a time. The typical flaw with any kind of programming of a program of more than a few hundred lines is trying to do everything at once, rather than looking at the whole as a collection of smaller problems. and tackling each smaller issue at a time.

  13. #13
    Join Date
    Jul 2010
    Posts
    10

    Re: Learning to use Microsoft Visual C++

    Thanks for the advice. Maybe a multi-choice text-based adventure would be a good start. Type '1' to hit the rat with the stick. Type '2' to run away. Then later on, I could give it a proper background and maybe add a couple of pictures and a health bar.

    What do you think?
    Last edited by Ion Zone; July 15th, 2010 at 03:20 PM.

  14. #14
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: Learning to use Microsoft Visual C++

    Quote Originally Posted by Ion Zone View Post
    Thanks for the advice. Maybe a multi-choice text-based adventure would be a good start. Type '1' to hit the rat with the stick. Type '2' to flee like a little girl. Then later on, I could give it a proper background and maybe add a couple of pictures and a health bar.

    What do you think?
    Good idea. So maybe in a year or two it will grow into a Fallout series

    Start small and grow as you go. That's the only way to do it. And you can ask people on this forum for a specific advice with C++ code if you get stumped.

  15. #15
    Join Date
    Jul 2010
    Posts
    10

    Re: Learning to use Microsoft Visual C++

    By the way, just curious, but is it very difficult to have a program set up so that you have a 2D game reading map, monster, save, item information, etc, from external files? (I'm just thinking it would be an awful lot easier to make, say, a top-down RPG, if you had a separate editor program.)

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured