from Hacker News

Automating Interactive Fiction Logic Generation with LLMs in Emacs

by dskhatri on 3/31/25, 3:57 PM with 19 comments

  • by spudlyo on 3/31/25, 7:05 PM

    GPTel is a very powerful interface for working with LLMs in Emacs. It took me a while to understand that its real value isn't what you get with M-x gptel, which creates a dedicated chat session and buffer, but rather the ability to sling prompts, context, and LLM output around in a native Emacs way. You can add to the context from dired, from a file, from a buffer, you can select from various prescribed system prompts for different functionality, you can prompt from the minibuffer, the kill-ring, the existing buffer, a selection, you can have the responses go to the minibuffer, the kill-ring, a buffer, the echo area -- it's extremely flexible.

    I have a little helper function that uses gptel-request that I use while reading Latin texts. It sets the system prompt so the LLM acts as either a Latin to English translator, or with a prefix argument it breaks down the grammatical structure and vocabulary of a sentence for me. It's very cool.

  • by zoogeny on 3/31/25, 7:40 PM

    This is one of the most promising uses of LLMs that I have found in my own work. Many times I have an idea for a refactor or even a feature but I have this mental reluctance just due to the amount of code I would have to write. Like, I have this counter in my head on the number of key-strokes it will take to write a wrapper object in several places, and I hesitate.

    Just being able to tell an LLM "rewrite all of this code using this new pattern" and then dozens of code sites are correctly updated is a huge help. It makes me consider bigger refactoring or minor features that I might normally skip because I am lazy.

  • by IngoBlechschmid on 3/31/25, 7:30 PM

    Gwern shared an idea how to exploit the strength of current-generation LLMs, despite their weaknesses, for "create your own adventure"-style fiction. https://gwern.net/cyoa Having people vote on AI-generated potential continuations should yield better results and cut costs at the same time.

    From the title I thought this was an implementation of Gwern's idea, but it's not.

  • by ZeroGravitas on 4/1/25, 8:25 AM

    I've thought that an LLM wrapper that's able to turn valid moves that you haven't phrased exactly as the old parser expected into one of the acceptable versions, could be a good quality of life improvement to classic text adventures.

    I thought this might be related based on the title, but it's more about refactoring code.

  • by noufalibrahim on 4/1/25, 6:08 AM

    This is probably the most tightly specified use case of an LLM that I've come across so far.
  • by anthk on 4/1/25, 4:53 AM

    I wouldn't use that for Inform6. If you can't grasp the simples OOP language ever...

    Also, Inform6 allows you far more interactivity than a CYOA game. Which both are systems based on states, but a text adventure allows timers, random events, even chat simulations...

  • by kleiba on 3/31/25, 6:45 PM

    What strikes me as odd in the video: why would the author not fill the paragraphs?!
  • by bradleyy on 4/1/25, 2:16 AM

    Honestly, seeing this, I'm 1/2 tempted to revisit org-mode and retrying emacs as a dev environment.

    Don't get me wrong; I use emacs all the time, I just can't seem to make it work for me when working with teams of people on large-ish software projects.

    But maybe org mode is worth a revisit as a "managing my ADHD" tool; it's got to be better than Jira, haha.