Introduction to Roguelike gaming

I play many different kinds of video games, but Roguelike games are some of my favorites. Before I go into the why, let me introduce Roguelike games to those of you who are not familiar with them.

The Roguelike game genre was created all the way back in 1980 when a game named Rogue was released. In Rogue, your character walks around an two-dimensional ascii dungeon, fighting fantasy monsters (represented by ascii letters), finding items (represented by punctuation), and trying to survive. Later, quite a few other now-well-known games were released -- including the “Big 4”: Angband, Nethack, ADOM, and Crawl. Nethack, released in 1987, is probably the most well known of all the traditional Roguelike games, and it’s popularity has made it a part of computer culture and lore.

Even though many of you have never played a traditional Roguelike, it’s very possible you’ve played a non-traditional one. Diablo and Diablo II, the famous games by Blizzard, shares many features with typical Roguelike games, only with fancy graphics, a refined user interface, and in real-time.

There are several things that make Roguelike games really cool -- first, unlike most traditional games, they are HIGHLY randomized. Almost everything is different every time you play: the dungeons, the creatures you meet, the items you find. This gives Roguelike games an immense amount of replay-ability, which is why they are still popular even after all these years. Second, they are HARD, requiring the player to utilize any resources at hand in an attempt to survive. And when your character dies, he or she dies forever. Beating one of these games is a real challenge, and doing so is a real accomplishment. Third, and most relevant to this blog and website, these games are often open-source. This not only means they’re free (which is hard to beat), it also means we can take a look at their source code (many are written in C or C++). While most of them have not been coded using modern coding methodologies (and hence are not suitable candidates for learning how to program), what they do offer is the chance to take a look at and discuss some very interesting algorithms in a simplified context.

Many young programmers decide to learn C++ because they ultimately want to write games (I did at one time). Roguelike games are an ideal place to start, because they allow the programmer to concentrate on the structure of the code instead of having to spend all his or her time creating art assets and making things look pretty. The innate simplicity of the user interface of Roguelike games (essentially being just ascii text) makes them an excellent testbed for learning and implementing new ideas and algorithms that can then be generalized to fully graphical games, such as Massively Multiplayer Online Role Playing Games. And they run on almost any computer, even old monochrome HP workstations.

Despite the apparent simplicity of writing a roguelike game, many new programmers find themselves in over their heads once they get into the details of writing a roguelike game. Roguelike games can be deceptively complex once you look under their hoods, requiring an intersection of artful decision making, algorithmical knowledge, good programming habits, and persistance. And that is precisely what makes them so interesting. 🙂

How do you write a random dungeon generator? Or a random item generator? How do you do efficient field of view calculations, where a player can only see what is lit by his light source, and walls or other terrain obstacles block line of sight?

There are all questions that I would like to eventually explore on this blog. I think it would be interesting to do a tutorial series on the subject, to show how a Roguelike game can be built from the ground up in C++. In the meantime, while I am still working on the C++ Tutorial, I will occasionally discuss various general topics in Roguelike gaming on this blog.

Feel free to check out some of the major roguelike games in the genre and get a feel for them. Just make sure you leave yourself enough time to get addicted. Because they’re an awful lot of fun.

15 comments to Introduction to Roguelike gaming

  • sharaf

    hey when i see on youtube i see roguelike is colored not black & white but c++  
    user screen is only black and white then how will we get colored?

    i have not gone through the whole tutorials but i am going just for a break i asked this question!

    you can give me answer that you will teach in higher chapters(i mean that will that be at end of tutorials?)

    hey and i think you might be a software professional, so do you create games (colored ones), i will not ask for code, just for fun . do you?

  • jerrikk

    I’d still love to see this become a reality! Love the tutorials here. Best i’ve found 😀

  • duanuys

    after 2 years most likely no ha

  • Darkfyre

    So no hope of ever getting the tutorial for this?

  • Would love to see the tutorial for this! I have only started learning C++ using your guides and am at chapter 2 atm. I am loving every lesson and its a big big help. I started learning because I want to get into game development and this Roguelike gaming sounds great. going to check out some of these games while I wait for the tutorial. very excited!

  • Kaelidian

    Diablo games were/are a great concept and learning to do this style of gaming could be very complimentary to any programmer’s abilities. I look forward to the day when you get the time to write this one out.

  • vikas

    hii alex….previous layout was far better..this one is difficult to read..

  • ln

    Since you guys are aching to play roguelikes, I’d suggest Dwarf Fortress and various other games made by Bay 12. They’re all ASCII, and they vary from an immense city builder/god game/strategy game to smaller, more traditional roguelikes and some goof-offs. The community there can direct you to other games as well, if you’d prefer that.

  • Yasser

    They hae been requesting you present a rogue-like programming tutorial since 2008 & you haven’t been able to do it till now. You must be really busy.

    • That is so true. I put all my free time into finishing up the C++ tutorial, and then I got a new job that eats up all of the spare hours I used to have, so there is very little time left to write these days. Someday…

      • jb

        I’m bored with the stuff my university makes me do so i want to do something myself. Unfortunately i cant find anywhere that says how i might go about representing stuf graphically, like roguelikes. The furthest I’ve gotten to is printing 80 x 24 characters at a time to fill the console screen… Do you recommend any site/book/anything that I might be able to use as reference to learn this? Like that everyone else who has been waiting for a tutorial here can have something to do while they wait for you to sacrifice your vacation/free time/job in order for you to start this tutorial 😛

  • So did you end up making a tutorial????

  • roguelover

    Whatever happened to this idea? It would have been a great to see a rogue-like programming tutorial!

    • I’d still love to do this -- however, I got a new job about four months ago and my writing pace on the C++ tutorial (which I want to finish first) has since slowed to a crawl due to time constraints. But thanks for reminding me that I meant to do this at some point.

Leave a Comment

Put C++ code inside [code][/code] tags to use the syntax highlighter