Data Model Settings Reference
This chapter explains the stable meaning of Data model settings. The exact position of a control may change, but these choices determine the canonical definition and runtime behavior.
New Variable
The New Variable dialog can be opened from Data model or while converting or inserting content in a Page. Use as describes the intended role. It presets Value type and Scope and limits Calculated at to compatible destinations.
Use As
- Stored or displayed value creates a Variable without an automatic calculation source. It can be referenced immediately, but it remains empty or at its existing value until another source writes it.
- Starting or random value evaluates a formula once when the game starts. It defaults to a numeric, per-player Variable.
- Value calculated for this Page evaluates a formula when the Page containing the Variable is displayed. From outside a specific Page, the equivalent destination applies whenever a Page containing it is displayed.
- Result of a Stage transition writes the Variable after the current Free Form Stage completes and before the next Stage starts.
- Result of a Market trade writes the Variable after each Market transaction for a selected Player Type account.
- Periodically calculated value writes the Variable whenever a selected Market periodic transition runs. If the Market has no periodic transition, the dialog can create a one-second transition.
The list is contextual. A Stage or Market-specific purpose is useful only when the current game contains a compatible destination.
Calculated At
Calculated at identifies the exact source location:
- Display or reference only creates no formula or output assignment.
- At game start stores the entered formula as the Variable's initial calculation.
- Recalculate when this Page is displayed attaches Page-time evaluation.
- After _Stage_ adds a Variable output to that Free Form Stage.
- After every Market trade - _Player Type_ adds an output to that Player Type account's transaction outputs.
- Periodically - _interval_ seconds adds an output to the selected Market transition.
- Periodically - create a 1-second Market transition creates the transition and adds its output.
The general Data model source dialog can additionally offer Before Results for Market finalization. A Variable cannot have two sources at the same destination.
After choosing a calculated destination, Continue opens the Formula editor. Cancelling that step cancels creation. Display or reference only does not require a formula.
Other Fields
- Name is the author-facing name and must be non-empty and unique among Variables.
- Value type may be number, integer, boolean, or text. It controls formula validation and compatible controls.
- Scope is Per player or Global. A per-player Variable has a distinct value for each participant; a global Variable represents shared game state.
Purpose defaults are starting points. Value type and Scope can be changed before continuing, but the selected formula and destination must remain type-compatible.
New Choice
A Choice is a value submitted by a participant from a Page.
- Use as is Value entered by a player.
- Name must be non-empty and unique among Choices.
- Value type may be number, integer, boolean, or text.
- Minimum and Maximum are available for numeric and integer Choices and remain optional.
The Page inserts a reference to the new Choice. Runtime input validation uses its type and configured bounds.
Existing Variable Sources
The Variable inspector lists every saved source and any Page-staged source changes:
- the heading states when the source runs,
- the detail identifies its Stage, Player Type, transition, or module,
- the expression shows what is assigned,
- the pencil opens the Formula editor,
- Move changes the calculation destination,
- Trash removes that source after confirmation,
- plus adds another compatible source.
Changes made while editing a Page remain pending until Apply Page. Done closes the Variable inspector but does not apply the containing Page.
Choosing A Source
Choose the earliest lifecycle point at which the value is both available and semantically correct:
- initialize stable starting values at game start,
- use Page calculation for view-time values,
- use Stage outputs for process results,
- use transaction outputs for values that change with every trade,
- use periodic outputs for timer-driven state,
- use Market finalization for final snapshots and Results.
A Page reference does not calculate a Variable by itself unless Page calculation was explicitly selected.