Glossary
The terms you’ll meet in v2’s code and in these pages, in alphabetical order. Names in code are the ones the code uses.
A–C
Action. A class in src/actions/ that implements one kind of statement: it says whether it takes a statement (matchString(), matchObject()) and what running and reverting it does. Base class: src/lib/Action.ts. See Architecture.
Action id. An action’s static id, such as 'Dialog' or 'Show::Character'. monogatari.action(id) finds the class by it, ignoring case.
Adapter. The storage backend a game’s saves and preferences go to, chosen by the Storage.Adapter setting: LocalStorage (the engine’s default), SessionStorage, IndexedDB (the starter game’s), RemoteStorage or FileSystem. See Architecture.
Application cycle. What happens when a statement runs: willApply(), apply(), didApply(). didApply() returns { advance }, which says whether the next statement runs at once.
Artemis. @aegis-framework/artemis 0.6, the library behind $_() (DOM queries), Space (storage), Debug (the console with levels), Platform and Util. The engine re-exports it.
Asset. A media file a game declares by name with monogatari.assets(type, { name: file }). The AssetsPath setting says which folder each type lives in, under assets/.
Auto-play. The mode in which the game advances on its own after each line, toggled by the quick menu’s AutoPlay button (data-action="auto-play"). It calls proceed() with autoPlay: true from a timer in src/engine/ui.ts.
AutoSave. The setting that saves the game every so many minutes into AutoSave_<n> slots, rotating through Slots of them. 0 turns it off.
blocking. An action’s static flag that its own shouldProceed() checks to hold the game (Conditional, Video), replacing the deprecated block global.
block. A deprecated global that stops proceed() and rollback() while it’s true. See Design Decisions and Why.
Bridge. The window.electron or window.electrobun object a desktop host gives the page, with send() and on(). See The Starter Game and Desktop Hosts.
Character. A speaker declared with monogatari.characters(): a name, a color, sprites, expressions, and optionally layers and nvl. See Characters.
Component. A custom element defined by a class in src/components/, such as <text-box> or <save-screen>, built on Pandora. Base class: src/lib/Component.ts. See Architecture.
Configuration. Data some components render from, held by monogatari.configuration(): the main menu’s and quick menu’s buttons, the credits.
D–F
Debug level. How much monogatari.debug prints, from 0 (nothing) to 5 (everything). Error dialogs need a level above 0. See Debugging the Engine.
Debug module. debug/index.js, built to dist/engine/debug/debug.js: it turns error dialogs on and holds their text. Released games leave it out.
didApply(), didRevert(). The last step of running and reverting a statement. didApply() is where an action records itself in state and history; both return whether the engine continues at once.
dist/. The starter game, and where the build writes the browser bundle, the debug module and the declarations. See Repository Layout.
Distraction-free mode. The mode that hides the text box so the player can look at the scene (H, or the quick menu’s Hide button). proceed() refuses to move the game while it’s on.
_engine_block. The global proceed() and rollback() set while a statement chain or a revert chain runs, so a second click is refused until it’s done.
Event. A CustomEvent the engine fires on the <visual-novel> element: willRunAction, didRunAction, willUpdateState, didLoadGame… monogatari.on(name, callback) listens. See Events.
Experimental. An action or component with _experimental = true (Show::Character::Layer, Hide::Character::Layer), left out of actions() unless the ExperimentalFeatures setting is on. Cypress turns it on.
FancyError. The class that shows the error dialogs, src/lib/FancyError.ts. Each dialog has an id such as action:jump:label_not_found. See Diagnosing Errors.
G–L
Game screen. <game-screen>, the screen the story plays on; its click listener calls proceed().
Global. A runtime value in monogatari.global(key): flags such as playing, finished_typing, _engine_block. Globals are never saved or reverted.
History. Per-action lists in monogatari.history(key) (image, character, jump, nvl…) recording what each action showed, so revert() can undo it. Saved with the game.
Interpolation. Replacing {{name}} in a string statement with the value of storage().name, and _(key) with a translation string, in replaceVariables() before the statement is matched.
Kayros. A CSS framework the engine keeps a local copy of in src/style/kayros.css. See Design Decisions and Why.
Label. A named list of statements in the script ('Start'). state.label is the current one, monogatari.label() returns its statements. See Script and Labels.
Listener. A named handler registered with monogatari.registerListener(name, { keys, callback }), run when an element with data-action="<name>" is clicked or its keys are pressed.
loadingOrder. An action’s static number that orders the onLoad() calls after a game is loaded, lowest first (Scene is -2). Before 2.9.0 the numbers were sorted as text: see Reviewing a Change.
Localize. Filling every element that has a data-string attribute with the interface string of that key in the player’s language, done by localize() at boot and when the language changes.
M–P
Matching. Finding the action that takes a statement: matchString(words) for a string, split on spaces, matchObject(statement) for an object, asked of every action in order. prepareAction() does it.
Migration. A function in src/migrations/ that updates a save’s data from an older shape when it’s loaded.
Mounting cycle. What every action and component does once at boot: setup(), bind(), init().
NVL. The mode in which lines pile up in a full-screen text box instead of replacing each other, used by characters declared with nvl: true and by lines that start with nvl.
Pandora. @aegis-framework/pandora 0.5, the library the components are built on (Component, Registry, props and state, render()).
Placeholder. A statement saved under a name with monogatari.$(name, statement) and run with '$ name'. See Placeholder.
Preferences. The player’s choices (language, volumes, text speed, auto-play speed, resolution) in monogatari.preferences(), stored under Settings in the game’s storage.
Proceed. Moving the game forward one step: proceed() checks every action and component, then calls next().
R–S
Registry. Pandora’s list of custom elements. The engine registers every component in it during setup().
Reset. What the game does when it ends or before a load: resetGame() calls every action’s reset() and component’s onReset(), empties the history and puts storage back to its shape at boot.
Revert, reverting cycle. Undoing one statement: willRevert(), revert(), didRevert(). See Architecture.
Rollback. Going back in the game (the quick menu’s Back button, the left arrow), done by reverting statements one by one. The AllowRollback setting turns it off.
Save slot. One saved game, stored under Save_<n> (or AutoSave_<n>) as { name, date, image, game: { history, state, storage } }, and its <save-slot> on the save and load screens. See Saving and Loading.
Screen. A component that is opened and closed as a whole (<main-screen>, <load-screen>…), built on ScreenComponent. monogatari.showScreen(name) opens one.
Script. All of a game’s labels, set with monogatari.script(); with MultiLanguage, one set of labels per language.
Service worker. dist/service-worker.js, which caches the game for offline play when it’s served. See The Starter Game and Desktop Hosts.
Settings. The game’s configuration in monogatari.settings(), set in js/options.js. See Configuration.
Skip. The mode that advances quickly through the script (S), available when the Skip setting is above 0, its speed in milliseconds.
Spec. A Cypress test file in cypress/e2e/. See Testing the Engine.
Starter game. The sample game people download, dist/ zipped flat. See The Starter Game and Desktop Hosts.
State. monogatari.state(): the current label and step and what each action shows now (scene, characters, images, music…). Saved with the game, and what a load rebuilds the screen from.
Statement. One item of a label: a string, an object or a function. See Script and Labels.
Step. state.step, the index of the current statement in the current label.
Storage. Two things: monogatari.storage(), the game’s own variables, saved with the game; and monogatari.Storage, the Artemis Space that writes saves and preferences to the chosen adapter. See Variables and Storage.
T–Z
Translation. The interface’s strings in one language, a file in src/translations/, registered under the language’s own name. See Contributing Translations.
Type-writer. <type-writer>, the component that types out a line character by character and handles the text markers and effects. The TypeAnimation settings turn it on and off.
upgrade(). monogatari.upgrade(oldVersion, newVersion, { storage }), which registers a function that converts a game’s stored data when the game’s Version setting changes. Called before init().
VisualNovelEngine. The TypeScript interface of the engine object, in src/lib/types/Monogatari.ts, published in dist/types/.