Glossary

"When I use a word, it means just what I choose it to mean — neither more nor less."
- Humpty Dumpty

A number of terms are used with very specific meanings in JIFFEE's documentation. This glossary explains those meanings.

action

An action is anything that can be performed. Actions are typically supplied as the part of a rule that specifies what should happen under specific conditions. They are also often used as the values of traits like "long-desc" or "north". The JIFFEE standard library defines the following action types by default:

Type of action What it means
a string of the form "MOVE thing TO place",
where "thing" can be omitted
and "place" can be "HERE"
Change the location of "thing" to "place".
any other stringDisplay the string on the screen.
a JavaScript free functionCall the function,
passing the current event as the single argument.
a JavaScript Array,
i.e. a list
Interpret each list element as an action,
and perform them in order.

Advanced JIFFEE authors are allowed to define and use additional types of actions if they wish to.

Being able to use an arbitrary JavaScript function as an action is the critical feature that allows the full power of the JavaScript language to be used as part of any game written with JIFFEE.

author

An author is a human being who creates a game using JIFFEE (cf. player).

author language

The directives used by an author to direct the logic and progress of a game are written in the game's author language. This does not change when the game is translated. In the most common case both the author language and the player language are English so you can ignore the distinction, but if and when you ever decide to internationalize and translate a JIFFEE game, the process will be much easier to understand if you keep the author-vs-player distinction in mind. (cf. player language.)

command

A command is what the player types in the player language to say what he or she wishes to do next in the game. A command is always a JavaScript string. (cf. directive.)

directive

A directive is a type of event that encodes the intent of a command. While commands may use many synonyms that all have the same meaning, directives are defined to have a single unique form because the logic of the game is controlled by them. A directive is always a JavaScript object, and the values of its properties are expressed in the game's author language. (cf. command.)

The translation of commands into directives is what allows a JIFFEE game to be translated into other player languages without having to make any changes to the game's logic.

event

Whenever anything potentially interesting happens in a JIFFEE game, an event is created and populated with a description of what happened. For example, when the player types a command or when an instruction changes the value of a trait, that triggers the creation of an event. These events are simply JavaScript objects with certain well-known properties.

Two types of events are predefined by JIFFEE's standard library:

eventTypeWhat triggers the event
directive The player typed a command,
which has been translated into the
author language.
changeThe value of a trait changed.

Advanced JIFFEE authors are allowed to define additional event types if they wish to.

execute

All JIFFEE code is actually written in JavaScript, so it must be executed by the JavaScript virtual machine. (cf. instruction).

instruction

The lines or expressions of JavaScript code are called instructions. (cf. execute.)

language

There are two natural (i.e. human) languages involved in any JIFFEE game: the first one spoken, read, and written by the player, and the second one spoken, read, and written by the author. These are often the same (e.g. English), but they will be different if the game has been translated into another language. You can keep the two straight by remembering that the player language is used for commands, and the author language is used for directives and for strings passed to the Display.show() function.

noun

The visible part of the game world created by the game's author consists largely of nouns. To conform to common English usage, each noun is usually a person, place, or thing. Here is the hierarchy of nouns in JIFFEE:

noun person
(not yet implemented)
place
thing prop
scenery

object

As used with JIFFEE, object has its standard JavaScript meaning (cf. thing).

override

Many verbs allow part or all of their default logic to be replaced when the player uses that verb in a particular place or with a particular prop. This is done using the trait whose name is the same as the verb, by setting its value to the desired action. For example, by saying traits.set("rock", "get", "The rock is too heavy to pick up."); you could make it impossible to pick up the rock. This is called an override of that verb for that prop or place. The override mechanism is not as flexible as a specialization, but it is much more concise and it conveniently and efficiently handles many common cases.

perform

When the game runs, the actions are performed. For example, when the player arrives at a new place for the first time, the value of the "long-desc" trait of the place is interpreted as an action and performed. Typically this involves displaying some output or changing the location of something, but because a JavaScript function is a legal action, performing an action can result in nearly arbitrary code execution in any case where the author wants it.

place

A place is a type of noun where the player or various things can be located. A place can be the location of something else, but it does not have a location itself.

player

The player is the human being who is playing the JIFFEE-based game (cf. author).

player language

The language of the strings displayed on the screen for the player to read, and and used by him or her to type commands, is the player language. This is always a "natural language" like English, Spanish, Chinese, or Esperanto (as opposed to a "computer language" like BASIC or JavaScript). A single game can be translated into many different player languages without any need to alter the control logic or directives. (cf. author language.)

prop

A prop is a thing that the player can typically pick up, carry, move, or manipulate. Only one instance of each prop exists, and it can be in only one place at any given time. Sometimes you may create multiple props that the player views as a single prop, for example a new light bulb and a burned-out light bulb that you move on-stage and off-stage as needed, but JIFFEE considers them to be two distinct props.

property

As used with JIFFEE, property has its standard JavaScript meaning. A property has a name and a value and belongs to an object. (cf. trait.)

rule

Rules are at the heart of JIFFEE because nearly all the interesting logic in a game is initiated by rules. A few of them are supplied by JIFFEE's standard library, but most of them written by the game's author. Each rule supplies conditions that determine which events will match this rule, a priority to help determine order-of-execution, and an action to be performed if all the rule's conditions match an event. Each time an event occurs, it is matched against all the game's rules to determine which actions should be performed.

scenery

Scenery elements are a type of thing intended to represent immutable and potentially widespread parts of a game. For example, the floor or the sky could be represented as scenery because the description is the same everywhere. These can be examined but not picked up or moved, and in particular they can be in many places at once. An element of scenery can change, but it must change everywhere at once because there is really only one of them. For example, the sky can get dark.

specialization

There are times when you want an existing verb to have special logic under special circumstances. You can do this by simply adding a rule for that verb whose action does the desired logic only under those special circumstances, and does nothing in all other cases (which allows the other existing rules to retain control). This is called a specialization for that verb. This is similar to an override — the difference is that because you specify a specialization using a rule instead of a trait, the specialization mechanism is a bit more verbose but much more flexible. For example, you could specify that picking up propA transports the player across a barrier only if the player is standing in placeB, holding propC, and has already seen a clue by examining propD.

thing

A thing is one type of noun in the game, generally either a prop or a scenery element. The name thing was chosen to fit in with the usual person-place-or-thing characterization of English nouns, as well as to avoid conflict with JavaScript objects. (cf. object.) The names for prop and scenery were chosen to leverage what people already know about stage props and stage scenery, since one way to understand Interactive Fiction is to view it as a sort of improvisational theater.

trait

Each noun is allowed to have one or more traits which describe it. Each trait has a name and a value, and more than one noun can have the same trait. For example, "height" could be a trait that many different nouns have, but each noun would have its own unique value for that trait. The name was chosen to avoid conflict with JavaScript properties. (cf. property.)

There are 4 types of traits:

Name of traitType of traitPossible values
ArbTraitarbitraryAny value of any type.
RangeTraitfixed rangeAny integer from 0 to a specified maximum.
EnumTraitenumeratedAny of a small number of predetermined values.
RefTraitreferenceThe name (in the author language) of any noun.

Those familiar with conventional programming languages will note that JIFFEE deliberately combines the conventional notions of "type" and "name" to keep things simpler. The design would have eliminated "type" altogether, but a simple form of it is needed to allow efficient encoding of the game state into a cookie.

user

This term is ambiguous, so JIFFEE documentation deliberately avoids using it. To be clear, use author or player instead.