Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - SteveRL

Pages: [1]
1
Programming / Re: First Roguelike on Python 3
« on: September 06, 2015, 03:22:36 PM »
The apparently popular "Complete Roguelike Tutorial, using python+libtcod" uses Python 2.7. and says that libtcod is incompatible with Python 3.
However I have found a library called tdl (https://pypi.python.org/pypi/tdl/1.5.0) which promises to be a similar library that works with Python 3.4.
Does anyone here have experience with it? Is it similar enough to libtcod that one can follow the old tutorial?

Hi,

I'm doing essentially the same thing myself.  I'm not a professional programmer by any means, although I suspect I may be slightly more advanced than you are, based on what you've said about yourself.  I've been working in software QA (read: "programmer-adjacent") for several years now, but I've only recently begun to learn Python as a specific language.

I'm using Anaconda as my dev environment for Python 3.4, and untdl as my roguelike library (itself a port of tdl, which you mentioned.)  I'm following along the same "Complete Roguelike Tutorial" which you mentioned and altering the code snippets as necessary to make it work with untdl rather than libtcod.

I wouldn't say this is easy, by any means, but it's doable.  If you're up for a challenge and a learning experience, it would certainly be educational.  Untdl's documentation is not always as complete as one might like, which can make it tricky to figure out what you need to do differently.  But basically, whenever you see the tutorial calling some function from libtcod, you know you need to find an equivalent function from untdl.  The mapping is not always one to one, so this can take some digging.  The rest of the code can be left largely unaltered.

If you want to try this as well, I'll just say this: use the 32-bit version of Anaconda, even if you're in a 64-bit operating system.  Untdl apparently does not fully support 64-bit.

Also, when it came time to start generating random room sizes, I just used the standard Python "random" library.  I'm not sure if untdl has RNG functions like the ones libtcod uses in the tutorial, but why reinvent the wheel?

Pages: [1]