State machine: Startzustand #55

Closed
opened 2026-09-12 18:02:39 +02:00 by meleki · 1 comment
Owner

Entscheidung in #51: kein Startzustand – State branch führt keinen Ausgang, bis Set state gelaufen ist. Das ist bewusst so, kostet aber in jedem Behavior ein OnStart → Set state (X).

Vorschlag: Ein Zustand der Maschine kann als Start markiert werden (Rechtsklick „Als Start setzen“, Inspector-Häkchen, im Tab sichtbar z. B. durch einen Punkt/Ring). Jede Behavior-Instanz beginnt dann in diesem Zustand, sobald sie die Maschine zum ersten Mal anspricht (oder beim Start der Instanz).

Zu klären:

  • Speicherort: params.start am State-Node oder ein Feld start am Asset (nur eines darf Start sein).
  • Wechselwirkung mit „On state entered“ (#53): feuert entered für den Startzustand beim Start?
  • Ohne Markierung bleibt das heutige Verhalten (kein Zustand).

Folge-Issue zu #51 (State machine, Commit e7d82bd, 2026-09-12).

Entscheidung in #51: **kein** Startzustand – `State branch` führt keinen Ausgang, bis `Set state` gelaufen ist. Das ist bewusst so, kostet aber in jedem Behavior ein `OnStart → Set state (X)`. **Vorschlag:** Ein Zustand der Maschine kann als **Start** markiert werden (Rechtsklick „Als Start setzen“, Inspector-Häkchen, im Tab sichtbar z. B. durch einen Punkt/Ring). Jede Behavior-Instanz beginnt dann in diesem Zustand, sobald sie die Maschine zum ersten Mal anspricht (oder beim Start der Instanz). **Zu klären:** - Speicherort: `params.start` am `State`-Node oder ein Feld `start` am Asset (nur eines darf Start sein). - Wechselwirkung mit „On state entered“ (#53): feuert `entered` für den Startzustand beim Start? - Ohne Markierung bleibt das heutige Verhalten (kein Zustand). --- Folge-Issue zu #51 (State machine, Commit `e7d82bd`, 2026-09-12).
meleki added the state-machine label 2026-09-12 18:02:39 +02:00
admin added the low-priority label 2026-09-12 18:11:28 +02:00
admin added this to the Development project 2026-09-13 13:29:59 +02:00
admin removed this from the Development project 2026-09-13 13:30:59 +02:00
admin added this to the Development project 2026-09-13 13:45:43 +02:00
admin moved this to Next in Development on 2026-09-14 21:44:17 +02:00
Author
Owner

Done in 7babf88.

The start state is a field on the machine asset (start, holding a State node's id), not a setting on the node. Only one state can be the start, and a single field makes that structural instead of a rule something has to enforce after every edit. Set it with right-click on a state → Set as start state; the same entry then reads Remove start state, so it is one switch in one place. The state wears a ring on the right of its title in the tab.

A start pointing at a deleted state reads as "no start" — the dead id stays in the document and means nothing, so deleting a state needs no cleanup pass. Without a start the old behaviour stands: the machine is in no state until Set state runs, State branch ends there, Is in state is all false.

Set and remove go through a command like the scope does, so undo and the save roundtrip come for free.

The start state does fire entered — the details are in #53.

Wiki: 84df59c, State machines → Start state and events.

Done in 7babf88. The start state is a field on the machine **asset** (`start`, holding a `State` node's id), not a setting on the node. Only one state can be the start, and a single field makes that structural instead of a rule something has to enforce after every edit. Set it with right-click on a state → **Set as start state**; the same entry then reads *Remove start state*, so it is one switch in one place. The state wears a ring on the right of its title in the tab. A `start` pointing at a deleted state reads as "no start" — the dead id stays in the document and means nothing, so deleting a state needs no cleanup pass. Without a start the old behaviour stands: the machine is in no state until `Set state` runs, `State branch` ends there, `Is in state` is all `false`. Set and remove go through a command like the scope does, so undo and the save roundtrip come for free. The start state does fire `entered` — the details are in #53. Wiki: 84df59c, *State machines → Start state and events*.
admin moved this to Done in Development on 2026-09-15 06:21:37 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#55