Readit News logoReadit News
Posted by u/rcrKnight a month ago
Show HN: I built an AI that turns any book into a text adventure gamekathaaverse.com/...
It's a web app that uses AI to turn any book into a playable text adventure. Your favorite book, but your choices, hence your story. You can even "remix" the genre like playing Dune as a noir detective story.

Note: Work in progress. Suggestions are welcome.

why_at · a month ago
From what I've seen, it doesn't seem like AI is very good at keeping track of events in a way that makes a logical narrative.

I tried "The Hobbit" and it started with me having tea with Gandalf the wizard. There was a knock at the front door so I opened it and outside was Gandalf the wizard!

lambdaone · a month ago
I built my own LLM-based interactive text adventure system last year, but in addition to LLMs, it used an auxiliary database to keep track of where everything was, what state it was in, and so on.

The LLM thus did two things: first, it used a combination of the prompt, the user input, and the recent history of the chat and relevant extracts from the database state, to update the database with a new state; then after updating the database, it used all of the above to synthesize the output response.

A major component of the system was that, in addition to the usual blocks-world subject-property-object representation of the game state, the system also used the database to store textual fragments that encoded things like thoughts, plans, moods and plot points.

Adding programmatic constraints to the database and its updates made a vast difference to the quality of the output by preventing logical absurdity of the sort that has been described above - attempts by the LLM to do absurd things were simply rejected.

Finally, there was a hierarchical element to the story-telling, not just simulation. There is much more to storytelling than simulation, and experimenting with this became the most interesting thing about the whole enterprise; there is plenty of space for future research in this.

The downside was that all this complexity meant it was _extremely_ compute-intensive, and thus very slow as a result. But the gameplay was fascinating. We will no doubt see more things like this in future as LLMs get faster; it's an obvious application for open source software.

baq · a month ago
Fascinating that you actually went through with an implementation. I’ve been throwing the idea of LLMs somehow having a sat solver built into them (maybe trained to have one as an emergent property), but something like you describe is the next best thing.
bo1024 · a month ago
Is it by chance open source?
xandrius · a month ago
I wouldn't be surprised if, being Bilbo, Gandalf would troll me like that, just to prove a point he's trying to make.
FredPret · a month ago
Well, he is a wizard
awkii · a month ago
He is never late, nor is he early. He arrives precisely when he means to.
Rendello · a month ago
Ah, yeah. Well, whenever you notice something like that, a wizard did it!

https://www.youtube.com/watch?v=sVgVB3qsySQ

elcapitan · a month ago
Maybe we can use it to build an Alzheimer simulator game then
raincole · a month ago
I wonder which model is this based on.

I've tried quite some models and so far I've only seen two that are good at keeping continuity: Gemini 2.5 Pro and Sonnet 3.7 (both with reasoning on). These two are also exceptionally good[0] at adding plot twists that aren't in the prompt.

[0]: by "my expectation of LLM" standard, not by the standard of bestseller genre fiction.

KineticLensman · a month ago
Tolkien himself never really approved of the ‘cinematograph’ as a way of telling stories so I imagine he would really not like this
wellthisisgreat · a month ago
Classic Gandalf
tibbydudeza · a month ago
Seems on point for AI.
siddbudd · 23 days ago
perfectly acceptable behavior for a stage magician, maybe less for Gandalf
bryanrasmussen · a month ago
time travel is one of the lesser known feats of the Ishtari.
tonyhart7 · a month ago
of course, it didnt have context lengthy enough for that

I mean human sometimes forgot about the state inside the game often

achierius · a month ago
A context of a few things characters? No, it definitely does.

Beyond that... Would you forget that the guy you were having tea with was sitting in your living room? Anyone I know would definitely go "how the hell are you outside" not "nice to see you today".

kmnc · a month ago
How do tools like this avoid what I see in many of these types of narrative chat bots: the user becomes the only one steering the narrative, and the AI ends up just an obedient responder? Whenever I try these things it ends up very predictable, shallow, and repetitive, especially as time goes on. And if I have to prompt the AI to be creative or act differently... is that really acting different?
ianbicking · a month ago
I went to some lengths to ground the action in my game: https://ianbicking.org/blog/2025/07/intra-llm-text-adventure

That said, I think there's a lot of prompting techniques that can help here. (Actually the Guided Thinking section is an example of prompt-only techniques: https://ianbicking.org/blog/2025/07/intra-llm-text-adventure...)

You must at least do some pre- and post-processing to have the LLM consume and generate text that isn't part of the main user interface. But given that you can put in guidance that can increase the small-scale surprise of the interaction. For instance I'll have the LLM write out some of the objective environment at the moment before it considers a decision, so that it doesn't essentially retcon the setup for a plot direction it intends to take.

For the larger arc you'll need something like memory to pull the whole thing together. That include repetition over time. You can ask the LLM not to repeat itself, and it can do that, but only if it understands what it's done. And to some degree it needs to understand what it's _doing_: the LLM like the player is still generating short turns, and so if it wants to create surprise that is revealed over multiple turns then it needs space to plan ahead.

svachalek · a month ago
I've experimented with this and one approach is to avoid the simple chat interface. Let the game be the "user" and have it relay the player's text. Something like

<<< We're in this situation, I'm the game master, and the player said "xyz". I need your help to handle this request according to the rules of the game. >>>

Then the LLM is directing the obedience towards the game master and the rules, rather than the player.

rcfox · a month ago
Back before ChatGPT was publicly available, there was AI Dungeon. It was such a yes-man though. You could be in a scene with a king and a princess, then write "I eat the demon", and it would just invent a demon in the scene, and then describe how you unhinge your jaw and gobble it down.
mbowcut2 · a month ago
I've had similar experiences with vanilla ChatGPT as a DM but I bet with clever prompt engineering and context window management you could solve or at least dramatically improve the experience. For example, you could have the model execute a planning step before your session in which it generates a plot outline, character list, story tree, etc. which could then be used for reference during the game session.

One problem that would probably still linger is model agreeableness, i.e. despite preparation, models have a tendency to say yes to whatever you ask for, and everybody knows a good DM needs to know when to say no.

catigula · a month ago
Unfortunately this is the fundamental flaw.

I liken it to playing Minecraft on creative mode.

lithocarpus · a month ago
But where Minecraft randomly forgets things you built already and they become randomly different or disappear entirely
haolez · a month ago
Anecdote on my side, but Grok 4 was the first model that didn't feel like that to me. Maybe my conversations were just not long enough for it to fallback to sycophantic behavior.
thekaranchawla · a month ago
The core problem here to solve is sense of time. You can't build good long term experiences without building agentic systems that understand time and chat bots that are simple wrappers around LLMs are terrible at this because LLMs don't have a good sense of time.
jaysonelliot · a month ago
It's a pretty cool proof of concept. I did run into some weirdness with it right away when trying the Harry Potter book. The app kept switching between 2nd and 3rd person for Harry.

The main thing for me, though, was the feeling of emptiness I got while playing. I love text adventures, having grown up with Infocom games. The thing about them is that you can feel the choices made by the writer / programmer, just like you can feel the human author behind a book.

I'm sure part of what feels empty to me is because I know it was autogenerated. But I feel that even if I was shown this without knowing an LLM was behind it, the gameplay wouldn't be as rewarding as something written by a human using Inform.

kqr · a month ago
This is true for me as well. Once you realise that with the right prompts you can get the LLM to go off on any tangent you want, it starts to ring really hollow. Add to that the inability of LLMs to maintain world simulations of any fidelity at all, and it becomes difficult to motivate spending time with them in that way.
kevingadd · a month ago
Freedom is valuable in games, especially text adventure games. And an LLM is a powerful way to give the player freedom, since it can respond to almost anything.

But for games to shine they also need carefully considered constraints - when the player bounces off constraints they start to understand how the game's world and systems function, which lets them build a mental model and be able to start thinking the same way the designer(s) thought and come up with solutions for puzzles or decide how to react to a given situation.

What makes a maze engaging as a challenge is that your path is closed off in some places and not in others. Ideally any maze also has one or more concrete solutions, so the player is rewarded for mastering the maze by finding an exit, or maybe finding objectives or creatures hidden at key locations in the maze.

You can probably use modern LLMs to construct this sort of world and set those constraints, but I wonder how far we are from being able to also have the LLM maintain that world state and enforce the constraints?

jaysonelliot · a month ago
That's a very insightful take. I think an LLM would have some role in a good text adventure game, in terms of being able to understand any natural language input and respond intelligently. But as you point out, it would need to do so within strict constraints set by the game designer.

I haven't played with the most state of the art parsers that are available right now, so I wonder how large the gap is between a great parser and using an LLM to process user input.

spdustin · a month ago
Well done! I’ve built this same sort of thing for my family to play with. My advice for the best results:

1) Structure the choices offered by the LLM; add “choice_type” and add instructions to the LLM on what those choices should do. E.g. action, dialogue, investigation, whatever makes sense for the genre—the LLM can even generate these at story start—then “choice should direct the narrator to focus on an action-oriented moment”, “choice should direct the narrator to focus on a dialogue between two or more characters in the scene”, etc.

2) Use reasoning whenever making tool calls for choices, summarize the reasoning, and include it in narrative summaries provided as part of the context for future narrative requests. For example, the combined summary might be: “In the last narrative I wrote for the user, Harry and Luna were startled by the noise coming from the edge of the forest. Important scene developments: 1) Luna and Harry had been approaching the edge of the forbidden forest for the last three narrative turns, and in the turn I just wrote they arrived at the edge. 2) Harry seemed to be the more courageous of the two in previous narrative turns, but in the most recent one, the user’s choice resulted in Harry becoming more deferential to Luna. 3) In the most recent narrative turn, the noise that had been emanating from the forest was now accompanied by a flickering light. I then suggested paths that would allow for character development through dialogue between Harry and Luna (I gave two options here), a path to move the story forward by having Harry take Luna’s hand before running into the forest, and another path that would slow the pace by having Luna investigate the flickering light accompanying the sound. The user’s choice: ‘Have Luna investigate the flickering light.’

3) Add an RNG weighted by story length or whatever works for you that will result in choices that lead the story to a conclusion. Include that direction in the tool call for generating choices, along with a countdown to the finale choice.

This is a rough mental sketch of what worked the best for me, i purposefully left out implementation or application details, as I don’t know what you’re wanting to do next.

Good luck, looks great!

NanoWar · a month ago
How do you come up with this? I feel it is quite hard to formulate exactly what you want from the LLM in general. Is this something you exercised? So good. Or just output from another AI, who knows haha
rcrKnight · a month ago
Great suggestion man, thanks!
HellDunkel · a month ago
If art is communication- and i believe it is- why would i want to read or listen to anything AI generated? Once you are done with consuption there is no point in reflecting on it nor having a conversation about it with other fellow humans. People are not even interested in each others dreams most of the time. Unless the machine is of godlike intelligence there is just zero point.
sunrunner · a month ago
> Once you are done with consuption there is no point in reflecting on it nor having a conversation about it with other fellow humans.

If you believe that art is communication (and I do) why _wouldn't_ you want to reflect on it or discuss it post 'consumption'?

HelloMcFly · a month ago
Machine-generated content isn't "art" because there isn't intention or a point of view, it's just audio/visual stimuli. It doesn't mean it can never be interesting, it doesn't mean it can't even be beautiful. But it's not art, not to me.

That said, I can readily acknowledge that artists can use AI as a tool in the creation of their art. I don't have a philosophical or intellectual problem with viewing AI as a tool and believing it can be a powerful aid in the creation of POV-driven art.

But there is a line somewhere between "no AI" and "entirely AI" that turns it from art to stimuli. I can't define it exactly, and even if I could, knowing that a particular work was partially created by AI creates a requirement that I trust the creator that the bulk of what I'm engaging with is from them, not the machine. And it's very difficult for me to make that leap of trust.

HellDunkel · a month ago
Because there is no point. If the author is a stochastic people machine it is simply not interesting to reflect on it. The fact people make artefacts turns them into art. A stone is not a work of art without some human doing something with it.

You may argue that stones can be interesting without beeing works of art. But the generator above takes works of art as input and somehow takes the art out if it to some degree.

Deleted Comment

csallen · a month ago
You're making a false assumption that other people cannot enjoy what you're talking about unless they've experienced it themselves. If one has good storytelling skills and a solid theory of mind (concern for the listener), almost anything can be interesting. Even dreams.

I also disagree with your conclusion that an activity only has a point if discussed with others. A good deal of the best experiences in my life are things that were for my benefit alone, that I never thought to share with anyone else. And I'm a pretty social guy.

HellDunkel · a month ago
I neither made this assumption nor the conclusion.
abrookewood · a month ago
Congrats on the launch. I think maybe you should get the LLM to pre-compute the paths and store the results. Getting it to calculate every branch of the story as you go presents a few problems: - When it is busy (like it is now), everyone is just waiting for the next section of text. - You are going to burn tokens, even when multiple people are following the same path

That said, the way you have done it means it is roughly unique each time.

tantalor · a month ago
Cool! I'm trying with Rendezvous with Rama

https://www.kathaaverse.com/play/custom-Rendezvous%20with%20...

sjw987 · a month ago
Wouldn't a better version be to take a book and parse the contents into a LLM and create a multiple choice quiz that follows the story of the book? I feel like as soon as you let LLM take the wheel and change the underlying story it's bound to go on a weird tangent.

I tried something like this before and it was a cool way to read a new book or study classics. It would read a few lines of, say, War and Peace, to me, and I would be given 3 choices of what comes next. The options were always quite varied and made you think more about the characters and what they would be likely to say in the context.

You could also just use it for non-fiction to quiz-ify contents for studying. Although that doesn't require the text to continue flowing after each question.

Edit: Nevermind. Just seen the canon game mode