r/roguelikedev • • 19d ago

To whoever created libtcod / python-tcod ? Thank you!!

I was trying to code a roguelike and it was frustrating me o much I was having AI assist me, I did some googling and also talked to a friend who took game design and Dev at college , they suggested trying the real PY versus ai . Its working way better than I expected, its only 1 room, and a few items , but IT WORKS! thanks

49 Upvotes

15 comments sorted by

60

u/HexDecimal libtcod maintainer | mastodon.gamedev.place/@HexDecimal 19d ago

Libtcod has been a collaborate project with multiple devs adding various pieces to the C library and writing various ports.

I've rewritten the Python port to make it work well in Python's ecosystem, which generally meant integrating Numpy to remove Python's main performance overhead, while also contributing upstream to libtcod itself. I've been the primary maintainer of libtcod and Python-tcod ever since.

3

u/Left-Excitement3829 18d ago

You are the progenitor ! Thank you. I’m still quite lost , but the examples I’ve looked at I sort of understand , but as I said I did a few small things and it generated what I wanted after a day of trial and error. Python loads incredibly fast for a 1 room test , so it’s easy to edit and adjust things. My idea is realtime , that took the longest to figure out , the FOV code is a godsend Now I need to decide on other things. Is there anything in libtcod that no one really utilizes ? My idea is a bit weird , so weird stuff can fit in I hope. Thanks again

10

u/HexDecimal libtcod maintainer | mastodon.gamedev.place/@HexDecimal 18d ago

The title of libtcod's progenitor tends to go to Jice. I inherited libtcod since I was the most active contributor of fixes and refactors.

I don't have much advice for a generic project: Make sure to become familiar with Numpy since storing and working with Numpy arrays is faster than the alternative. I might also suggest looking at my standalone tcod-camera and tcod-ecs packages on PyPI, depending on what you need.

1

u/Left-Excitement3829 18d ago

Ok great thanks. I’ll look into this stuff , like I said it’s way beyond me at the moment. But I’ll keep plugging away

5

u/HexDecimal libtcod maintainer | mastodon.gamedev.place/@HexDecimal 18d ago

My idea is realtime

I have to stress how important Numpy is for completing a frame before VSync. Python code iterating over map data in a nested for-loop will struggle to reach 60FPS on modest hardware.

Libtcod has a history of interesting real-time projects and examples, but they were written in older C++. The samples from the C libtcod repo have some inspiring real-time effects if you can compile those.

1

u/Left-Excitement3829 18d ago

Ok great. I’ll look into that once I get home. More things for me to mess up :)

3

u/Noodles_All_Day Cursebearer 18d ago

Python-tcod has been super instrumental for me, not just for my roguelike, but for learning how to program in general. Before Python-tcod most of my experience was just data analysis in Python. I had wanted to program a roguelike for many years, and if it weren't for Python-tcod it would have been way harder for me to get over the "should I?" hump to actually start my project.

Needless to say, it's a great tool!

4

u/widgits 18d ago

Just jumping on the tcod appreciation train, genuinely such a wildly helpful and pivotal tool for me fr. Also cracked me up to see this post here bc like the main person is like one of the most active people in this sub, I was sure they would appear lol- but yeah shoutout to u/HexDecimal also kinda unrelated but also shoutout u/Kyzrati and I’m sure many other legends I don’t recognize by name, yall and others in this sub have helped a ton of people get their first projects off the grounds and low key hold this community down, your hard work is greatly appreciated

4

u/Kyzrati Cogmind | mastodon.gamedev.place/@Kyzrati 18d ago

I was thinking about popping in to mention libtcod helped me get into dev as well, all those years ago back when the original creators were still putting it together (Hex took over much later and vastly improved it, of course).

Not nearly as many users back then, but such a great solid foundation for getting into roguelikedev, and I had the honor to submit my first bug fix to a public project, and get my questions fielded by Jice (and to a lesser extent check out Mingos' related libtcod add-ons which I learned from, too).

Some community trivia: Jice actually showed up here many years later with a new roguelike library, though that one didn't gain the same popularity or expansive features in the end. Easier to do those fun hobby projects when you're young, after all :P (e.g. libtcod)

3

u/frobnosticus 11d ago

It's such a great piece of kit.

-8

u/[deleted] 19d ago

[removed] — view removed comment

1

u/Left-Excitement3829 18d ago

No idea why you are getting downvoted , but yes that’s what I’m doing. I’m basically just using blocks of code I’m adjusting to my requirements. So far the results are almost as expected. I’ve had 2 items that were vastly incorrect , but were better than what I wanted. So happy accidents for the win !

7

u/HexDecimal libtcod maintainer | mastodon.gamedev.place/@HexDecimal 18d ago edited 18d ago

No idea why you are getting downvoted

People are reacting to some common LLM tells in the post you've replied to: That post made unusual assumptions about your post, filling in the blanks and replying to that instead. Their advice is correct but overly generic. There are more tells if one looks into the account itself.

2

u/Left-Excitement3829 18d ago

aha the foibles of Reddit, that also explains the reply instantly after I posted ! , thanks

2

u/widgits 18d ago

What Hex said; it’s a bot