I’ve talked before about how I use AI as a coding companion - a partner while I’m making things. I was curious how this would play out in other contexts, and that’s why I built if-pal. With it, you can play old (and some newer) interactive fiction games - like Zork, Suspect or, my favourite, Wishbringer - with an AI pretending to be a gen alpha friend and reacting to the game.

Why gen alpha? Well, it didn’t start that way. I was showing my eleven-year-old Zork and I was amazed how much he enjoyed it. Or at least, how much he enjoyed playing it with me. Like most gen Xers, I barely understand a word he says but I love hearing him and his friends speak. There’s a joy in language that I don’t think was a big feature of my childhood - I blame TikTok and the different cultural bubbles we live in, ngl.
Initially I thought I would make a useful companion for playing the game - a utility that could remember things and give hints. But as I played with it, I realised I wanted it to experience the game with me and to have some kind of joyful personality. The minute I started changing the llm system prompt to include gen alpha language - largely to troll my son - I knew I was on to something.
Right now, if you want to play with it, you’ll need to build and run the app locally - it’s on github. You’ll need dfrotz and node to be installed. You’ll also have to change a configuration file. You can configure it to use a local llm via ollama or you can give it a claude API token and use claude remotely. I haven’t found a local llm that works brilliantly for this on my old macbook yet, but I’m still looking.
If you get it working and want to experiment a bit with different personalities, the system prompt is in the contextManager.ts file. Have at it!
For some reason, I really like making things that if they didn’t exist, no-one would ever think or want to make them. So, if you’re sitting there wondering why on earth I did this, that’s exactly the response I’m after!
This first version of the app shells out to dfrotz to run the adventures and does a minimal bit of munging to present the output. But that yak needs to be shaved so I’ve been writing my own zmachine emulator in elm and hope to use that in future. I’ll write about that soon.