I was recently looking at a modern POS tagger js library called compromise that looks like it might be a nice way to use more modern NLP (but not LLMs) to make a parser that handles natural language a bit better while still being predictable?
(I was actually looking into this because I’ve been thinking for a while now about making something that can take a written room description, extract all the noun phrases, and auto-generate stub code for the room and its objects, and the recent post about a utility to check for undescribed objects inspired me again. But it could be helpful for the parser as well?)
You’d think. The reality is AI will cause more work than before. I’ve been looking at getting AI to code stuff. What happened? I spent ages fixing AI’s bugs!
I agree. If the author didn’t care enough about the prose that is presented in a text adventure game that they basically hit “shuffle” to generate it mechanically, it’s difficult to muster enthusiasm to write a serious review. An AI isn’t going to consider any feedback or even see constructive review notes, and likely the author won’t care about that feedback either since they didn’t write it.
I suppose you could argue that LLMs could be used to ‘stylise’ text produced from procgen like Curveship, but even then, would it produce great output considering its lack of a world model?
There’s something to be said for using “dummy” prose when working on the structure of a game. Ideally there’s a point though where the author replaces it with their own work.
I’ve made a choice narrative where I’ve just put “TODO” as the passage text or “This is a conversation with Bob about his lost wallet TBD” or pasted in Lorem Ipsum paragraphs to create volume and see how text flows, but all of that was subsequently replaced with my own writing.
AI generated text might seem a better solution, and I had to look up the meaning of “tech debt” but I agree: it’s probably hard to resist then polishing that as a “first draft” of your adventure.
With regard to fiction, I’m much more interested in reading what humans think and create rather than an algorithm.
This is partly why I think it would be best for such a system to only trigger when a command would otherwise produce an error. If you type “examine self” it should just do that, unless there’s some reason that particular game doesn’t at least produce the default response. If you type “check my appearance” then it may be preferable to have a second’s delay to get “(examine self) As good looking as ever!” rather than “You can’t see any such thing,” which isn’t a terribly helpful response. Something faster running locally would be preferable regardless, but even then my feeling is that it should stay out of the way as much as possible.
Thinking about this, the absolutely ideal (though probably unachievable) approach here would be something roughly equivalent to telling an experienced player what you want to do. I ran Who Whacked Jimmy Piñata past my local critique group before submitting to IFComp even though none of the members had seen a parser game before, and was doing exactly this. If they said “drink river” I could just type that in for them, but if they said “ask who might have wanted Jimmy Piñata dead” I could translate that into “ask officer about suspects.” Even a system that could only manage that a fraction of the time might reduce frustration for a new player, potentially guiding them towards the expected range of verbs in the process.
Yeah, that’s the sort of system I’m imagining. In my experience, pretty much nobody wants to read LLM-generated text. But modern neural networks are incredibly good at processing text in all sorts of ways, and a successful use in IF would play to that strength rather than the weakness of slop text.
It seems to me that the input processing methods being discussed here could be handled with a natural language processing library. I see a number of them available for node/javascript which seem used largely for chatbots: wink, natural, nlp, compromise (+1 to the author of compromise for using a Simpsons reference and other pop-cultural refs in their docs). I haven’t looked much into NLP, but I’ve been working on a game parser, and from what I see, these libraries are doing pretty much the same thing as a game parser - finding sentence boundaries, tokenizing, stripping punctuation, removing stopwords, etc – just more deeply with more data lookups. It seems like you could integrate any of these as a layer between player input and game actions to build an improved parser without going so far as resorting to an LLM.
If nothing else, I’ve added handling to my own parser to remove the obvious phrases “please”, “I want to” and “I want you to” from input during normalization, which seem like the lowest hanging fruit.
Just for fun I’ve been poking through the compromise docs. The way they handle periods as not-sentence-boundaries, and possessives, speaks to recent conversations in other threads about features needed by modern parsers. These are concepts that I’d never thought through, but which seem like they can be easily be applied. There’s definitely some techniques to pick and choose that can make a friendlier parser without turning to an LLM, or even needing a full NLP library.
As I mentioned in an earlier post, I’ve been looking at compromise as well; it seems really nice & exactly the sort of thing that interested me about NLP when I first started getting into it years ago, before LLMs came along and ruined everything.
Yeah, it seems like the most friendly of the options I’ve seen. Open source, big development community, clear plain documentation, runs in client side.