Home > Games, Graphics, Plans, Python > Making a rogue-like game with libtcod

Making a rogue-like game with libtcod

Well I haven’t yet made a roguelike game, but I have completed a short tutorial on using the libtcod library.

Trapped in a lonely dungeon. Wait... who's that?!

Libtcod is a library with wrappers available for numerous programming languages which aids in the creation of roguelike games. I happen to be using the Python wrapper.

It provides a special true-colour console with plenty of neat tricks like customizable fonts, blitting of images and off screen drawing areas. These provide the potential for some stunning visuals that still have a blocky, old-school, feel.

While I’m sure these facts alone would make it useful for a great many styles of game, libtcod also provides numerous helpful toolkits which, for the most part, are aimed at roguelike developers.

Basically all of the standard routines that you would otherwise need to figure out for yourself before you can start designing your unique game. These include:

  • Field of view toolkit. What can you see in the dungeon… where does your torchlight fall?
  • Path finding toolkit. Compute the path from A to Z in your dungeon.
  • Keyboard and mouse support
  • BSP dungeon generation toolkit. Tweak the parameters for dungeons, towns, forests or whatever.

Plus a few more neat features you may not have ever imagined you would need for a roguelike:

  • BMP and PNG support
  • Heightmap toolkit 😯
  • Perlin noise support. Hmmm… ocean anyone?
  • Random number and compression toolkits

It’s probably important to note that you can use any or all of the toolkits that you choose… If you would prefer to implement your own dungeon generator for example, that’s fine too. In fact there is still plenty of work still to be done as a game developer. For instance, libtcod won’t implement the monster AI or combat for you (yet).

Lately I’ve been focusing on learning C++, and if I’m to learn one new language a year (which seems a reasonable goal) then this is certainly the year of C++. However, I would also like to have fun with a language that I already know well (ie. Python), and this is where I see libtcod fitting in. My verdict so far is that I like this library and I think I could have a lot of fun tinkering with it.

I’ll post my game here when it’s awesome 😀

Crikey, I nearly forgot! The tutorial that I was blathering on about at the top of this post is here. At the time of writing this only the first part has been written, but that is enough to create the explorable dungeon level seen in the screenshot above. Here’s hoping that the authors finish the remainder of the tutorial sometime soon.

Advertisements
  1. February 3, 2010 at 8:34 pm

    hi, as a fellow libtcod user I found this post (and very interesting blog — buddhabrots and strange attractors!?! I approve! 😀 ) through WP. If you don’t know of it already, the seven day roguelike challenge is coming up in March. I encourage you to check it out! Head on over to rec.games.roguelike-development, or the Temple of the Roguelike forums, you should find some information there.

    • February 3, 2010 at 8:54 pm

      Hi… I assume this is George from the RogueCentral forums. If so, I’m the “Nakedfanatic” who just made the small edit to the dungeon creation part of the libtcod tutorial! Thanks for visiting my blog, I’ll be sure to check out the seven day roguelike challenge, but to be honest I’m not sure if I’d ever find enough hours in a seven day period to contribute anything meaningful! :-[

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: