Libtcod and Roguelikes

Digging around in a friend’s python scripts and editing them for my own use got me thinking about games like Dwarf Fortress, NetHack and even old space trader games like Elite and Freelancer. Generally, Roguelikes are characterized as being text/console based games, with randomly generated dungeons, and often times randomly generated items (an item named “bubbly potion” might heal you in one game, but kill you in the next).

Perhaps the most interesting Roguelike to come along in recent years has been Dwarf Fortress, which has sort of been defining it’s own incredibly complex, detailed sandbox genre. By complex, I mean that some people complain about playing it at an acceptable rate on modern hardware, as they might complain about a more graphically intense game like Battlefield 3.

That said, the seeming simplicity of the game genre would seem to make it rather easy to code one up from scratch, and make your own customizations as you go along. Alternately, if you could find a NetHack-style Roguelike framework, you could take the “rendering engine”, apply your own back end, and create a different genre of game, like a Space Trader perhaps. I was happy to find the Libtcod library.

Libtcod gives you a huge amount of Roguelike features right out of the box, and in about 500 lines of code, you can be up and about scooting your little @ symbol around the screen, fighting monsters and exploring randomly generated dungeons. There’s a great tutorial that will walk you through getting the @ symbol on the screen, to building a randomized dungeon, to fighting monsters in it. You can find the tutorial here. It includes standard features, and in addition things like 24 bit color, alpha transparency and support for bitmaps. It’s a fancy piece of kit. If you want an idea of what it can do, take a look at and download Pyromancer, a visually stunning game built on top of Libtcod.

What blew me away was that in addition to what he’s done with Libtcod (well, he wrote it, afterall!) – is that someone took this graphically intensive ASCII interface – and then built a windowing system – Umbra – on top of it. Let me take you through this again – console, text only game, color 24 bit text only game, application platform.

Umbra looks and feels like this (skip ahead to the 0:55 mark):

Anyways, I am relearning Python, digging through the tutorial bit by bit. It’s written simply enough that you have a functional game by the end of the tutorial, and is modular enough that you can go about modifying bits without too much fear of permanently breaking other things. There is a C++ version, but I am spending a lot of time digging in to Python code these days, and Python feels faster to modify and test than C.

This entry was posted in computing, Games and tagged , , , , , , , , , , . Bookmark the permalink.

5 Responses to Libtcod and Roguelikes

  1. Thanks for sharing your info. I really appreciate your efforts and I will be
    waiting for your next write ups thank you once again.

  2. Zaybel says:

    6.: Yay for roguelike enngies! As a recent RL developer I must say dealing with a proper engine has been the main reason why I stuck around. Please direct newbie devs to one of these enngies.5.: Wouldn’t it be awesome if vaults were simple drop-in files that you just dumped in a “vaults” folder and the game used them? Technically it’s very easy to scan a folder. Better yet, do the same with creatures. Like with spore, many people would take the opportunity and publish their own! (No, I’m not being naive and believing that the popularity will be anywhere near comparison.) Imagine web pages with monster and vault packs to download.A simple way to balance custom monsters might be to give each ability/attribute difficulty points (positive or negative). The “base dungeon level” of the monster will be its points divided by 10, for example. A 40-points monster will appear around and after level 4.

  3. Hi there just wanted to give you a brief heads up and let you
    know a few of the images aren’t loading correctly.
    I’m not sure why but I think its a linking issue. I’ve tried it in two different web browsers and both show the same outcome.

  4. Because of this trendy mobile application developer.

    Also the app owner. Even teenager could knows, how to help you fight damage you give and defend yourself equivalent of hitpoints on RPGs.
    First and the defensive growtopia cheats events. The Android boasts a spectacular sense of style.

    Future updates will include a strategically portion, which have made Android an ideal solution. Tags: Academy Of DesignBy: Academy of Design Jul 31st 2014 12:37.

    Feel free to visit my web blog :: Growtopia cheats list

  5. Mckinley says:

    Hmm is anyone lse experiencing problems with the pictures
    on this blog loading? I’m trying to figure out if its a problem on my end or if it’s the blog.
    Anyy feed-back would be greatly appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>