Letting Twitch chat loose on adventure mode and seeing what was left standing
I just really like Dwarf Fortress. I've been playing it for years — the kind of game where you lose a fortress to a forgotten beast, shrug, and immediately start a new one. So when Twitch Plays Pokémon happened and the whole "chat controls the game" thing took off, applying it to DF seemed like an obvious and dumb-fun idea. Adventure mode in particular felt perfect for it — a single character stumbling through a procedurally generated world, steered by hundreds of strangers with no shared agenda.
The setup was Python on Windows, connecting to Twitch IRC and forwarding chat messages to the game as keystrokes via the Windows API. DF's control scheme is dense enough that mapping everything out was most of the actual work. DFHack helped fill in some gaps for things that weren't easily reachable through keyboard input alone.
Language: Python
Platform: Windows
Integration: Twitch IRC, Dwarf Fortress, DFHack
We ran it on adventure mode and basically just let it go. The best part was stepping away for a while, coming back, and finding the world in a completely different state — the adventurer had wandered somewhere unexpected, picked a fight with something they had no business fighting, maybe joined a cult. The chaos was the point. Nobody was coordinating, everyone was pulling in different directions, and somehow that produced stories a single player never would have.
The hardest part technically wasn't the Twitch integration — that was straightforward IRC socket stuff. It was handling the volume of commands without jamming up the input queue and making the game unresponsive. DF has no real input buffering of its own, so I had to manage that on the Python side.
I found out about it by watching Toady's audio blog — DF Talk — like I normally do, and heard the project get a mention. That was a genuinely nice surprise. Tarn and Zach have been building this game for decades and they still pay attention to what the community is doing with it, which says a lot about them.
This project is old enough that it shows. When I wrote it I didn't have much experience with streaming APIs, and simulating keystrokes is about as low-level as integration gets. Now that Dwarf Fortress has a proper Steam release with a more stable interface, and I have a lot more frontend and API experience, I want to come back to this with a cleaner architecture — better command handling, less dependence on raw keypress injection. It's still a project I care about, so a rewrite is on the list.