ARC - Another Rate Calculator

by miodec

Select machines to see how many items they produce and consume per second, minute or hour. Intermediate items made and used inside the selection are balanced: machines short on an input are slowed to what's actually supplied.

Utilities
3 hours ago
2.1
0

Changelog

Version: 0.1.0
  Features:
    - Rate tool (Alt + R or the shortcut bar): select crafting machines, furnaces, rocket silos, mining drills, offshore pumps and labs to see their rates. Labs research the current research: what science packs they draw, with lab speed and productivity research, modules and slower-draining labs (biolabs).
    - Shift-select adds machines to the current calculation.
    - The pipette (Q) over an item's or machine's icon in the window puts it in hand.
    - Ghosts count too, as the machines they'll be: with the modules they're to get, the beacons in reach (built or ghosts) and the force's research. Beacons count whether powered or not, like the game's potential figures.
    - Items are split into outputs, intermediates and inputs, with the machines making each, and the rates now: made (green) minus used (red) then the net for an intermediate, the rate for an output or input. Under each item's rate, a line for each kind of machine making it: how many, planned ones included, times what one makes (10 × 22.5). Before the rate, in a column of their own, the recipe's icon (or the machine's when the recipe is just the item) with how many there are, the buttons to plan more or fewer, and the planned change ([machine] ×10 [-][+] +2).
    - Items made from themselves (kovarex, coal liquefaction) are marked as part of a loop: their rates are where the loop settles, and machines needed and fit are estimates.
    - Intermediates are listed down the chain: electronic circuits above the copper cable they're made from.
    - Hovering an item's row lights it up with the rows next to it in the chain: what it's made from and what's made from it, one step each way. It can be turned off in the mod settings (per player).
    - Machines whose inputs are made in the selection but not fast enough are slowed to what's supplied. The rate and net columns show what happens now. A "Target" column shows the rates with the outputs' machines at full speed and everything upstream only as fast as it has to run: what an output can make, the rate an intermediate takes, and what has to be supplied of each input and of power, with the machines that takes times what one makes at full speed (10.3 × 22.5).
    - Hovering a rate lists every kind of machine making and using the item. Hovering the net explains it: where a product goes, where an input comes from, or for an intermediate the spare machines or how short its users are. Hovering a machine's rate shows what each machine makes.
    - Rates can be shown per second, minute or hour, or in belts of each tier in the game (fluids stay per second). With stack inserters (Space Age) the header sets how high belts are stacked, starting from your research.
    - Clicking an input plans machines producing it: it moves to the intermediates, as many machines as what uses it takes at full speed, and what they use becomes the inputs. The recipe named after it (or one with it as its main product), in the fastest selected machine that can make it or else the fastest you can build, at base speed. Their line is marked with a ghost. The recipe and the machine (with its quality) can be changed with pickers on their line. Clicking its icon again takes them away. Inputs nothing can make (ore, crude oil) stay as they are.
    - Plus and minus buttons on each kind of machine try more or fewer of them (shift: 5 at a time) to see how the rates change.
    - Machines making an intermediate show how many it takes to keep up with what the selection uses, with the spare ones (yellow) or how many more are needed (red). Fit, in the last column: on an output it plans just enough of every machine feeding its machines, then adds as many of its own machines as the spare from rounding up keeps going; on an intermediate it plans the outputs it goes into to use all it makes, and fits the machines between. An intermediate's surplus is yellow: some of its machines aren't needed. Machines short on an input nothing can be planned for (its makers also make an output, like a refinery's heavy oil) show "needs more" with that input.
    - The inputs are in a pane of their own on the left, what's used now, starting with the electricity the machines draw (with their modules, and the beacons affecting them). Hovering the power shows what each kind of machine and beacon draws of it, most first, with the target and everything at full speed.
    - Tooltips show exact amounts, 50000 rather than 50.0k.
    - The window recalculates on its own when the selected machines change: a recipe, modules, beacons in reach, research. It looks right after a machine's window is closed, settings are pasted, modules are moved with ctrl-click, something is built or removed or research changes, and every second (a setting) for the rest; it recalculates only when something changed, and waits while a multiplier is being typed. A setting turns it off (manual: only the refresh button recalculates).
    - The selected machines show a box around them, as thick at any zoom, while the window is open, seen only by the player who selected them. They're green; hovering an item's row turns its machines' boxes orange (the machines using it, for an input). Under each box, at the left, how busy the machine is: for each thing it makes, its icon and its row's percentage in the window. A setting picks off, the boxes alone or the boxes with the percentages (the default). Another clears them, should any be left behind.
    - Area mode, the Selection | Area switch in the toolbar: the window follows the area last dragged with the tool, outlined in green with rounded corners, rather than the machines selected; the machines in it get boxes only while their row is hovered, in orange. Machines built in it or taken away come in and go, ghosts too. Plans count down as they're built: while a line has one, a machine built in the area takes one off it and one taken away puts it back, and a plan used up is gone. Dragging sets the area, shift-dragging grows it; turned off, the machines in it then stay selected.
    - A drop-down in the toolbar for how many decimal places the rates show, 1 to 3 (1 by default).
    - Machines planned for an opened input can be given modules and beacons: their line shows what's chosen, and its edit button opens a popup at the mouse with a picker for each module slot, a beacon with how many reach each machine, and a picker for each of the beacon's slots. Picking a module with every slot empty fills them all; change single slots to mix. Only modules the recipe, machine and beacon allow are listed. Beacon power isn't counted for them, beacons are usually shared.
    - Each kind of machine's modules show beside its controls, then the beacons in reach: each kind of beacon with how many reach each machine and the modules in it. Machines with different modules or beacons in reach share a line with their average modules, beacons and rate, and a warning saying so; the beacon button in the toolbar splits them into lines of their own, each with its own rates and plus and minus buttons. Plans carry over: split, a line's plan is shared out between its lines (+5 over two is +2 each); together again, they add up.
    - Machines making an output show "(can add N)" when the intermediates made now would keep that many more of them running at 100% working, and which intermediate runs out first.
    - Working %: for each kind of machine making an item, how much of the time it's crafting rather than waiting: red with what it's short on when waiting for an input costs output, yellow when it waits for its output to be used (spare machines), over 100% in red when there's room for more of an output's machines or an intermediate's are short.
    - A full-height chevron button between the rates and the target column, in place of a line, shows or hides the target column.
    - A multiplier in the toolbar (× N, applied with Enter) shows everything as if the selection were built N times over: every rate, the power and the machine counts, what one machine makes staying as it is.
    - A warning on a kind of machine's line when its rates may be off: some of its machines have no power or fuel, aren't at their shown rate yet because some effects aren't active (the game's blue figures), or are ghosts. A red bar along the bottom of the window says when any machine has one.
    - A selected ghost that gets built stays in the selection: the machine takes its place.
    - Machines marked for deconstruction are left out of the rates, with a bar at the bottom saying how many were selected.
    - An item a machine uses more of than it gives back (a recycler on something it can only return a quarter of, kovarex's uranium-238) counts only as used, the net; machines that then produce nothing get a line under the item they destroy, after the machines producing it, marked with a trash can: how many times what one destroys (red) and how busy they are: green under 100% (they keep up), red over it (more reaches them than they can destroy, by how much).