Text parser
Encyclopedia
In an adventure game
, a text parser takes typed input (a command) from the player and simplifies it to something the game can understand. Usually, words with the same meaning are turned into the same word (e.g. "take" and "get") and certain filler words are dropped (e.g. articles, or the "at" in "look at rock").
The parser makes it easier for the game's author to react on input. The author does not have to write special code to process the commands "get the gem", "take the gem", "get gem", "take gem", "take the precious gem", etc separately, as the parser will have stripped the input down to something like "take gem".
For the player, the game is more flexible, as the game has a larger vocabulary, and there are fewer guess-the-verb
and guess-the-noun problems.
Parsers are used in early interactive fiction
games like the Zork
series, and more recently in games created by systems like Inform
and TADS
.
Adventure game
An adventure game is a video game in which the player assumes the role of protagonist in an interactive story driven by exploration and puzzle-solving instead of physical challenge. The genre's focus on story allows it to draw heavily from other narrative-based media such as literature and film,...
, a text parser takes typed input (a command) from the player and simplifies it to something the game can understand. Usually, words with the same meaning are turned into the same word (e.g. "take" and "get") and certain filler words are dropped (e.g. articles, or the "at" in "look at rock").
The parser makes it easier for the game's author to react on input. The author does not have to write special code to process the commands "get the gem", "take the gem", "get gem", "take gem", "take the precious gem", etc separately, as the parser will have stripped the input down to something like "take gem".
For the player, the game is more flexible, as the game has a larger vocabulary, and there are fewer guess-the-verb
Guess-the-verb
Syntax guessing, also known as guess-the-verb, guess-the-noun and the syntax quest, is a problem sometimes encountered in text-based video games, such as interactive fiction games and MUDs...
and guess-the-noun problems.
Parsers are used in early interactive fiction
Interactive fiction
Interactive fiction, often abbreviated IF, describes software simulating environments in which players use text commands to control characters and influence the environment. Works in this form can be understood as literary narratives and as video games. In common usage, the term refers to text...
games like the Zork
Zork
Zork was one of the first interactive fiction computer games and an early descendant of Colossal Cave Adventure. The first version of Zork was written in 1977–1979 on a DEC PDP-10 computer by Tim Anderson, Marc Blank, Bruce Daniels, and Dave Lebling, and implemented in the MDL programming language...
series, and more recently in games created by systems like Inform
Inform
Over the following decade, version 6 became reasonably stable and a popular language for writing interactive fiction. In 2006, Nelson released Inform 7 , a completely new language based on principles of natural language and a new set of tools based around a book-publishing metaphor.- Z-Machine and...
and TADS
TADS
Text Adventure Development System is a prototype-based domain-specific programming language and set of standard libraries for creating interactive fiction games.-History:...
.
External links
- Inform Designers Manual (in particular, see chapter 4, "Describing and Parsing", and chapter 5, "Natural Language")