A machine that arrives as a value can still be commanded (#58)
State machines: State branch gains else and always continues somewhere, Set state by name resolves id first then name and has a way out called not found. The paragraph about ports being read off the graph now names the way around it and its price. Behaviors, Home: node lists. Development: 932 checks.
1 parent
f05d610b86
commit
eacf87e582
4 files changed
+22
-9
No files matched your search
+1
-1
@@ -97,7 +97,7 @@ shown on the node and editable in the inspector.
|
||||
deliberately not used: its delay and rate are an operating-system setting, not a game's. Both
|
||||
rows stay off the node body while the delay is 0, so a plain key node keeps its single line.
|
||||
- **Node set** (`src/core/graph/nodes/`, one file per node): events `On start`, `On enable`, `On update`, `On disable`, `On destroy` (see *Lifecycle*), `On key down/up/held`,
|
||||
`On timer`, `On collision enter/stay/exit`, `On click` (the mouse pressed on the owner — anywhere when it has none), `On animation finished`, `On state entered`, `On state exited` (one output per state, see *State machines*), `Start` · flow `Branch`, `Sequence`, `Repeat`, `Run behavior`, `End`, and the three that move or follow a state machine, `State branch`, `Set state`, `State transition` (see *State machines*) · data `Self`, `Owner`, `Parent`, `Object by name`, `Name of`,
|
||||
`On timer`, `On collision enter/stay/exit`, `On click` (the mouse pressed on the owner — anywhere when it has none), `On animation finished`, `On state entered`, `On state exited` (one output per state, see *State machines*), `Start` · flow `Branch`, `Sequence`, `Repeat`, `Run behavior`, `End`, and the four that move or follow a state machine, `State branch`, `Set state`, `Set state by name`, `State transition` (see *State machines*) · data `Self`, `Owner`, `Parent`, `Object by name`, `Name of`,
|
||||
`Is asset` (is this object an instance of asset X — how you tell what you collided with),
|
||||
`Variables`, `Properties` (every property row of the target's type, the transform rows `scale`, `rotation`, `mirrorX`, `mirrorY` included — how a graph turns a sprite), `Get position` (local and world), `Is enabled`, literals `Number`/`Text`/`Boolean`/`Texture`/`State machine`/`Sound`/`Scene`, `Add/Subtract/Multiply/Divide`,
|
||||
`Min/Max/Abs/Sqrt/Clamp`, `Floor/Ceil/Round`, `Modulo`, `Random`, `Time`, `To text`, `To number`, `Join text`,
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ npm run check # typecheck + lint + format:check + tests, the gate CI runs
|
||||
# code is lost (tail's is reported), so a red run reads as green
|
||||
npm run build # writes dist/ and regenerates index.html
|
||||
./build.sh # the same under `set -o pipefail`, for callers that pipe the output
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 930 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 932 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 — a subset while working on one step
|
||||
./e2e.sh start [GM_STEPS] # the same run detached, see below
|
||||
./e2e.sh status # live progress, or the last run's result
|
||||
@@ -232,4 +232,4 @@ widths to find click points. The **render device is not in this repo** — `/dev
|
||||
and a 1 GB `/dev/shm` come from `container.options` in the runner's own `config.yaml`, which
|
||||
applies to every job on that runner. Without them chromium falls back to llvmpipe, which gets
|
||||
WebGL 1.0 only. Measured in the job container: `ANGLE (Intel, Vulkan 1.3.230, HD Graphics 630)`,
|
||||
WebGL 2.0, and the same 930 checks as here.
|
||||
WebGL 2.0, and the same 932 checks as here.
|
||||
+1
-1
@@ -18,7 +18,7 @@ Live: <https://nockal.com/game-maker/> · Widget playground: <https://nockal.com
|
||||
| [Fonts](Fonts) | Uploading a typeface, what a text wears, what the editor falls back to |
|
||||
| [Sounds](Sounds) | Uploading a sound, what the asset says, `Play sound` and `Stop sound`, what a pause and a stop do to a voice |
|
||||
| [Animations](Animations) | Animation assets, the Animation tab, how they run |
|
||||
| [State machines](State-machines) | The state machine asset, its scope, named transitions, the start state, `State branch`, `Set state`, `State transition`, the two state events and the live highlight |
|
||||
| [State machines](State-machines) | The state machine asset, its scope, named transitions, the start state, `State branch` and its `else`, `Set state`, `Set state by name`, `State transition`, the two state events and the live highlight |
|
||||
| [Shaders](Shaders) | The shader asset, the Shader tab, the node set, the Adjust colors recipe, wearing a shader |
|
||||
| [Particles](Particles) | The particles asset, a particle as a formula of its age, the source's rows, the Particles tab |
|
||||
| [Containers](Containers) | Editing a template, instances and their edits, screens without scene switching |
|
||||
|
||||
+18
-5
@@ -42,17 +42,26 @@ when they do). That is the point of naming them — a single `State transition`
|
||||
A transition does **not** restrict `Set state`: that node still puts the machine into any state it
|
||||
is wired to. What the arrows are for at runtime is `State transition`.
|
||||
|
||||
**A behavior reads it through three nodes**, each with a `machine` input that is a picker while
|
||||
**A behavior reads it through four nodes**, each with a `machine` input that is a picker while
|
||||
unconnected (or takes a `State machine` node, the literal every kind has):
|
||||
|
||||
- **`State branch`** grows **one exec output per state**, named after the state, and continues
|
||||
along the one the machine is in. Without a start state, and before `Set state` has run, the
|
||||
machine is in **no state** and the flow ends there. A state the machine no longer has (deleted,
|
||||
or of another machine) ends it too — the run ignores a ghost port, whatever the canvas draws.
|
||||
along the one the machine is in. Below them sits **`else`**, and it carries everything the states
|
||||
do not: no start state and no `Set state` yet, a state the machine no longer has (deleted, or of
|
||||
another machine), or a machine that arrived as a value and therefore has no state outputs at all.
|
||||
A flow that enters this node always leaves it somewhere — a branch nobody can see taken is the
|
||||
hardest kind to debug. `else` is derived like the states rather than fixed, so it sits *under*
|
||||
them, the way the way out of a `Branch` sits under what it is an exception to.
|
||||
- **`Set state`** is the mirror image: **one exec input per state**, one exec output. The input the
|
||||
flow *arrives through* names the new state — so `OnStart → Set state (Open)` and `On key down →
|
||||
Set state (Closed)` are two edges into one node. The interpreter hands every node the exec input
|
||||
a pulse entered through (`run(…, entry)`); this is the first node to read it.
|
||||
- **`Set state by name`** does the same job with a **text** instead of a port, for the machine that
|
||||
arrives as a value and has no ports to offer. It resolves the text as a **state id first, then as
|
||||
a name**; a name **two** states share resolves to nothing, the same rule `State transition`
|
||||
follows for two arrows of one name, and for the same reason. Missing the target is not silence:
|
||||
the node has a second exec output **`not found`** that carries the flow on, so a typo, a deleted
|
||||
state or an empty machine can be logged or answered with a default instead of stopping there.
|
||||
- **`State transition`** takes the transition of a chosen **name** out of the current state, then
|
||||
continues. The name is picked in the inspector from the transitions of the machine on its
|
||||
`machine` input — the options depend on another field, which no field kind can express, so that
|
||||
@@ -69,7 +78,11 @@ warning colour, and *Disconnect* on its right-click menu removes it. Put the sta
|
||||
edge works again. Which machine the
|
||||
ports belong to is read off the graph, not off a running value — the inline pick, or a
|
||||
`State machine` literal wired in; a variable or an `Item at` feeding the input yields no state
|
||||
ports, exactly as `Run behavior` knows its behavior only as a setting. Picking another machine
|
||||
ports, exactly as `Run behavior` knows its behavior only as a setting. That machine is still not
|
||||
stuck: `Set state by name` names the state as text, `State branch` leaves along `else`, and
|
||||
`Current state` answers as always. The price is spelled out, not hidden — a name is typed, so a
|
||||
typo is possible where a port made it impossible, which is what `not found` is there for.
|
||||
Picking another machine
|
||||
orphans the edges of the old states, the way any setting that decides a node's ports does.
|
||||
|
||||
Two more read it as **data** rather than as a flow, both pure readers (no exec ports, answered
|
||||
|
||||
Reference in new issue
Block a user