Runtime values

Optional

Some rules need to name a value that changes during play: oxygen left, the current score, progress toward an objective. A runtime value gives that changing value one stable name. Its address always starts with runtime., followed by one or more parts joined by dots. A part uses letters, digits, underscores or hyphens, like a part of a tuning name.

02-mechanics.md, naming the oxygen of a diving game

The oxygen left right now is runtime.oxygen_seconds. Read it after each full second spent diving and immediately after anything restores it.

Writing the name in a numbered chapter declares the value. There is no separate list. The sentence around the name says what the value means and when it is read. After that, the name can be used in every chapter, in clocks.json, and in acceptance tests.

The name does not create, store or update the value. Your rules say how it changes. The builder, the person, team or AI that turns your package into a game, chooses how to implement it.

If the unchanged.values list of a test names a runtime value that no chapter and no clock declares, the validator (the checking tool) reports RUNTIME_UNDECLARED and tells you to declare it. The validator does not read runtime names in the other text of a test. A person checks those. The code names the exact rule. The validator cannot detect a misspelling. A misspelled name looks like a new value. Before you give the package to the builder, read your runtime names once. If two names are almost the same, correct the wrong one.

A clock can also declare a runtime value by naming it in its advances list. The Modes and clocks chapter explains that optional file.

Full rules: OpenGDD specification, §4b.

← Links · All chapters · Modes and clocks →