What is a "parser" game?

Based on the subtle fracas in this thread, I wanted to open up the floor for some clear-headed discussion regarding what a parser is, and what it is not. I myself am not a programmer so my observations and conclusions may not be correct.

Please note this is not solicitation for the “What is IF?” argument, nor is it really constructive to bash AI in yet another thread. I am curious if it would be constructive to define a clear distinction between “Parser IF” and what I tentatively will refer to as “AI-Assisted IF”.

I think AI is fascinating, and I having been an old-school parser player and creator, I also understand the AI pratfalls, and agree that it shouldn’t be used as a “cheat” for actually writing a good IF.

In my brain, parser and AI accomplish a bit of the same thing at different levels.

A parser maintains a world model, and responds to player commands based on the world model using authored prose and occasional mechanical responses that are programmed: “I don’t see a mailbox here.” “It’s too dark to read the leaflet.” “The door is locked, you’ll need a key to open it.” This is mainly limited to rules and the parser isn’t going to understand certain commands that aren’t implemented in the rules. Unless the author has accounted for extremely deep action implementation, a parser is rarely going to have a cogent response to >PLACE MY EAR AGAINST THE DOOR AND LISTEN FOR HOBGOBLINS - at best, you might get >LISTEN TO DOOR to work. Most experienced parser players understand this and have learned through experience how to simply phrase commands. This is the usual stumbling-block for new parser players - sure you can type “anything” but the best commands are verb-noun [with/on second noun].

An AI on the surface seems like a great improvement to a text adventure. It can literally improvise responses and dialogue to practically any player command and fulfills the “you can type anything” promise of early parser IF. It is practically a tireless Dungeon Master. An AI is trained on a dataset (which may be the entire internet!) and brings out-of-gameworld knowledge. I was impressed by an AI implementation of Zork where I typed >PARKOUR THROUGH WINDOW and the game responded by having me climb through the window. Most games will not have “parkour” defined as a some synonym for “move” and this wouldn’t be considered a failure of implementation and action synonyms outside of a game that is about parkour. The AI was able to go “off board” and understand that “parkour” is a form of locomotion and I probably meant I wanted to >GO THROUGH WINDOW or >ENTER WINDOW and re-phrased my command into something the parser could understand and act upon.

This type of interaction and comprehension is something that could definitely raise the barrier for new text adventure players. An AI can be far more responsive to unexpected commands based on outside knowledge. If I type >SCUFF CARPET in a game where there is no “carpet” object in the world, an AI can interpret this as basically a parser error, but disguise it by improvising, “You drag your toe leaving a subtle mark in the carpet pile, but that doesn’t seem to accomplish anything here.” which is much more friendly than an “I don’t understand what you mean by ‘carpet’.” response to player. It could also be confusing if the room description described a concrete floor or floorboards, or the player is swimming in the ocean where there obviously is no carpet but that’s a stylistic nitpick. Ideally the AI would understand if the player is swimming in the ocean that the existence of carpet is unlikely. “You could probably do that if you were in a furnished room with carpet, but you probably would be better off not letting your mind wander since there are sharks around…” or something like that.

I am all for AI improving the performance of a “parser”. The place where it gets dicey is when the AI is allowed to improvise or make up significant world-detail as co-author so as not to break the illusion for the player. If I’m playing a game where the PC is stranded on a desert island, and I say >TALK TO WOMAN it is less than ideal for an AI implementation to improvise, “You nod to a pedestrian pushing a baby carriage politely, and she acknowledges with another nod, continuing on her way.” That breaks mimesis[1] in all but the most intentionally absurd game-worlds.

A peripheral but related issue is AI can be used to generate volumes of text. It’s more than happy to write the prose that can be used in any game. Whether that prose is valid, artistic, or legitimate is subject to debate, but many people agree that it can be considered a “cheat” or even plagiarism on the order of using an uncredited ghost-writer to create a story and claim it as an author’s work - and another subject for debate whether an AI author even qualifies to be awarded a prize in a competition.

I’m in the middle. I think AI has great potential to bridge the gap between player and parser interpretation to make a text adventure easier to play.

I am less keen on using an AI to generate all the player-facing text in an adventure created in Inform or TADS or any other actual parser-authoring design system. I would still call that a “parser work,” just one where the author didn’t do the writing. I also am not comfortable with the AI varying and re-generating descriptions on the fly. While text-variation is a subtle art of IF implementation, having an AI improvise ten different descriptions in response to >EXAMINE LANTERN means the author didn’t write the game. The author said “give a spooky description of a lantern here” and didn’t do the writing work.

What I think we need is a definition and separate category for “AI Assisted Adventure.” While it’s obvious from the referenced thread that “thousands of people” enjoy this type of game and wouldn’t touch an old-school text adventure, it’s completely different from an authored parser game that can only describe the world as the author wrote it without an AI as a DM or GameMaster.

I would suggest the simplest demarcation would be that a “parser game” is self-contained. It may do tricky things or include AI-like routines in it, but it’s using the parser and author implementation only to communicate with the player. If a game has to “ping out” to a separate AI to consult about game content to devise a response, it’s not technically a parser game; it’s the new category of “AI-assisted Adventure” - or whatever better name we might come up with to set expectations with players.

I could be wrong, and I’m definitely interested in other people’s opinions about the difference.


  1. The representation or imitation of the real world in art and literature. ↩︎

8 Likes

“Parser” game is really a bit of a misnomer, since the world model is as much a part of this type of game as the parser. And what we see with some of these “limited parser” games is that even with only two or three verbs, they feel more like “parser games” than like choice-based games or whatever. The parser itself is only a portion of what makes this style of game distinctive, and maybe more for its secondary attributes, like requiring the player to intuit affordances, than for the fact that input is via sentences in natural language per se.

8 Likes

[8-year old me playing Infocom parser games and wanting to create them - worldview shattered.]

So if everything we think is wrong, how do we demarcate this ‘new’ style adventure versus one programmed with radio tubes and punch cards instead of AI?

2 Likes

I don’t think this is a useful way to draw the distinction. The earliest parser games, after all, were played on mainframes, so the player’s terminal had to “ping out” to a separate device for every input! And nowadays, some LLMs are small enough to run on your local machine.

Instead, I would say a classic parser game tends to be defined by two things:

  • Free-form text input: there are a (usually) finite number of possible inputs that will produce a meaningful response, but the possibility space of these inputs is not spelled out explicitly, and part of the gameplay is figuring out what inputs will be useful
  • A world model with consistent rules: rather than each interaction being implemented in a bespoke way, there’s an underlying system that the player can learn to manipulate, and this learning is also part of the gameplay

Now, these aren’t hard-and-fast rules. Some of the early parser games had MUD-style bespoke responses to individual commands, for example, like the whole Wander system. And I would argue that Familiar Problems is a parser game despite spelling out the possibility space of inputs explicitly. But these two things are the cornerstones of the genre, and the farther you get from them, the less like a parser game the result will be.

And the second point, the consistent world model, is what AI experiments tend to lack. Future experiments might get better about that; the field is still in its infancy! But right now, one of the big problems with LLMs as a whole is their lack of a consistent knowledge store to back up the text they produce.

7 Likes

congratulations!

I think a “parser” kind of exists as a thing that that deals with specific inputs to create feedback. In this sense, it is exactly like super mario brothers. The difference is that SMB does not have buttons that don’t do anything, while a keyboard is mostly buttons that don’t do anything.

So I think a core experience for this is learning those inputs, experimenting with them, subverting them, and so forth. This is a skill that can travel across any parser game. The AI input system–I don’t think it’s a parser in the sense that I understand–is different. Staying clear of whether it’s any good or not–I haven’t seen a good example yet, but I think one might come eventually–the natural language stuff probably doesn’t travel as well between games. Parser input is a specialized dialog, and natural language input really isn’t.

So it isn’t the same, and it really can’t capture what interests me about parser games, but I’m just focusing on qualities here rather than debating perceived merits.

8 Likes

Well, I wouldn’t go that far. “Parser game” is just a phrase that might encourage hyperfocusing on just one aspect of the style. Just like “point and click game” wouldn’t sum up graphical adventures.

Whether or not a “parser game” uses a “parser” is an implementation detail, not intrinsic to the game nor terribly illuminating. Many of Art DiBianca’s games could be implemented more simply by not involving a parser and just modeling the whole thing as a state diagram. So having a parser is in fact not what we mean when we talk about “parser games”. What do we mean? I’m not sure. But I don’t think we can easily rule out AI-assisted “parsing” (without text generation) from the technologies permissible for “parser games”.

1 Like

It’s this that’s the crux, isn’t it?

If you could start with a consistent set of implemented human-authored commands, and the only thing an LLM is doing is deciding whether a specific given input was intended to be one of those commands or not, and if not, then choosing the most appropriate from a human curated pre-authored list of errors, you might, I stress might, have something both useful and also arguably human authored.

You’d basically be retaining the ability to understand synonyms and intent far beyond what a human author could anticipate, while not sacrificing the intention and reproducibility of a traditional parser.

Basically tying ChatGPT to a chair, duct-taping their mouth shut, and then asking them questions, but they can only answer by blinking the number of times matching the numbered list of responses on the wall in front of them.

The thing is, I suspect that, currently, an LLM can’t have the discipline required to do this by design. Just their recency bias alone makes this extremely difficult.

I don’t have faith we can get them to consistently follow instructions, or even shut the fuck up, frankly.

Could we get there? Probably. As for now, we have a substitute Dungeon Master who is winging everything and gives zero care for the module the original DM painstakingly prepared and tailored for the players sitting around that table, using it, at best, as a set of starting conditions.

6 Likes

It feels like many people use the term “parser game” to describe something with a consistent and user-manipulatable world model. The existence of rooms you can “be” in, objects you can examine and move, and rules that govern what is and is not possible.

The parser is just an element that turns user input into actions taken against the world model. The fact that it has historically been in the form of some verb/noun text input isn’t essential to the world model. It could just as easily be a set of buttons, a contextual action bar (like many Zelda games), or even a VR interface. As long as it can turn player intent into valid actions.

In that sense, a game that uses an LLM to translate user input into defined actions isn’t any different from any other world-model game with a parser. The LLM is just a different kind of parser. And unless it is part of the point of a “parser game” to have to guess at valid phrases for the parser to recognise, the fact that your parser is now “better” at turning input into actions seems to me to be a good thing. If the authors of the Infocom games had LLMs available to do their command parsers I feel pretty sure they would have used them.

Having an LLM write the responses to the actions taken feels like an entirely different matter. I think distinguishing between AI assisted input and AI assisted output would be valuable.

If I played a game and the response to “jump through the window”, “climb through the window” and “parkour through the window” were all the same (and written by the author as a response to climb) then I’d be perfectly happy with that.

8 Likes

Any decent parser would object on the grounds that “parkour” is not a verb.

Wiktionary and the Cambridge Dictionary both disagree :smiley:

4 Likes

I don’t think it is useful to talk about “parser game” vs AI game, since, as others have pointed out, AI can be extremely efficient it “parsing” player intent based on the text the player write - and then use plain old logic to calculate the answer.

It is the creativity of the response that matters. Does the AI create the response, rooted very firmly in the current game world state - or does the game respond with a precooked text?

I think there will be two different categories, each having their own set of values. One will value the human work and labor that have gone into crafting some wonderful literature, but also very hard coded prose - and one that values the creative random answer a well guided AI can produce.

From a literature point of view, proficient humans will do better, but AI will be more varied - and also loose some of the “soul” you find in some of the well written games.

1 Like

Judging by the experiments I’ve seen so far in this area, nobody has been able to make an existing LLM match input to human-authored commands in this way, let alone create a new one that improves on the Infocom parser.

ChatGPT and its ilk are obviously not intended or trained to do anything of this kind. Apparently Spirit AI tried to do something similar, but not quite like this.

Does anyone know of any current projects that seem promising?

4 Likes

Can’t answer completely on that, but I have played with it. I think, based on the threads you refer to, that people miss the ability of LLM’s to generate structured parsable JSON output.

You can task an LLM like this:

You are an intent parser for a computer game. You must match the players input against a selected list of commands and their parameters given the following information:

Objects here: (list of objects)

Exits here: (list of exists)

Match players input “jump out of window” with these commands:

  • “west”: move through window to the west
  • Take {object}: take one of the objects

Outout JSON like this:

{

command: “users intended command”,

exit: “some exit”,

object: “some object”

}

It works, I have a running example, but I don’t know how confused it will get with a huge list of commands, exits and objects.

I think one point of confusion (and perhaps a source of scare quotes) is the idea that “parser” is good and, if you don’t use that magic word, you’re putting something down.

Terms arise from convention as much as they do dictionaries, and I think saying hypothetical frob is an actual fram is kind of a distracting debate.

Yes, we have systems in which authors define verbs such as parkour. Would it be cool if a new and different system could do that for the author? Maybe! I think it will depend as it always does on whether a convincing demonstration can be made.

I personally wouldn’t be bothered by the existence of such an input technology, were its environmental impacts trivial. I doubt many people would. But it’s hard say how it would pan out, mechanically. Nobody knows what it would be like to play such a thing in practice, since a lot of what we recognize in text adventure games involves limitation.

4 Likes

A parser game takes text input from the player, updates a world model, and generates text output that reflects the world model. The output is deterministic. (Yes, randomness can be part of the game, the output is deterministic for a given seed of the random number generator.)

For an AI to be successful as a parser game, it must update a world model and respond in a consistent and deterministic manner. I don’t know to what extent current AIs are able to meet these criteria. Things seem to be changing rapidly and it’s hard to keep up. Certainly the examples I’ve seen in the past don’t seem to do this. At best they seem to be a game of exquisite corpse between player and chatbot.

2 Likes

If you split parsing from update and response then I will argue that AI can do well in the parsing - and then leave the update and response to the plain old logic machinery. See my post about JSON above.

I would be surprised if this turns out to be reliable and consistent enough to be considered an improvement on the Infocom parser. I think “AI personal assistants” like Siri are closer, as they seem to be able to match (voice) input onto a pre-made set of actions with reasonable consistency.

1 Like

:open_mouth:

So whether or not “mushroom soup” uses “mushrooms” is an ingredient detail and not intrinsic to the dish nor terribly illuminating?

This gets into the “words don’t really mean stuff” thing that I don’t understand.

3 Likes

LLMs can too, if you just give them the pre-made set of actions, objects and locations. But I don’t think anyone has done the serious work needed to make that happen.