Parser level functions

As mentioned, TADS 3’s parser is written in TADS. I’ll also point out it’s not a theoretical, as there are two parsers (and two world libraries) available for it. Plus, the language allows for the game author to patch the parser and library code without touching their source files.

I would frame this as a data-driven model versus a code-driven model.

It’s true, you could model a world with a table of objects and properties. Numerous languages or runtimes could parse that data and present it to the user as a navigable IF world.

You see this in TADS source code sometimes (this is off the top of my head, don’t run this through a compiler):

doomHallway: Room 
  roomTitle = 'Hallway of Peace and Goodwill'
  desc = 'You are standing in a long hallway.  Stainless-steel blades point out from the walls and ceiling.'
  north = carvingStation
  south = buffetTable
;

That’s all data defining the room itself. The world library does the heavy-lifting for common needs and use-cases, which is what a good library should do.

But for me, the specialness of parser-based IF comes from the customization of actions. If you want to have an Enchanter-style magic system, or a Spider and Web tool belt, that requires customized code for actions, responses, updates to the world model, and so on.

Even if the need is something simple (pressing the doorbell teleports the player to another location), that will probably require specialized code. The most comprehensive world library can’t anticipate every need.

The parser needs to understand the world model, so it’s not merely manipulating a table of words. PUSH RED BUTTON needs to push a world object named “red button.” That right there introduces concepts like naming, scope (“What objects are available to the player at this moment?”) and visibility (“Is the red button visible, e.g., not within a closed box or behind a sliding panel?”)

Modern parsers also handle quality-of-life issues, such as disambiguation (“Should PUSH RED push the red elevator button, or the red hat?”), pronouns, conjunctions (TAKE BOOK AND READ IT), the mighty ALL pseudo-object, and more. It’s hairy stuff.

3 Likes

I feel like the big divide is between the OOP approach (where methods are tightly coupled to objects and the rule system approach where rules are loosely coupled to objects. Maybe we’re saying the same thing though.

Has anyone created a list of the rules based systems out there? Inform and Dialog are two that I know about, but there are probably others?