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