Resource Balance


A floating panel that shows produced, consumed and balance per minute for the items and fluids you pick, each bound to its planet. Includes a deficit finder, search and sorting, trend charts, a large chart window with smooth lines, comparison of up to 4 resources and a per-recipe breakdown of producers and consumers. Made for overhaul mods like Pyanodon's.

Utilities
a month ago
2.0 - 2.1
372
Logistics Manufacturing
Owner:
funtik13
Source:
https://github.com/YlikScherbak/facto...
Homepage:
N/A
License:
MIT
Created:
a month ago
Latest Version:
1.8.0 (a month ago)
Factorio version:
2.0 - 2.1
Downloaded by:
372 users

Resource Balance

Stop scrolling through the production statistics. Pick the items and fluids you care about and see at a glance how much is produced, how much is consumed and whether you are running short — with charts that show when, diagnostics that show why, and a watcher that tells you when a line stops.

Made for overhaul mods like Pyanodon's. Hundreds of intermediates, long production chains, by-products and several recipes for the same item — exactly where the vanilla statistics window stops being practical. Resource Balance was developed and tested on a full Pyanodon's playthrough and handles it smoothly. It also works with any other mod set, vanilla and Space Age.

What's new in 1.8

  • Stopped production detector. It notices when a line that was working stopped for lack of input, fuel or electricity — and alerts only when the stop harms someone: consumers run short of the product and there is no stock to cover them. A full warehouse or a line that simply waits for demand stays quiet.
  • It says why: the producer of the missing ingredient stands still, production fell, it is produced but less than was consumed before the stop, it is produced but does not reach these machines, or a delivery problem. Stops in one chain are grouped — you get the root, not ten consequences.
  • Chat line with map links, an alert icon while the stop lasts and an optional sound. Many stops at once (first start, after an update) come as one summary instead of a flood.
  • Stops tab in the Diagnostics window: show the producer or the stopped machine on the map, mark a stop as expected, snooze it for 30 minutes or stop watching the recipe. The Diagnostics button counts new alerts.
  • Max/m column and capacity on the diagnosis card: how much the machines could make or use at full speed.
  • Machine states now tell no fuel or heat and low power apart from no electricity.

Earlier

  • 1.7: redesigned interface, resource window with tabs, diagnosis card, Deficit tab, Diagnostics window.
  • 1.6: machine state history, idle view, output targets, root causes, clogging byproduct, full storage recognised, fluid stock, watcher log and marks, quality fix.
  • 1.5: several lists with export / import, watcher pause per list, possible cause and delivery hints, chart marks.
  • 1.4: watcher, stock column, what changed, machine status per recipe and jump to the machine on the map.

Features

Resource panel

  • A floating panel that stays on screen while you play (drag it anywhere). By default Esc does not close it — enable Close the panel with Esc in the mod settings if you prefer.
  • For every resource: produced / consumed / balance per minute, green when in surplus, red when short.
  • Every row is bound to its planet (its icon is shown in the Planets column). Statistics always come from that planet, wherever you are — handy when production on one planet depends on another.
  • Or count it on all planets at once (Σ): turn on the Σ toggle next to Add resource — the row shows totals over every planet and space platform, the Planets column shows where the resource is produced or consumed (producers first), and hovering the row breaks the numbers down per planet. Works in the resource window too.
  • Time periods like the vanilla statistics: 5s, 1m, 10m, 1h, 10h, 50h, 250h, 1000h.
  • Stock: how long the stock lasts at the current deficit — "0" when there is none, "<1m", "≈15m", "≈3.5h"; red under 10 minutes, yellow under an hour. Items are counted in logistic networks (belts, chests outside the network and machines are not), fluids in storage tanks together with the pipes of their segments.
  • Output target per resource: Produced turns yellow below 95% of the target, the tooltip shows the percentage.
  • Ctrl+Alt+R over an item, fluid, recipe, machine, drill or offshore pump adds it (or its product) to the current list.
  • Search by name (works with translated names) and sorting by name, produced, consumed or balance.
  • A mini trend chart in every row.

Deficit tab

  • Every item and fluid with a deficit on the current planet, largest first, with its stock. The tab shows how many there are.
  • The 50 largest deficits are listed (search finds the rest) — fast even with hundreds of them in a Pyanodon's base.
  • + on a row opens an Add to window: pick the list, a green check marks the lists that already have it.

Lists

  • Up to 12 lists as tabs — e.g. one per planet or per production chain. Every tab shows how many resources it has and a red icon when its watcher fires.
  • + creates a list, the pencil edits the current one: name with an icon (the icon selector, like train stop names), export string, delete.
  • Export a list — resources, planets, watcher thresholds and targets — as a text string (press Select, then Ctrl+C) and import it when creating a list in another save or from a friend. Resources that don't exist in your mod set are skipped, duplicates are not added twice.
  • Make a list from ingredients (Producers & consumers): the resource and the direct ingredients of the recipes that currently make it, with a preview to untick extras.
  • List tabs scroll horizontally — 12 lists don't make the panel wider.

Resource window

Click a resource to open it. Four tabs:

Chart
- Thin production (green) and consumption (red) lines, grid and axis labels, just like the vanilla graph, and a balance band under it: up = surplus, down = deficit.
- What changed: the previous period against the last one (produced, consumed, balance and the change) with a one-line verdict — production fell, consumption rose, or the line stopped completely.
- Hover anywhere to see the exact values at that moment. Smoothing: Auto / None / Light / Strong.
- Compare up to 4 resources on one chart with a shared time cursor: Ctrl+click or right-click rows, or Add resource in the window.
- Marks: note an event at the current moment ("added a second iron line"), with icons if you like. It is shown on the chart of every resource as a dashed white line. The watcher adds its own marks to the chart of its resource: orange when a threshold breaks, green on recovery, grey on pause, snooze or change.

Producers & consumers
- A diagnosis card on top: the balance, what the producers were doing over the last 30 minutes (working 54% · no input 31% · output full 12%), the target verdict and the likely cause.
- Which recipes make and use the resource, how many machines run each of them (working / total), their share and status counters: missing ingredients, output full, no power or fuel, other.
- Click a counter to jump to the next such machine on the map: the remote view opens next to the window and the machine is circled in the colour of its status. Further clicks cycle through the machines, also on other planets.
- Target verdict: target reached with a capacity reserve, not enough machine capacity (with an estimate of machines to add), or enough capacity but the machines lack input, have a full output or lack power.
- Possible cause of a deficit: the ingredients of the main producers that are short on the same planet too.
- Clogged byproduct: "1 of 9 producers are stopped: the output is clogged with X", and whether X has no consumers, stopped ones or working ones, with Who consumes it and Show a machine buttons.
- Full storage is not a deficit: when producers wait with a full output while consumers keep working (city blocks, train stations, full tanks), the card says so instead of showing false causes.
- Numbers appear instantly for 1m / 10m / 1h / 10h, estimated from the game's product statistics with machine productivity taken into account (rows marked ≈ are split between several recipes by machine capacity). Live (60 s) measures finished crafts of every machine for a precise check.

Root causes
- A tree of short ingredients of short ingredients, up to 5 levels, with a reason at every branch end: machines are working at full capacity (build more), machines are stopped although ingredients are enough (check delivery, output or power), no machines make it on the planet, or the storage is full.

Watcher
- A minimum output and/or a minimum balance per minute, checked against the average over 1, 5, 10 or 30 minutes, so production waves from trains and buffers don't trigger it. The current value is shown next to each threshold.
- A broken threshold turns the row icon red and puts a counter on the mod button. You are notified once, and again only after the resource recovers. Chat message and sound are optional.
- Snooze for 30 m for one resource, a pause button for the whole list, and the alert log of this resource.

Diagnostics window

  • Idle: the recipes on the current planet that stand still the most — sorted by lost machine time, over 5, 10 or 30 minutes — with the main idle reason and the product's balance: red when the product is short (the idle time hurts), normal when the machine just waits for demand.
  • Watcher log: when each alert started and ended, how long it lasted, the lowest output and balance, and how it ended. Click a resource to open it.
  • Stops: stopped lines that harm someone, with the reason and how long they stand; found by a check, expected, snoozed and not watched ones in their own groups. Buttons: Producer and Machine (show on the map), Expected, Snooze 30 m, Don't watch, Restore.

Settings

Per player:
- Panel refresh: Auto (by period), every second, every 5 s or every 10 s.
- Machine rescan for producers & consumers: every 10, 30 or 60 s.
- Number format: Auto (k from 10,000), Short (k from 1000) or Full (1 000).
- Close the panel with Esc: off by default (the panel then also closes when you open your inventory or a machine). The resource window always closes with Esc.
- Watcher: chat message, Watcher: sound and Watcher: marks on the chart.
- Stops: chat message, Stops: alert icon (on by default) and Stops: sound (off by default).

Map:
- Stopped production detector: on by default; needs machine state history.
- Machine state history: every 5, 10 or 30 s, or off. The load is spread evenly over ticks (about 0.1 ms per tick for 20 000 machines at 10 s).

Controls

  • Ctrl+Shift+R (rebindable), the shortcut bar button or the top-left button — open / close the panel.
  • Ctrl+Alt+R (rebindable) — add what is under the cursor to the current list.
  • Click a resource — resource window. Ctrl+click / right-click — add it to the open chart.
  • Icon on a row — the Watcher tab of that resource; cross — remove it from the list.
  • ? in the panel title — all controls at a glance.
  • Esc closes the mod's dialogs one by one, then the window.

Notes

  • Statistics are per planet (surface), exactly like the vanilla production window.
  • Watcher thresholds, lists and marks are per player, so they work in multiplayer too.
  • The mod creates a small hidden surface resbal-charts used only to draw chart lines (it is not a planet, has no content and is hidden from the remote view).
  • Performance: recipe lookups use the game's built-in filters; machine scans, state history and fluid stock are spread over ticks; the watcher checks every 10 s — even huge bases stay smooth. /resbal-perf shows what the background tracking costs in your save.

Languages

English, Українська, Русский. Translations are welcome — on GitHub or in the discussion.

Compatibility

  • Factorio 2.1 from version 1.4.0. The last version for Factorio 2.0 is 1.3.0 (the portal picks it automatically for 2.0).
  • Multiplayer-safe state; no prototype changes to other mods.

Source

https://github.com/YlikScherbak/factorio-resource-balance