6 ms·
Show HN: I built an AI that turns any book into a text adventure game
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.
- DonHopkins 1y agoSome Chuck Tingle Anthropomorphized Abstract Concept Erotica please! The Last Algorithm: Pounded By The Fake Book That An AI Claimed I Wrote And Then The Chicogo Sun-Times Printed As Fact: https://www.instagram.com/p/DJ7M5XqSQWi/?hl=en https://www.instagram.com/p/DJ7M5XqSQWi/?hl=en https://www.amazon.com/Last-Algorithm-Pounded-Claimed-Sun-Times-ebook/dp/B0F99X5NPP https://www.amazon.com/Last-Algorithm-Pounded-Claimed-Sun-Ti... When author Andy Mirror wakes up to a furious call from his publishing agent, he’s not sure what to make of it. Apparently, the Chicago Sun-Times has announced a new book that this agent was not a part of negotiating. It’s called The Last Algorithm. There’s just one problem: The Last Algorithm is not a real Andy Mirror book. Now Andy is struggling to unravel this mystery, headed to The Chicago Sun-Times building that is bafflingly empty, save for a few machines rolling around. When Andy encounters the physical manifestation of this fake book he is shocked, and strangely aroused, these feelings culminating in a hardcore pounding that will reshape journalism forever. This erotic tale is 4,200 words of sizzling human on fake AI generated book action, including anal, blowjobs, rough sex, and The Last Algorithm love.
- mNovak 1y agoCool concept! Ran into a few bugs.. It seems to think I'm in the middle of an adventure (the little book icon correctly identifies a character and chapter etc) and is prompting for my action, but there's no actual story text being displayed. Maybe just a rate limit thing. Also dark mode immediately crashed the application.
- TSiege 1y agoPeople keep downvoting the copyright issue but this is a serious problem despite this being a toy app. Are you at risk of being sued for using copyrighted material? Is the AI service provider? Whether or not one likes how current copyright laws exist and authors spend a lot of time writing these books and to me this is not fan fiction
- anothernewdude 1y agoAll culture should be shared and not stolen by corporate interests.
- somethingsome 1y agoAaah I wanted to try the infinite napkin, and see what happens with maths book, it should be interesting, but I didn't find a way to upload the pdf, and I don't have an API key.
- averadev 1y agoCool!
- Conscat 1y agoI'm fairly impressed it was able to reenact Fallout: Equestria.
- barapa 1y agoAre you fetching the book content? Or just relying on the LLM to know the story?
- abrookewood 1y agoCongrats 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.
- rahulbisht 1y agoThe idea is great! Would also love for anime and manga to be included. I tried the Harry Potter game with concise and brief settings. My thoughts: 1. Would be great to have a loader for both when I input responses and game start. 2. Got this error after I sent input (it's understandable :), since it would be getting good traction) "An error occurred while generating the story: Rate limit exceeded for shared resources. Please try again in 1 seconds, or provide your own API key in settings.. Please try again. If the problem persists, you may need to start a new game." 3. The story feels lackluster without Visuals. Even text based visuals or emojis we use in chat will be good to have. 4. Would be great if instead of chat we had dialogue selector on top of your character or story. 5. Can also change the background of the page based on book and settings selected. Great work. Love the idea <3
- oooyay 1y ago> The war between the Culture and the Idirans rages across the galaxy. Trillions suffer as ideologies clash. You are Horza, a shapeshifter with a deep-seated hatred for the Culture. You find yourself on a desolate world, a sanctuary from the fighting, when an Idiran warship appears in the sky, a black scar against the pale sun. Honestly a strong start but I got rate limited. Very cool idea!
- exodust 1y agoOrwellian comedy isn't really a thing but it should be if we're heading that direction. My 2 cents with kathaaverse... 1984 You are Stones, perpetually stoned and suspiciously cynical; the telescreen blares drivel about chocolate rations, which are obviously getting smaller, and you gotta decide if Big Brother's lies are even worth the buzzkill.
- BaudouinVH 1y agoKafka's Trial or The Castle could be interesting.
- robin_reala 1y agoI was thinking Agatha Christie’s The Murder of Roger Ackroyd or Ford Madox Ford’s The Good Soldier. Having an unreliable narrator running the adventure story would play right into the inability of the LLM to effectively hold state.
- fifticon 1y agoIn spite of what some others have said, and knowing we have 2025 and AI, I still was rather impressed and pleased with this. I tried to play an evasive hobbit trying to put off Gandalf and the dwarves, but still they insisted. I find this hilarious.
- falcor84 1y agoI found the post [0] to be a really interesting read, and as one susceptible to solipsism and the simulation hypothesis, this paragraph hit me hard: > My biggest difficulty was getting ChatGPT to understand the constraints of the game. It may have been harder because an LLM’s constraints are so close to a text adventure, and it is used to imagining something less constrained; like it couldn’t distinguish between its dream-state and the actual medium in which it exists. [O] https://ianbicking.org/blog/2025/07/intra-llm-text-adventure https://ianbicking.org/blog/2025/07/intra-llm-text-adventure
- sjw987 1y agoWouldn'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
- taraparo 1y agoYou may have created a nice frontend for an AI. You did not create an AI as claimed.
- taraparo 1y agoNo, you did not build an AI. You just vibe-coded a glorified frontend around someone else's AI.
- superkacper4 1y agoI tried the Witcher and that’s cool I had this option. I started as in book entering Vizima to hunt down Striga, but instead of following main path I decided to go to the bar. Then I asked the barkeep about Striga, he didn’t know anything, so I hit him. He draws weapon, I do the same and then I see suggestion „Ask about Striga” and I clicked it. Everybody ignores all what happened and the barkeep starts to give me information about the Striga… I mean I just hit you and we almost got into fight on swords… But idea is great I would love to see how good you can make it.
- alina_3339 1y agoIt's broken but I must the UI is fantastic.
- bArray 1y agoI tried the Lord of the Rings, where I foretold the future and decided to get drunk instead. I ordered Gandalf to find a new ring bearer which they did, and another hobbit went off on the adventure. Did run into this interesting problem though: > An error occurred while generating the story: Rate limit exceeded for shared resources. Please try again in 4 seconds, or provide your own API key in settings.. Please try again. If the problem persists, you may need to start a new game.
- Eggpants 1y agoMy first thought was to try it with the Gang of Four book. I got a headache just thinking about it.
- whitten 1y agoWhat are the issues re the SIL OPEN FONT LICENSE ? Description: https://opensource.org/license/ofl-1-1 https://opensource.org/license/ofl-1-1 Also https://openfontlicense.org/ https://openfontlicense.org/ All licenses: https://opensource.org/licenses https://opensource.org/licenses
- Awesomedonut 1y agoWow! Super impressive POC! Tried it out with a few of my favourite novels, and while it definitely got a few chuckles out of me for character/lore inaccuracy, the fact that it's already this functional is really amazing. Great work!
- jahewson 1y agoThis is such a fun concept!
- tantalor 1y agoCool! I'm trying with Rendezvous with Rama https://www.kathaaverse.com/play/custom-Rendezvous%20with%20Rama https://www.kathaaverse.com/play/custom-Rendezvous%20with%20...
- jetbalsa 1y agoIt did not like Backyard Starship, most likely its not something it has in its memory
- freedomben 1y agoReally cool! I'm guessing the site is getting hammered currently cause I hit rate limit on first attempt, but looking forward to trying it out later when the hug loosens. Sorry for the predictable question, but any plans to open source?
- rcrKnight 1y agoThanks! About rate limit, you can use your own Gemini API key - its stored on your local browser storage only. About open source - haven't decided on it yet.
- vagrantJin 1y agoI was working in an implementation of a vis novel type game for my own screenplays and manuscripts. I ended up building a deck builder.
- imzadi 1y agoI like the idea. Looks like it hit a rate limit. Was trying to try Dungeon Crawler Carl.
- moconnor 1y agoSuper cool idea! What's your plan for dealing with copyright complaints?
- deleted 1y ago[deleted]
- Agingcoder 1y agoHarry potter Matilda - are you sure there’s no legal risk here ? ( independently of the coolness of the project)
- ASalazarMX 1y agoAs long as the prompt and Gemini's own training data is all they're using, they're safe. Gemini allows users to create instances (gems) preloaded with a document, but I don't think this is doing that, given that it (apparently) can use your own API key.
- silentsea90 1y agoThis is so cool, and slick. Unfortunately, the actual adventure part isn't loading so don't know what it feels like
- binarymax 1y agoWould love to try this, but it seems like you hit a limit. Is there a working example you can link to?
- skeptrune 1y agoThis is an awesome concept! The latency makes it a rough UX, but the core idea and direction feel right.
- spacecadet 1y agoVery cool! I recently built a config based AI dungeon master/generative game, https://github.com/derekburgess/dungen https://github.com/derekburgess/dungen
- BizarroLand 1y agoThis seems interesting. What plans do you have for it?
- spacecadet 1y agoNone. It's just a hacky side project thats freely available for someone else to make plans for.
- deadbabe 1y agoThis will be amazing with Project Hail Mary!
- peterclary 1y agoFeels like only a couple of years before AIs can take a movie and reconstruct it entirely as an "open world" VR experience.
- AIorNot 1y agogreat idea, but I wonder about copyright and also hitting a rate limit
- ASalazarMX 1y agoThere's an easy workaround for the rate limit: click on "Advanced" and type your Gemini API key, what could go wrong?
- anthk 1y agoDon't use copyrighted books. Use Gutenberg for these kind of tools.
- CamperBob2 1y agoDon't comply in advance. Transformative uses like this are fair use until adjudicated otherwise.
- ieuanking 1y agoThis is dopeeeee
- myfear 1y agoA little less sophisticated, but I've done something similar with Langchain4j and Quarkus. Ok, without the books. Just a Dungeon Master guiding you. But it's easier than one thinks to build stuff like this. https://open.substack.com/pub/myfear/p/ai-dungeon-master-quarkus-langchain4j-java https://open.substack.com/pub/myfear/p/ai-dungeon-master-qua...
- kmnc 1y agoHow 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?
- catigula 1y agoUnfortunately this is the fundamental flaw. I liken it to playing Minecraft on creative mode.
- lithocarpus 1y agoBut where Minecraft randomly forgets things you built already and they become randomly different or disappear entirely
- haolez 1y agoAnecdote 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 1y agoThe 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.
- mbowcut2 1y agoI'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.
- maep 1y agoNeat, but it has problems following in-universe rules, i.e. fantasy novels.
- HellDunkel 1y agoIf 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.
- csallen 1y agoYou'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 1y agoI neither made this assumption nor the conclusion.
- csallen 1y agoThen what is your goal in pointing out, "People are not even interested in each others dreams most of the time"?
- HellDunkel 1y agoThe point is that we as hunan beeings have quite some elaborate filters to pick interesting things among hunan artefacts. If those are not conciously fabricated by others (i.e.: dreams, ai gen, anything random or auto generated) we tend to loose interest quickly.
- sunrunner 1y 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'?
- spdustin 1y agoWell 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!
- wmil 1y agoI'm curious what happens if you throw something like Ulysses by James Joyce at it.
- LambdaComplex 1y agoForget Ulysses, how about Finnegans Wake?
- ofalkaed 1y agoIt would probably just switch perspective with each chapter. If the AI has any real grasp of literary devices something metafictional like City of Glass could be interesting but an earlier/less complex example of metafiction like Marshlands might work better? If my memory serves I think the metafictional aspects of Marshlands could translate into this even if the AI completely misses the metafiction. Might play with this when I have more time.
- syl5x 1y agoNow this is going to be amazing if we somehow get a structured thing for Dungeon Crawler Carl, I would imagine myself as a crawler wandering around that would be epic, but this requires a lot of options to be made consistent with everything. Awesome job and idea!
- jaysonelliot 1y agoIt'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.
- kevingadd 1y agoFreedom 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 1y agoThat'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.
- gabriel666smith 1y agoThis is cool! I've recently been working on a similar project as a way to "walk around" in my own writing, understand my characters more, etc. I like the three-choice mechanism, with free-text, which I also use. I do feel like, as a reader, I would have to be really desperate to "live within" the world of a novel to use it as a narrative experience, but I understand that there is definitely a demand / desire for that sort of thing, so I hope it hits for people. I input my own novel's title to see if I could do the same. That novel hasn't yet - I believe - been libgenned for "training" by the major LLM providers, though its metadata / marketing materials exists in the knowledge (released fairly recently, announced longer ago). It resulted in a very funny narrative beginning in which the main character was the novelist Patricia Highsmith, which I think was a name used in the marketing materials as a reference point. A very surreal experience. This is going to be a niche use case, obviously, but what might be more common is for users desiring to enter custom narratives (though I know some services provide this basic function already). A much more important bug to flag: where the API fails, the "Try Again" button doesn't seem to resend my prompt, but literally the prompt "Try Again". Here's the text, as I couldn't see a way to link to the story (in which I was trying to see how good the 'guardrails' are for keeping the story in-universe and reasonable - props for it not allowing me to teleport to planets outside of the canonical universe). https://pastebin.com/tjT2zR4R https://pastebin.com/tjT2zR4R
- why_at 1y agoFrom 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!
- wellthisisgreat 1y agoClassic Gandalf
- raincole 1y agoI 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.
- elcapitan 1y agoMaybe we can use it to build an Alzheimer simulator game then
- lambdaone 1y agoI 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.
- Zopieux 1y agoI do not want AI slop games. The entire point of paying for an (indie) man-made game is the care and attention that went into it by passionate developers who wanted to convey a story. The cheap, industrial, soulless output of LLMs is not something I care to consume.
- CamperBob2 1y agoThen move on to the next distraction.
- rcrKnight 1y agoI feel the same about AI vs human-generated content. This is more of an experimentation. But the LLM is instructed to be as close to the author as possible. Nonetheless the AI wave coming everywhere is hard to stop!
- redeyedtreefrog 1y agoInteresting, I'll take a look when the rate limit issue is sorted. There are loads of projects springing up around using LLMs for text adventures. My prediction is that at some point soon one of them is going to get good enough to gain mainstream appeal, but we're not there yet. I suppose Death By AI was a breakout AI text hit, but I'm not sure that really counts. The people behind AI Dungeon have been making AID: Heroes for ages, maybe that will turn out to be great when it's finally released. There's also Friends and Fables that seems to be making rapid progress. And a thousand side projects on GitHub and Steam. I briefly started my own, hoping to build something more like a traditional visual novel choose-your-own adventure with set paths, dice rolls, and limited AI elements. However, I soon realised that if you show people a large amount of text and only occasional user interaction they rapidly check out. The alpha version is here for the time being: https://prismaticnoun.xyz https://prismaticnoun.xyz but I'm unlikely to do any more work on it.
- cactusplant7374 1y agoAny plans to add image generation? Basically make it illustrated.
- rcrKnight 1y agoYes that's part of the roadmap!
- Karawebnetwork 1y agoUsing non-fiction literature leads to surprisingly interesting results.
- roygbiv2 1y agoYou're a big dummy, you've just started learning c++ you come to a fork in the road one way leads to learning pointers the other to a hot bed of coals you have to lie in. Which way do you go?
- SlowTao 1y agoTime to try "Delphi for dummies!" "You are Julian Miller, a curious programmer, always eager to learn new languages. Delphi has caught your eye, promising rapid application development and a visually intuitive approach. You're excited to dive in, but first, you need to get Delphi installed and running. The first chapter of 'Delphi for Dummies' is open in front of you, ready to guide you through the process."
- deleted 1y ago[deleted]
- rcrKnight 1y agoNote that you can use your own Gemini API credentials (Just before starting a game, go to 'Advanced options'). Thanks for the suggestions, I'm improving it!
- redeyedtreefrog 1y agoWhat security features are in place to ensure nothing is capturing or logging user API keys?
- rcrKnight 1y agoCurrently, your API key is stored securely in your browser's local session and is never saved on my servers. When you close the game, it's gone. In future, when I add the 'profiles' and ability to save games and settings, if users want to save their key, I will use encryption.