Skip to content

Node System

The Flow editor is a visual node graph that drives scene behavior — animation, logic, interactivity and sound — replicated live to every peer.

Opening the editor

Press N or use the flow icon in the bottom hud. The editor docks at the bottom (tabbed with the Explorer when both are open) and can be undocked to float.

The Flows list

The left pane carries a collapsible Flows section above the node palette. It lists Main at the root — the scene-wide graph, called Scene before 1.23 (see Main graph & node properties) — then every object that actually has a flow graph of its own. It is a way to get to a graph, not a second object list, so an object with none is not in it.

Click a row to select that object and switch the editor to its graph; click Main to deselect and edit the scene-wide one. Drag the bar under the list to give it more room, and click the section header to collapse it. An entry whose object has been deleted is shown greyed out until the next save drops it.

Adding nodes

  • Palette — the left sidebar lists every node by group with a filter box; drag a node onto the canvas. The palette can be collapsed or moved to the other side with the tabs on its edge.
  • Right-click the canvas — a grouped Add menu, plus Search nodes…; just start typing while the menu is open to jump into search (Arrow keys + Enter to place, Esc back to the menu).
  • Drag a wire into empty space (since 1.64) — a search opens where you let go, listing only the nodes that fit the wire; see Drag a wire into space. With one node selected, Tab opens the same search for what can follow it.
  • Recipes (since 1.64) — the same right-click menu (and the node search) has a Recipes entry: a door, a walk-up door, a bell and a guard, built into the selected object's flow in one step. See Starter recipes.

Right-click a node for Open code, Group, Duplicate, Mute, Disconnect all, Delete and more; right-click an edge to disconnect it. Delete/Backspace removes the selection. Groups, notes, the node editor's own shortcuts and the full menus are on Node editor: keyboard, groups and notes.

Mouse bindings

What the buttons do on the canvas is a choice — Settings ▸ Input ▸ Node editor ▸ Mouse bindings:

Left drag on the canvas Dragging a node Pan
Classic — left-drag pans pans the view; Shift+drag draws a selection box moves that node left drag
Select-first — left-drag selects, right-drag pans draws a selection rectangle moves the whole selection if that node is in it middle or right button

Classic is the default and is what every version so far has done, so nothing changes until you switch. Select-first is the convention most other 3D and node tools use. Shift+click adds to or removes from the selection there, and a right click that does not travel still opens the Add menu rather than being eaten by the pan.

It is your own setting: it changes nothing for your peers and nothing in the graph.

Connecting: typed sockets

Drag from a node's output (right side) to another node's input (left side). Every socket is color-coded by its value type, and only compatible types connect — an incompatible pair shows a red cross while you drag.

Type Color (Dark) Shape Carries
number ● #38bdf8 disc a numeric value
vector3 ◆ #a78bfa diamond an x/y/z triple (also usable as a world point)
boolean ■ #f472b6 square true/false
color ⬢ #fbbf24 hexagon a color
object ⬟ #4ade80 pentagon a reference to a scene object
event ➤ #e2e8f0 arrow a short trigger pulse
effect ★ #fb923c star a per-frame scene effect

Since 1.41 every socket type has a shape as well as a colour, so wiring never depends on telling hues apart, and Light and High contrast use darker / brighter tints of the same set. While you drag, a socket that cannot take the wire turns into a red cross. See Accessibility.

Sensible conversions are allowed automatically: numbers ↔ booleans, numbers → vectors, events → numbers/booleans, and vector3 ↔ object (so a Vector3 literal can stand in for an object as a world point). Effect sockets only connect to other effect sockets.

Drag a wire into space

Since 1.64. Let go of a wire anywhere on the node editor's background and a search opens right there, listing only the nodes that fit: exact matches first, then the ones the wire converts into (an event wire into a number input counts its pulses, for example), and Show all nodes last. Picking one adds the node and the wire, and a single undo takes both away. It works with touch too.

Tab opens the same search: with one node selected it lists what can follow it and wires your pick to its output. Tab still enters a selected group, and still leaves the group you are in when nothing is selected (Groups).

Backwards wires

Triggers feed the Object Selector, never the reverse. A wire from an Object Selector into On Click — or On Grab, On Hit, On Impact, On Enter / On Exit, Animation Finished / Marker / State — means the trigger never fires. Since 1.64 such a wire is drawn dashed red with a warning chip. The chip explains the problem and offers Reverse wire, which fixes it in one undo step; the wire's right-click menu offers Reverse as well. Since 1.91 a wire into an Object Selector that matches no objects offers Pick the selector instead: it selects that card, so you can change its tag, group or name.

My click does nothing? Look for a dashed red wire first, then read the trigger's card: it says why it did not fire (Why did this not fire?).

How values flow

sources (Input) → logic → effect nodes → Object Selector
  • Source nodes (Slider, Number, Time, Random, Toggle…) produce values.
  • Logic nodes (Math, Compare, Map Range, Select…) transform them; unwired inputs fall back to the value typed on the card.
  • Effect nodes (Spin, Bounce, Pulse, Set Color, Visibility, Sound, Script…) turn values into scene behavior — but they act on nothing by themselves.
  • The Object Selector is the sink: an effect only touches the scene when its output is wired into an Object Selector that has a scene object picked (or the effect sits in an object's own graph). Since 1.74 an effect in the scene graph that reaches no object says so under its card — acts on nothing: add an Object Selector — and Check scene for agents (validate_scene) lists it.

Cards show live value readouts, updated several times a second.

Live state on node cards (since 1.64). While the node editor is open, cards also say what they are doing right now, under their title: count 3, on, fired 1.2 s ago, to point 3, placing points, resting until Play. Trigger nodes say why they did not fire — blocked: not the player, won't fire: in Edit mode (use Play).

Animate in editor

Since 1.64. Flow motion — Spin, Bounce, Orbit, Path patrol, Wander and the other movers — plays while you edit, so you see the scene alive. Switch Animate in editor off and every flow-moved object rests at its authored pose while you work on it; its card says resting until Play. Play runs everything as before.

The switch is in the node editor's controls and, as an optional button, on the toolbar. It is your own setting, on by default: it changes nothing for anyone else.

The right panel: Params and Settings

The Settings button (a cog) on the right edge opens the properties panel, which has two tabs:

  • ⓘ Params — the selected node's properties: since 1.23 every node lists them all here, including a Script's input values, a Behaviour's params and a module node's options, alongside extras such as a Slider's Min/Max, a Switcher's items list (add/remove entries) and a Number's step. A property with a wire into it shows the incoming value instead. See Properties panel.
  • Settings (the cog) — with a node selected: its Name and a free-text Note. With nothing selected: graph settings — edge style (Bezier/Step/Straight), background (dots/lines/none), minimap, snap-to-grid + grid size, Fit / Reset view, and the socket color legend.

Determinism and replication

The graph itself is shared: every node, edge, parameter tweak and position replicates to all peers. Motion is not streamed — every peer computes the same animation from the same node data and a synced clock, so a Spin or a Sound loop is at the same phase for everyone. Random nodes are seeded, and click triggers ride tiny replicated messages. You can exempt one object from all flow effects via its right-click menu (Disable flow effects).

When the runtime fails

A node that throws an error does not take the scene down with it. If the whole graph keeps failing frame after frame, the flow runtime pauses itself and says so: "Flow runtime paused after repeated errors. Your scene is intact; fix the node and resume." Fix or delete the node, then press Resume on that toast.

Safe mode

If a scene's scripts hang as soon as it loads, there is never a frame in which to fix them. Open the app with #safe at the end of the address (https://theprototype.app/#safe): the scene and its graph load, but the flow runtime starts paused, so no script runs. Edit or delete the culprit, then press Resume on the Safe mode toast — or reload without #safe.

Flow Code: the graph as text

Flow Code (Alt+F) shows the graph the editor is showing as text you can read, edit and Apply. Since 1.64 it is not its own window: it opens in the code workspace from the graph's flow code entry in the Project tree, and Save (Ctrl+S) applies it. (The code workspace can also open the graph as JSON in a tab, beside the graph's scripts.) A Text | JSON toggle above it picks the format; your choice is remembered on this device. Switching format drops edits you have not applied.

Text (the default since 1.20) is the same data as the JSON, only written once instead of repeated — about 2.1 to 2.4 times shorter, and nothing is lost:

// a button that plays a sound and shows a screen
click = gamesound "Button click" {sound: "click"} @520,40
lvl1 = hudbutton "Level 1 button" {element: "lvl-1"} @40,40
lvl1 -> click.trigger
s1.show -> vis.on
  • A node is one line: id = type "label" {params} @x,y. type+ means the node's data repeats its type; class:"…" or noclass appear only when a node's styling is unusual.
  • A wire is one line: source.output -> target.input (the handle is left out where the socket has no name). A wire with a non-standard id carries #id.
  • // starts a comment.
  • Several graphs are sections under @graph <key> lines.
  • Anything that fits none of these is kept as a raw JSON line (id := {…} for a node, ~ {…} for a wire), which is why the round trip is exact.

Apply replaces the graph with what the text says, for everybody. A line it cannot read is reported with its line and column, and nothing changes. A new node line without @x,y is placed below the graph.

Custom nodes

Right-click the canvas ▸ Custom ▸ New custom node… to open the Node Designer: name your node, add controls (range sliders with min/max/step, or select dropdowns), and write its code — a per-frame function of object, base, data (your controls + wired inputs) and time. Save for everyone replicates the definition, and instances appear in the palette's Custom group. See Custom Node and Script.