diff_vs_save
Compare your current save against a planned factory to see exactly what to change. Get ordered actions: unpause idle machines, set recipes, and build missing ones.
Instructions
What to change to get from the factory you have to the one plan_factory plans.
Takes exactly plan_factory's arguments and re-solves, because the server keeps no state. Both tools print a plan id hashed over the arguments AND the save-derived solve inputs, so two responses carrying the same id are provably the same plan.
Machines are matched by IDENTITY, never by position: a manufacturer on (building, recipe), a generator on its building alone since its fuel is piped in rather than set on the machine, an extractor on the node it occupies. A Refinery running some other recipe is busy, not spare, so it never counts toward the plan.
Actions are ordered free-first -- UNPAUSE, then SETRECIPE on machines that produce nothing today, then BUILD. Stages follow the plan's own chain depth and the power arithmetic is INCREMENTAL, charging only the machines you have yet to place. Where a machine cannot be identified at all (Water Extractors have no recipe and no resolvable node) the answer is a RANGE, never a number.
Recall a stored plan with plan= and the diff is also grouped by STARTUP STAGE --
the same partition commission_plan emits -- so it answers "which stage am I in".
stage=<n> narrows to one stage's delta; stage=0 asks for the overview
without a stored plan, at the cost that the numbering moves when the arguments do.
Built and energised are DIFFERENT states and the save separates them in one direction only: a machine that produced in the last 300s window certainly had power, while one that did not may be unpowered, starved, blocked or idle. Grid membership is not persisted at all, so a stage is never reported as "unpowered" -- only as built with nothing proven running, which is exactly what a finished but not-yet-energised block looks like.
Saves are read-only: this never proposes writing one, and there is no dismantle action. Machines standing among the plan but not in it are listed for you to judge.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan | No | recall a saved plan by name | |
| save | No | ||
| limit | No | max rows (hard cap 25) | |
| stage | No | one startup stage's delta; 0 for the stage overview | |
| world | No | ||
| clocks | No | ||
| exports | No | ||
| factory | No | only count this factory's machines as already built | |
| sources | No | ||
| objective | No | max_mw | |
| show_cost | No | ||
| allow_sinks | No | ||
| target_item | No | ||
| only_recipes | No | ||
| exclude_recipes | No | ||
| export_minimums | No | ||
| machine_cost_mw | No | ||
| only_free_nodes | No | ||
| extractor_clocks | No |