adamlee123 at May 30th, 2012 09:33 — #1
Ok, so, I have recently started learning how to program in c++ (have the slightest little bit of knowledge in c# as well) and was just wonder what main topics i would need to learn before I could make my own simple text based RPG.
I have looked on google at different source codes for it but it all confuses me.
If someone could tell me what i would need to know that would be mega helpful
geon at May 30th, 2012 17:55 — #2
If you just want a text based game, don't use C++. It sacrifices flexibillity for speed, which you don't need. It also does not handle strings very well, which is annoying if you are going to process strings a lot.
reedbeta at May 30th, 2012 18:06 — #3
If you just want a text based game, don't use C++.
Agreed. C++ is also not the best language for a beginning programmer. Try Python instead. Here's a free online book to get you started: http://learnpythonthehardway.org/
vilem_otte at May 31st, 2012 03:45 — #4
On the other hand I disagree - I think C++ is as good as any other language for beginners (of course it needs to learn a little harder - but then you'll be grateful for learning the language, that sacrifaces flexibility for speed - meaning as soon as you start creating application that is performance heavy) ... maybe pure C is even better for start (it really contains just very little stuff - and is so damn powerful - especially for Operating systems development ).
For example, I started on standard C - even without objects
And as for strings and C++ ... what about boost? :ph34r:
geon at May 31st, 2012 04:14 — #5
And as for strings and C++ ... what about boost? :ph34r:
Exactly as you wrote; it's for ninjas.
Even just the basic stuff like getting SDL to work with in C++ is a hassle, and close to impossible for a beginner. I recently started a new project in C++ after a few years away from it, and boy, is it anal. You have to manually make sure headers won't redefine classes/functions if included twice, without a standardized naming convention for the macros to handle it. Just getting the code to compile was a minor challenge.
adamlee123 at May 31st, 2012 09:03 — #6
I know how hard c++ is to learn as a complete beginner, I tried a few years back and gave up but this time I want to keep testing my self, set challenges for myself.
thenut at May 31st, 2012 12:33 — #7
Exactly how much do you know? Are we talking about adding integers or are you fluent with class inheritance and polymorphism? I would put game dev on hold until you can comfortably work with a language. You should be comfortable with basic C/C++ such as working with loops, arrays, memory allocation, logical operators, pointers and references, etc. Moving forward you should then (optionally) familiarize yourself with object oriented programming such as working with classes, inheritance, polymorphism, abstraction, interfaces, etc. Write lots of test applications and use the debugger to see how things are constructed and destructed. Once you can talk to the machine, then you can start learning algorithms, libraries, and game development.
If you have some experience in C#, I would recommend sticking with that language for a little bit longer. The .NET BCL (base class library) is superior to anything else and it will help you learn faster. Getting familiar with the BCL will also give you some ideas how to construct your own classes in C/C++ when (if) you transfer over.
alphadog at June 1st, 2012 09:36 — #8
Learn C# or Python. Not only do they have a large community, they are common enough in game dev. (As opposed to, say, Java or Ruby, which are generally equals of the two I mentioned, but are not as omnipresent in game development circles.)
First, learn all the basics (data structures, basic algorithms for sorting/searching/etc, basic IO, etc.) from complete online tutorials or books.
Then, learn how to build a basic game. Learn common game algos (ex: KD-trees) and patterns/architecture (ex: the game loop) while building a basic game.
At that point, you should have enough knowledge to be able to start self-guiding.
adamlee123 at June 6th, 2012 06:35 — #9
im not sure about inheritance or polymorphism yet, but i'm going to have a look at them soon, I have an understanding of for/while/if loops etc. and a slight understanding of arrays. I also understand classes and a little bit about pointers, not alot though, and thats about all i know in c++ at the moment.
What steps would be the most logical to take at the moment to progress more in C++?
thenut at June 6th, 2012 21:29 — #10
At this point I would recommend a good book. Not just to learn the rest of what you're missing, but to learn it properly. The last thing you want is to find some source code online that uses bad programming practices. I can't recommend any books for you because my stuff is from the 90s, which would probably do more harm than good for you Your best bet is to check out some of the books on Amazon.com and see if there's something there that has good reviews and fits your budget.
adamlee123 at June 7th, 2012 05:47 — #11
Thanks, i'm thinking about getting this book. Would this be helpful at all?
thenut at June 7th, 2012 06:54 — #12
The reviews are fairly positive, although the "game programming" part is more on the logic side, not graphical or some such. Still, if I were learning C++ I'd rather be writing text based blackjack games than doing the standard employees and database stuff, which I actually did when I started ;p. I took at look at its table of contents and a sample page, it looks decent. Not sure if anyone here might have more to add with this book.