Sign in to follow this  

Pretty awesome tutorial on making your own Roguelike in C++

This topic is 3844 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, I found this pretty cool tutorial on how to make your own Roguelike in C++, targeted towards beginners. I've yet to finish reading it, but what I've read so far is worthwhile. Check it out if you're interested, and if you don't know what a Roguelike is: Wikipedia search for Roguelike The tutorial is here! ENJOY!

Share this post


Link to post
Share on other sites
"Roguelike" and "tutorial" scares me -- most roguelikes of any pedigree have obscene code, which means a lot of new ones learn from that obscene code and make more obscene code (although perhaps slightly less so).

This tutorial isn't that good. I skimmed the first bit, because they were largely about basic roguelike concepts. I figured I'd review it if the rest of the tutorial turned out to be decent.

It started going downhill when we got to actual code. The author claims "Classes are quite literally the most important aspect of Object Orientated C++ programming," which suggests a fundamental misunderstanding of what object oriented design and programming is all about (classes are an implementation detail, at least as far as the "class" keyword is concerned). The author's initial stab at a "Character" class fails to achieve any kind of solid object-oriented design, so he should probably not be talking about OO at all in his tutorial. Also, the class may compile, but cannot be used (no definitions for the methods, and everything is private. Oops.)

He recommends Dev-C++. This is a terrible IDE backed by an outdated version of GCC. Not a good choice.

He finally gets to explaining "public access" to his classes in the next section, after making you jump through a bunch of hoops compiling stuff and claiming "things existed!" when really you accomplished nothing but, perhaps, instantiating some stack or global variables initialized to garbage.

He's going to have more problems with his ASCIIRoom class that returns from accessor functions by value, but does not provide manipulator methods to match those accessors (so you can't ever change the contents of a room)...

Okay, end of tutorial.

Over all, the code is not as terrible as I'd have imagined. The console drawing class he provides might be a useful starting point for somebody interested in building a roguelike. However, the tutorial purports to basically be a beginners C++ tutorial, and at that it fails miserably by moving far to fast, being far too verbose about things that are irrelevant, or going about things in a backwards or otherwise inefficient matter. Plus he uses poor tools. He did, however, at least stop harping on incorrectly about what is and is not "fundamental" to object oriented design, so that's another point in his favor.

Overall, I rate the tutorial as utterly dismissable, but the console class might be worth examining. He'd probably have written a better piece if he focused instead on how the console class was built, and how it worked, rather than trying like so many other barely proficient C++ programmers to "give back" to the community by writing a poor man's "learn C++" tutorial.

Share this post


Link to post
Share on other sites
Yeah, this is pretty clunky code. I also don't agree with pitching it towards absolute newbies... a Roguelike has very layered, very complex behaviour and that's why the code is so tangled on most existing ones (sans perhaps JADE and a few of the Java Roguelikes like the Castlevania one). With a few hours of refactoring and going back to paper and pencil it could probably be something much better, though (if not particularly extensible -- abstraction hurts newbies' brains).

I'd be interested in writing a proper article for one of these if there's a lot of interest.

Share this post


Link to post
Share on other sites
Not to mention that one can accomplish much more in less time if one simply chooses a more beginner friendly language than C++.

I once thought I'd learn C++. I didn't quite understand why (almost) everyone was advicing against C++. I thought: "Yeah, a complete beginner might find it hard...", and I thought that because I had taken all kinds of courses in college, I'd be fine.

But, when I saw that jwalsh was making a MiniMORPG, and he was going to use C#, I quickly borrowed a C# book from a friend, and I'm very glad I did. Programming C# is a breeze compared to C++, at least in my opinion. Also, XNA makes things even more enjoyable!

However, I can't say I've tried all languages and ways to make a game. There might be even better ways for a beginner to start making games.

Well, that's just a little piece of advice from me. Good luck!

Share this post


Link to post
Share on other sites
Ha yeah by the time I finished reading the tutorial(although incomplete) I realized that It wasn't THAT awesome, but I would say that for a beginner having not done any OOP it would have helped me understand it and given me some excitement to continue to learn if I was going to be able to get some sort of a Roguelike, even if its just the graphics.

Quote:

Ravuya said

I'd be interested in writing a proper article for one of these if there's a lot of interest.


Hah I'd be interested definitely. I think doing those basic ASCII graphics with a Roguelike, which is mostly an RPG, is a good transition between Cplusplus and Cplusplus with graphics. And the fact that it's an RPG would draw in more people, especially those who are tired of making text-based RPG's. I would love to see your article on the subject, and judging from Glow (haha I actually play the game) it would be fun and worthwhile.

Share this post


Link to post
Share on other sites

This topic is 3844 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this