Questions tagged [libtcod]

libtcod (also: The Doryen Library) is a library for advanced console output and API for developing roguelikes.

from the libtcod homepage:

libtcod, a.k.a. “The Doryen Library”, is a free, fast, portable and uncomplicated API for roguelike developpers providing an advanced true color console, input, and lots of other utilities frequently used in roguelikes.

libtcod offers bindings for a wide range of languages, including C, C++, C#, D, Common Lisp and Python. The source is available at BitBucket.

51 questions
5
votes
2 answers

Can I store items and their properties in an external file and call it when needed? (When programming a Roguelike in Python)

I have just finished working through this tutorial for programming a Roguelike in Python and am now very much on my own in figuring out where to go and what to do next. My predicament is with the messiness of the code. I would like to store elements…
2
votes
2 answers

Keystrokes/Controls in libtcod and python?

In the Python/Libtcod tutorial on Roguebasin the basic code for controlling your character uses the up down left and right keys. Is there a way to make it use WSAD or any other keys? Libtcod only allows me to use "special" keys, like the arrow keys,…
2
votes
1 answer

How to use Chinese characters in libtcod?

I have an idea of using Chinese characters as an entities in my ASCII-like roguelike console game. I'm using python-tcod, but I don't know if there is a way to use Chinese characters in it. I tried setting Chinese fonts through…
Quakumei
  • 57
  • 6
2
votes
0 answers

Cannot find libtcod.hpp on Xcode on MacOS Mojave even though it is included?

I'm trying to create my own game through the libtcod library on MacOS. I've installed the library for mac and made sure that all the files are in the folder. When I try to test my code in Xcode, it says that the header file (libtcod.hpp) cannot be…
Aqeel
  • 21
  • 2
2
votes
0 answers

SDL : cannot create window

I'm trying to create simple roguelike with python and libtcod. The problem is that when I m trying to execute this code, console shows: "24 bits font. key color 0 0 0 24bits greyscalefont. converting to 32bits libtcod 1.6.2 SDL : cannot create…
Jakub Kosior
  • 186
  • 1
  • 2
  • 12
2
votes
2 answers

Python Libtcod: How to do pathfinding with variable move cost terrain?

I am building a turn-based strategy game using Libtcod and Python. The game map has variable terrain and each tile can be 1 of 5 types: Plains - Costs 1 to move over Forest - Costs 2 River - Costs 4 Hill - Costs 3 Mountain - Impassable Each type…
Dider
  • 367
  • 1
  • 3
  • 17
2
votes
1 answer

Using Libtcod, how to console->print a string with a dynamic amount of colors?

I've got a helper function that accepts a string and a vector of colors to use to format the string and right now my solution is to manually check the size of the color vector and call the console print with that same amount of colors. Say I've got…
TankorSmash
  • 12,186
  • 6
  • 68
  • 106
2
votes
1 answer

python and libtcod: generating terrain using perlin noise

I found a great post about world generation, which can be found here. It does a good job describing what needs to be done, but I'm having trouble figuring out how to do it in python. I believe it was done in as3, but I'm not sure for certain. Any…
Jeremy Darrach
  • 273
  • 1
  • 6
  • 18
2
votes
1 answer

Python / LibTCOD - libtcod.console_wait_for_keypress(True) triggering twice for each input

I'm going through the Roguebasin python/libtcod roguelike tutorial. The problem I encounter is, every time key = libtcod.console_wait_for_keypress(True) is called, the main loop fires off not one, but two times. The code handling keyboard input is…
Mainframe
  • 21
  • 2
1
vote
1 answer

Roguelike Development Roadblock! libtcod.map_compute_fov depreciated?

I'll try to be both brief and thorough. I am following the tcod Rouguelike tutorial at the following link: http://rogueliketutorials.com/tutorials/tcod/ I am using PyCharm Community Edition, though I don't think that much matters. All was going…
R3TURN-0
  • 83
  • 1
  • 9
1
vote
2 answers

Assigning Variables to Tuples in a List

I am currently using a function to return a list of tuples (coordinates). I need to assign these coordinates variables so I can use them in a for loop. My function is: new_connect = astar.get_path(n1x, n1y, n2x, n2y) with print(new_connect) I get…
TrialOrc
  • 23
  • 4
1
vote
0 answers

libtcod/Python: CPU usage through the roof using sys_check_for_event instead of sys_wait_for_event

I'm building a game in Python 3 using the CFFI port of libtcod. Handling user input works very well with the sys_wait_for_event method (both keyboard and mouse events are immediately captured), however this prevents me from making the game realtime…
keepitwiel
  • 122
  • 7
1
vote
1 answer

Roguelike game on Heroku server: Libtcod dependence

I am trying to serve up game logic in a Heroku Python app. I'm using the libtcod library for some basic tasks (mostly Field of View calculations) and I'm having trouble getting it to run there. Right now it's getting hung up on libSDL not existing.…
Riley
  • 21
  • 1
1
vote
0 answers

Installing libtcod on MacOS for Rougelike

I've been following the Python3 guide on roguebasin (http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python3%2Blibtcod,_part_0) and have gotten stuck during the libtcod installation. I've followed the guide completely…
1
vote
1 answer

Libtcod python 3 crashing when trying to move character?

I'm trying to make a basic roguelike and following this tutorial: http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python3%2Blibtcod,_part_1 I tried to make a character respond to mouse movements using libtcod. I followed…
Veatix Ion
  • 21
  • 4
1
2 3 4