A few pointers please :)

36fa0a30f3c8a30b4cb19fe64e87b683
0
adamlee123 101 May 30, 2012 at 13:33

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 :)

Thanks :)

11 Replies

Please log in or register to post a reply.

820ce9018b365a6aeba6e23847f17eda
0
geon 101 May 30, 2012 at 21:55

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.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 May 30, 2012 at 22:06

@geon

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/

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 May 31, 2012 at 07:45

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 :D ).

For example, I started on standard C - even without objects :)

And as for strings and C++ … what about boost? :ph34r:

820ce9018b365a6aeba6e23847f17eda
0
geon 101 May 31, 2012 at 08:14

@Vilem Otte

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.

36fa0a30f3c8a30b4cb19fe64e87b683
0
adamlee123 101 May 31, 2012 at 13:03

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.

6837d514b487de395be51432d9cdd078
0
TheNut 179 May 31, 2012 at 16:33

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.

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Jun 01, 2012 at 13:36

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.

36fa0a30f3c8a30b4cb19fe64e87b683
0
adamlee123 101 Jun 06, 2012 at 10:35

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++?

6837d514b487de395be51432d9cdd078
0
TheNut 179 Jun 07, 2012 at 01:29

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 :D 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.

36fa0a30f3c8a30b4cb19fe64e87b683
0
adamlee123 101 Jun 07, 2012 at 09:47

Thanks, i’m thinking about getting this book. Would this be helpful at all?

6837d514b487de395be51432d9cdd078
0
TheNut 179 Jun 07, 2012 at 10:54

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.