Skip to reading
Visual Scripting in Depth

32. Keep loops and nested calls bounded

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView PDF page

The runner stops one graph after 4096 visited nodes. It also yields a frame every 64 visited nodes and rejects graph nesting at depth 24. These limits keep a broken graph from running forever, but they do not make an unbounded design correct.

Source table from 32. Keep loops and nested calls bounded, page 36
Limit / behaviorPractical consequence
4096 node visitsRepeated visits count. A loop body of several nodes consumes several steps per iteration.
Yield every 64 visitsThe editor/game can get a frame during heavy graph work. This is not a cinematic delay.
Nesting depth 24A graph calling another graph repeatedly, or calling itself, must have a proper stop condition.
Loop body back-edgeA missing return wire prevents repetition.
Shared index/result variablesTwo overlapping calls can overwrite the same runtime destination.

1. Use a small count while building a loop.

2. Test zero, one and several iterations.

3. Check the exit path and its cleanup.

4. Keep long-running polling loops slow enough to observe and easy to stop.

5. For large data processing or complex algorithms, consider a text helper with a narrow parameter/result contract.

If the log says the graph stopped after 4096 steps, repair the graph. Increasing delays or hiding the message does not fix the route that keeps repeating.

Page 36 of 93Permalink
Go to page