2010
08.26

Tile based game with libtcod ?

To be honest, I wouldn’t use libtcod for a tile based game myself, but for a game that must support both ascii and tile rendering, it might be an option. I’ve seen people on Goblin Camp’s forums trying to fork the game into a tile based one and I made a few experimentation to see if that was possible with libtcod.

The result is on the demo page. It’s far from being a full featured tile engine and the right way to do it is probably to use both libtcod and an existing SDL based tile engine. Anyway it’s a working proof of concept and it’s always good to know that you can go beyond the ascii limitations with the SDL callback.

I was also interested in making this demo because I’ve always wanted to use this breathtaking free tileset.

5 comments so far

Add Your Comment
  1. I used this tile for few unreleased games (including table-top) very beautiful tiles! Its very interesting where will this take us. Maybe some day we will render rouguelike on a 3d surface on a full-blown super-duper 3d FPS-RTS-MMORPG and it will use libtcod 😀

  2. If I understand correctly, you can use anti-aliased fonts if you always blit them with a solid background color. So fancy libtcod menus and GUIs are not out of the question 🙂

    Dan’s tiles are absolutely awesome. Actually, all of his graphics are — did you see the ones for the Sinistar-type game he worked on?

    About the tiles’ borders, probably a more scalable approach would be to take advantage of per-pixel alpha. Instead of defining grass-dirt borders, dirt-stone borders, (all combinations…), just define more generic grass borders, stone borders, with alpha. Then agree on a a draw order (dirt then stone then grass), and you don’t need to worry about pathological tile interaction cases; it would all work out in the end 😛 (Just a suggestion in case you pursue this further… and yeah it only applies to these tiles if you clean them up.)

  3. The problem is that the font is not blitted on the tile map. It’s the opposite. The tile map is blitted on the console on every black pixel. There’s no way you can make antialiased font work because the screen surface doesn’t contain alpha information from the font…

    Your transition solution would be fine, but requires work from a pixel artist as awesome as Dan… Anyway I wanted to use the tileset as is (I only converted key-color based transparency into PNG alpha layer). This is only a small demo and I don’t intend to push it further. Using Dan’s tiles for a game is a dead end because as soon as you’ll need another tile, it will suck compared to Dan’s…

  4. Yeah, those tiles set the bar way up 🙂 About anti-aliased fonts, I meant that you can set the background color of the cells that have text to something other than black (so, not “transparent”), and use anti-aliased fonts, since behind the letters there’s a solid color and not the drawn tiles. As long as you don’t care about having background-less floating text (like you have in that screenshot).

    So you can have a sidebar, menus, inventory, etc, all with an anti-aliased font, as long as their background color is not black (transparent).

  5. Indeed, you’re right. Didn’t think about that !