Builtin Library
- ..
- .metadata17 B
- README.md7.3 KB
- adjust.tool
- apply.tool
- bake.tool
- cancel.tool
- collapse.tool
- cooks.tool
- coverage.tool
- describeNode.tool
- diff.tool
- explain.tool
- find.tool
- flatten.tool
- frames.tool
- generators.tool
- inspect.tool
- modify.tool
- onPresent.tool
- patch.tool
- play.tool
- preview.tool
- profile.tool
- promote.tool
- reference.tool
- search.tool
- searchNodes.tool
- shared.module
- spawn.tool
- stats.tool
- trace.tool
- tweak.tool
- validate.tool
README.md
procgen
The procedural-generation tool family: find the nodes a graph is built from,
edit a graph's code, preview it, try values for its inputs, inspect it, spawn a
live generator to iterate in the scene, and watch cooks as they run. A graph is
the code of its init.luau (proc.define(function(g) ... end)); the tools here
read that code, edit it, picture it and run it.
Each tool is called as tools.use("procgen", "<tool>", ...) from Luau, as
zero procgen <tool> in the engine shell (zero procgen <tool> --help gives its
arguments), and through use_tool over MCP. A tool's README and
describe_tool give its arguments and what it answers.
Discovery
searchNodes: find nodes by what they do, the counterpart ofsearch_tools: by meaning, through ZeroMind's search over every published node and pack of ops (a pack's ops that answer the words are listed asop.<id>rows), with this world's own unpublished nodes after the ranked rows. A query needs the live session an engine bound to a world holds. With no query it lists every node a graph calls here (g.<family>.<name>, and the ops of packs asg.op.<id>) and names every family and the nodes in it.describeNode: one node in full, the counterpart ofdescribe_tool: what it does, its inputs in call order with their types, defaults, ranges and options, its outputs, its family, the call a graph writes and, for an op of a pack, what it costs.search— free-text search over the.procGraphgraph library (name / id / description / tag / category).find— discover graphs by what they produce (an output type or producing-op substring, e.g.{ produces = "Bundle" }).inspect— one node's op, sockets, producers, and consumers.coverage— every current op with the new node that replaces it and its parity state, and every library graph with the worst state among the ops it names.stats— structural counts (nodes / composites / inputs / outputs), plus evaluated-output stats when atargetis given.trace— the dependency chain for a target, in evaluation order.explain— an agent-oriented natural-language summary of a graph.diff— a structural diff between two graphs (changed/added/removed nodes, per-node deltas).validate— check a graph the way its cook will: that its source builds, its connections (type mismatches, missing inputs, unknown nodes and params), then what a cook of its first frame refuses (bounded bytimeoutMs), and the nodes that run on the CPU every frame.generators— survey every live procedural generator in the scene: bound graph, params, realized child count, and cook state.
Edit the code
These edit a graph's (or node's) init.luau as code and write it only once it
builds, so the graph stays valid. A section is a run of statements named by the
lines it spans; a call is named by the local it declares or a line it spans.
collapse: lift a section (a few node calls doing one job) into a node of its own: its inputs are the values the section reads, its outputs the values the code after it reads, and the section becomes one call of the new node. The graph cooks to the same result, andsearchNodesfinds the node.flatten: the inverse: write a node's body out in place of a call to it (one call, every call of a node, or every call of a node outside the built-in library).reference: put a call of an existing node in place of a section.promote: make a part (a.procGraphcalled by its path) a node found by name, which stays the part's.patch: set and unset what one call is given.modify: structural edits as one change: add, remove and repoint calls, rename locals, declare inputs and outputs.
Try it
A tool that takes a graph to preview or run takes it by its VFS path or its
name, or as a graph object (what proc.define, proc.graph and proc.load
return); spawn and play take a saved graph, since a generator plays an asset.
tweak— preview a graph with other values for its declared inputs, in a single step, leaving its source as it is: the knob-tuning loop.
See it / make it real
preview— evaluate one target (an output or a node) of a graph and render it for any output type (Geometry, points, Field heatmap, Material ball, Texture, Bundle); the picture comes back in the result beside its stats.spawn— spawn a live procedural generator from a saved graph: an entity with a Generator component bound to it, which cooks the graph on its own runner and cooks again as its params change.adjust— adjust a live generator in place: merge param overrides or select another output.apply— swap a live generator in place for the asset it makes: its current output becomes a durable bundle, and an Asset component standing it replaces the Generator, like applying a modifier.bake— evaluate one target of a graph and realize it straight into the scene as durable content, without a live generator.
Play it
play— play a graph on the preview stage with nothing added to the scene: it plays from its first frame with the inputs given (each a value or a path over the play's time), forseconds, and answers the profile of that play and a picture of what it draws at each time ofat.
Cook observability
cooks— the scene-wide cook monitor: every in-flight cook, a bounded history of recently finished ones, with progress (the nodes cooked so far and the node running now), status, duration, and — on failure — the error and the node that broke, and the frames generators presented most recently.cancel— cancel an entity's in-flight cook; it stops at its next checkpoint and the previous output stays realized.onPresent— be told the moment a generator presents the frame you describe (an output, a graph time or a time within a repeating cycle, an element count), with the probe's own options beside the terms:capturea picture of that frame (what the generator draws alone, framed to fit, over the grey studio backdrop),freezethe generator and the world on it (the generator plays on withgenerator:play()), awhenandrunof your own. It arms a probe, soprobe.list,probe.hitsandprobe.cancelmanage it.frames— see how an effect goes: a picture of the frame a generator presents at each graph time you name (orcountof them fromfromtoto), each of what it draws alone, framed to fit, over the grey studio backdrop an asset preview is photographed in, with the frame, how it was presented and each output's element count beside it. A time past the end of a timeline shows its last frame, with anotesaying so; a picture of a frame that draws nothing, or one that holds the backdrop alone, says so in its ownnote. A generator whose cook failed raises, naming the node and the reason. The clock goes back where it stood after.profile— what evaluating graphs has cost, read from what was recorded as the work ran: every graph's run and wait time, its nodes costliest first, the verdicts on what was paid again, saved runs to compare against, and one graph invoked once with what that invoke cost.