Skip to content

Blueprints and the Inspector

For creatorsAdd-on 2.2.2+

In this tutorial you make graphs read more like formulas, and you watch a game run from inside Blender. Formulas read the graph’s variables by name, three nodes each do in one step what took three, and the node editor’s Inspector shows every value live, with breakpoints and live edits. The maze chaser rebuilt this way plays move for move the same, from 227 nodes instead of 382. This builds on tutorial 9, Maze chaser.

▶ Play the maze chaser, rebuilt with everything in this tutorial. The controls are the same as in tutorial 9.

An Expression (from tutorial 6) still has its four pins a, b, c and d. Any other name in a formula is one of the graph’s variables, so you no longer need a Get Variable node and a wire for each one.

You write It reads
score + 10 The variable score
gm[a] Element a of the list variable gm
map[px, py] The cell at (px, py) of the grid variable map, or −1 outside it
playing A true/false variable, read as 1 or 0

Every name is checked against the graph’s declared variables, so a typo such as scor + 1 is an error before the game runs. A function’s formulas see its graph’s variables too.

Node What it does What it replaces
Set by Expression variable = formula Get Variable, Expression and Set Variable
Set List Element list[index] = value Array Set and Set Variable
Set Cell grid[x, y] = value Grid Set Cell and Set Variable

Each one stores a new list or grid, and saves it when the variable is persistent.

  1. Open the maze chaser’s rules. Find a chain that reads a variable, does sums and stores the result, such as adding 10 to score for a spark.

  2. Replace it with one Set by Expression: variable = score, formula score + 10.

  3. Replace each Array Set plus Set Variable pair with Set List Element, and each Grid Set Cell plus Set Variable pair with Set Cell (a spark eaten is map at the runner’s cell set to floor).

  4. Load the level’s and the pace table’s figures into variables once at the start, so formulas can name them.

The biggest saving is a chaser’s target, its whole personality. It took a 53-node function; now it is one formula per axis:

inHouse ? exitX : gm[a] == 3 ? homeX : gm[a] == 2 ? floor(c * 21)
: (chasing ? (a == 0 ? px : a == 1 ? px + 4 * pdx : a == 2 ? 2 * (px + 2 * pdx) - gx[0]
: (farFromRunner ? px : cornerX[a]))
: cornerX[a])

Open a Node Editor on a Simulacrum Behaviour graph, open its sidebar, and choose the Simulacrum tab. Below the Graph panel, the Inspector panel has a status line, a debug bar and three parts:

Part What it shows
Node The selected node’s type and settings (editable), and the variables it reads and writes, including every name inside a formula. A name the graph does not declare shows NOT DECLARED
Variables Every variable of the graph: its type and scope, or its value now while the game runs, and how many nodes read and write it. Choose one in the Graph panel’s list to list those nodes here, each a click away, even inside a function. You edit variables in the Graph panel
Object The selected object’s components and tags, and its own behaviour graph’s values
  1. Press Play on the toolbar. The game opens in the viewer, linked to Blender, and the Inspector’s top line reads Live.

  2. Watch the Variables: while the game runs, it sends every changed value up to four times a second. score counts up, gm flips to 2 when a core is eaten, and map loses its sparks.

  3. Select a node and press Set Breakpoint. A red dot marks it. The game pauses at the end of the tick in which that node ran, and the node gets a yellow outline.

  4. Use the debug bar’s buttons to pause, continue, or step one tick (1/20 s). Its eye button turns on the trace, which outlines in green the nodes that just ran. Nothing is written into your file.

  5. Press the pencil next to a variable (Set Live Value), type a value such as 12345, true or [1,0,0,0], and the running game takes it at once.

Breakpoints are kept with the graph and never published.

Play sends everything a game reads along with the scene: the data tables you keep as data/…json texts, the painted levels’ bake, and the sprite sheets you packed as sprites/… images. Files the game loads from other cartridges, such as a tile set or a spawnable, load from their published addresses.

  • Formulas name variables directly, and Set by Expression, Set List Element and Set Cell write in one node.
  • The Inspector shows a node’s reads and writes and every variable’s live value, and finds every node that uses a variable.
  • Breakpoints, stepping, trace and live edits debug the running game from Blender.

Next: Run-and-gun turns the board on its side and adds gravity.