Demand Statistics

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

cmbatten97
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Mar 11, 2024 5:09 pm
Contact:

Demand Statistics

Post by cmbatten97 »

TL;DR
New graph in production statistics that shows demand
What ?
I am currently running a rather large space exploration world so it has become almost impossible to manage supply and demand of all my intermediate products. Trying to use the production/consumption statistics isn't that useful as consumption will almost always match production when in steady state. I think a demand statistic that shows the theoretical consumption rate of all empty/working machines would be much more useful (not paused b/c output full machines).

As an example:

Lets say you have a setup per the following
-Producing 10 copper plates per second from furnaces.
-10 assemblers making copper wire each at a rate of 2 copper plates consumed per second and producing 4 copper wires per second (theoretical max of 20 plates consumed and 40 wires produced per second)
-Assuming nothing is bottlenecked the production/consumption statistics of copper plates will both be equal at 10 per second.
-Demand statistic would show 20 copper plates per second
Why ?
A much more useful statistic would be demand. Demand would show the assemblers need 20 copper plates per second while your production is only 10 per second, so you know you need to increase copper plate production. Having a demand statistic would make finding your bottle necks much easier in very large worlds as it would simply be where your difference in production and demand is the greatest.

I know some people might suggest using something like the rate calculator mod but that doesn't take into account paused machines. I think a demand statistic should NOT include machines that are paused due to full outputs as they have no demand.

Let me know what you all think.
Illiander42
Filter Inserter
Filter Inserter
Posts: 545
Joined: Mon Feb 05, 2018 10:01 am
Contact:

Re: Demand Statistics

Post by Illiander42 »

This would break on intentionally underfed assemblers.

Which happen all over the place.

(It's why the rate calculator mod isn't as useful as you'd think)
mmmPI
Smart Inserter
Smart Inserter
Posts: 4616
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Demand Statistics

Post by mmmPI »

The question of output full machine is more complex because you could have the feeding inserter stopped by circuits sometimes, and the machine would be in "demand" despite player not willing to count that as demand regarding the purpose of the demand stat. Same regarding closed subfactory with no train coming to it because you don't need say modules or robots or walls at the moment. You could also have players stopping belts voluntarily. All those are example of underfed assembler that would be hard to detect for a useful demand stat.

For me the rate calculator is used to detect ratios locally, but i wouldn't trust aggregate data from the whole factory.
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Demand Statistics

Post by mrvn »

A graph for the difference of supply and demand would be useful.

I produce and consume ~10k iron plates per minute so the graphs look pretty much identical. But do I produce 10.1k iron plates per minute and consume only 9.9k iron plates per minute? Or the other way around? There is no way to tell.

A graph showing the difference would show values +/-100 instead of 0 to 11k making changes much more noticable.
Koub
Global Moderator
Global Moderator
Posts: 7955
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Demand Statistics

Post by Koub »

mrvn wrote: Tue Mar 12, 2024 5:17 pm A graph for the difference of supply and demand would be useful.

I produce and consume ~10k iron plates per minute so the graphs look pretty much identical. But do I produce 10.1k iron plates per minute and consume only 9.9k iron plates per minute? Or the other way around? There is no way to tell.

A graph showing the difference would show values +/-100 instead of 0 to 11k making changes much more noticable.
Consumption and demand are not exactly the same thing. It's easy to display consumption, whether in an absolute graph (like those we have to day), or in a relative-to-production graph (excess/deficit production).

Consumption would be the same as demand as long as there's enough buffering. As soon as the intermediate buffers would have depleted enough, consumption and demand would diverge, with, at the extreme, consumption limited by production (+ the eventual bottlenecks), but still strictly measurable (what's actually consumed).

On the opposite, let's imagine a fully beaconed AM3 with speed modules everywhere possible producing basic (yellow) belts.
Let's imagine this Assembling machine is fed with one yellow belt of iron plates, and one yellow belt of iron gear wheels by a fully upgraded stack inserter each.
What should be the demand ?

A) The maximum theoretical capacity of the fully boosted Assembling machine, ignoring there is no way it can be fed quick enough ?
B) What the Assembling Machine can consume limited by the inserters' throughput, ignoring the belts' t limited throughput ?
C) The maximum the Assembling machine could consume given this specific setup ? (limited by the yellow belts' throughput) ?

I'd be totally OK with a graph showing the differential between production and consumption, but I can't see how we could have a graph showing the actual demand AND that graph making consensus on what it shows.
Koub - Please consider English is not my native language.
Illiander42
Filter Inserter
Filter Inserter
Posts: 545
Joined: Mon Feb 05, 2018 10:01 am
Contact:

Re: Demand Statistics

Post by Illiander42 »

Koub wrote: Tue Mar 12, 2024 5:59 pm On the opposite, let's imagine a fully beaconed AM3 with speed modules everywhere possible producing basic (yellow) belts.
Let's imagine this Assembling machine is fed with one yellow belt of iron plates, and one yellow belt of iron gear wheels by a fully upgraded stack inserter each.
Switch the belt feed to a single circuit-controlled yellow sushi lane of gears and plates and make things even more complicated.

And because circuits are Turing-Complete proving that that setup won't deadlock is impossible in the general case, never mind finding it's throughput. (The Halting Problem says "Hi!")

And then I remembered that Factorio belts are Turing Complete. So that blows up the whole idea.
robot256
Smart Inserter
Smart Inserter
Posts: 1250
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Demand Statistics

Post by robot256 »

cmbatten97 wrote: Mon Mar 11, 2024 5:39 pm I am currently running a rather large space exploration world so it has become almost impossible to manage supply and demand of all my intermediate products. Trying to use the production/consumption statistics isn't that useful as consumption will almost always match production when in steady state. I think a demand statistic that shows the theoretical consumption rate of all empty/working machines would be much more useful (not paused b/c output full machines).
How would a global statistic really help if your production is spread across multiple surfaces? There could be a surplus on one and a shortage on another. The only actionable information is exactly which belts are empty.

It's hard enough making the electricity demand graph relevant. For example, when you have a power outage and all your roboports deplete their internal buffers, they all appear as a 4MW demand because that's what they recharge their buffers at. It doesn't mean you actually need that much power continuously once the grid is restored.

So it goes back to designing the information you collect based on what actions you can take. You could put a loudspeaker on every bus belt to alert when it's not saturated. I don't find it cumbersome at all to scan backwards through a production chain to find the bottleneck, but then again I make hideous spaghetti bases and enjoy it.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Demand Statistics

Post by mrvn »

Koub wrote: Tue Mar 12, 2024 5:59 pm
mrvn wrote: Tue Mar 12, 2024 5:17 pm A graph for the difference of supply and demand would be useful.

I produce and consume ~10k iron plates per minute so the graphs look pretty much identical. But do I produce 10.1k iron plates per minute and consume only 9.9k iron plates per minute? Or the other way around? There is no way to tell.

A graph showing the difference would show values +/-100 instead of 0 to 11k making changes much more noticable.
Consumption and demand are not exactly the same thing. It's easy to display consumption, whether in an absolute graph (like those we have to day), or in a relative-to-production graph (excess/deficit production).
I mend production and consumption across the board, since that's what the game can currently graph.

To see if demand exceeds production it might be nice to get a graph for stored items.
fatboyfat_uk
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Aug 09, 2017 2:49 pm
Contact:

Re: Demand Statistics

Post by fatboyfat_uk »

Koub wrote: Tue Mar 12, 2024 5:59 pm
mrvn wrote: Tue Mar 12, 2024 5:17 pm A graph for the difference of supply and demand would be useful.

I produce and consume ~10k iron plates per minute so the graphs look pretty much identical. But do I produce 10.1k iron plates per minute and consume only 9.9k iron plates per minute? Or the other way around? There is no way to tell.

A graph showing the difference would show values +/-100 instead of 0 to 11k making changes much more noticable.
I'd be totally OK with a graph showing the differential between production and consumption, but I can't see how we could have a graph showing the actual demand AND that graph making consensus on what it shows.
I just came here to say that I think this is one thing the production graphs really need - the ability to graph the difference between production and consumption. It should be a single graph with lines above and below zero where postitive indicates production is higher than consumption (surplus) and negative is consumption more than production (deficit).

An alternative would be to open the graphing system to Lua mods so we could develop a mod to do it but I'm sure just graphing the difference would be much easier :lol:
Last edited by fatboyfat_uk on Sun Aug 10, 2025 8:18 pm, edited 2 times in total.
eugenekay
Filter Inserter
Filter Inserter
Posts: 619
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Demand Statistics

Post by eugenekay »

fatboyfat_uk wrote: Sun Aug 10, 2025 8:16 pmAn alternative would be to open the graphing system to Lua mods so we could develop a mod to do it but I'm sure just graphing the difference would be much easier :lol:
What is missing from LuaFlowStatistics ?
fatboyfat_uk
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Aug 09, 2017 2:49 pm
Contact:

Re: Demand Statistics

Post by fatboyfat_uk »

eugenekay wrote: Sun Aug 10, 2025 10:14 pm
fatboyfat_uk wrote: Sun Aug 10, 2025 8:16 pmAn alternative would be to open the graphing system to Lua mods so we could develop a mod to do it but I'm sure just graphing the difference would be much easier :lol:
What is missing from LuaFlowStatistics ?
Is it possible to use LuaFlowStatistics to add a new "type" of statistic? I understand you can set input, output and storage for a prototype but I assume they just get added to the existing production statistics graph. Maybe I've misunderstood it as I haven't actually tried it out. My comment was more about a general purpose graphing API. Like a new GuiElementType for "graph" that you could completely customise and add to your own custom UI.

Either way it was just a bit of a throwaway comment; the main request is to add the surplus/deficit to the existing graph.
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2538
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Demand Statistics

Post by Jap2.0 »

I think some people here are saying "difference between production and consumption" when what they really mean is "difference between what I can produce and consumption".
There are 10 types of people: those who get this joke and those who don't.
fatboyfat_uk
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Aug 09, 2017 2:49 pm
Contact:

Re: Demand Statistics

Post by fatboyfat_uk »

There are 2 proposals in the thread.

The original proposal was to graph what is demanded in addition to actual production and actual consumption. The 2nd proposal, that I was supporting, was to simply graph the difference between actual production and actual consumption. There are quite a few corner cases and possible pitfalls with accurately calculating demand, whereas the difference proposal is much simpler.

I have since found this other thread that discusses the difference proposal in more depth so I should probably have posted there. Apologies, my initial search found the discussion in this thread and I didn't check further results, my bad.
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2538
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Demand Statistics

Post by Jap2.0 »

fatboyfat_uk wrote: Mon Aug 11, 2025 4:42 pm The 2nd proposal, that I was supporting, was to simply graph the difference between actual production and actual consumption. There are quite a few corner cases and possible pitfalls with accurately calculating demand, whereas the difference proposal is much simpler.
(These ideas are related enough that I'm going to keep my comments in this thread for now. Mods welcome to merge/move as they see fit, obviously.)

I kind of struggle to see the utility of this, though... maybe I would if I saw it in action, but I think you would end up in a kind of homeostasis (on a long enough time scale) where something that simple wouldn't be of much benefit.

Either you're using more than you're producing, and consumption slows down to match demand; or you're producing more than you're consuming, and production gets backlogged (once buffers fill up) and slows down to match consumption. Or you're producing and consuming at exactly the same rate, I guess.

I guess you might be able to get something if you have large buffers and see a slight deficit starting? Or if you see spikes (e.g. miners turning on and off as trains arrive) to give you an idea of how much more you can handle (although that would probably even out at a large scale).

The "production vs. maximum demand" seems slightly more useful, but has the challenges mentioned previously to implement. Ultimately I end up looking at end products (e.g. science) and if they aren't producing at the rate I expect, trace backward until I find the bottleneck. I'm not sure how much a graph would change that process.
There are 10 types of people: those who get this joke and those who don't.
fatboyfat_uk
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Aug 09, 2017 2:49 pm
Contact:

Re: Demand Statistics

Post by fatboyfat_uk »

Jap2.0 wrote: Mon Aug 11, 2025 7:58 pm I kind of struggle to see the utility of this, though... maybe I would if I saw it in action, but I think you would end up in a kind of homeostasis (on a long enough time scale) where something that simple wouldn't be of much benefit.

Either you're using more than you're producing, and consumption slows down to match demand; or you're producing more than you're consuming, and production gets backlogged (once buffers fill up) and slows down to match consumption. Or you're producing and consuming at exactly the same rate, I guess.

I guess you might be able to get something if you have large buffers and see a slight deficit starting? Or if you see spikes (e.g. miners turning on and off as trains arrive) to give you an idea of how much more you can handle (although that would probably even out at a large scale).
You are right that on a long enough scale, the supply and demand will balance out. I personally do have large buffers (either logistics buffer chests or long main bus belts) that mean the two take quite a while to balance out. When I add the production of something "new", I often find myself consulting the production graphs and effectively manually calculating the difference between current production and consumption. If I had a graph of the difference, I could quickly see if a line was a long way above or below the 0 line and it would save me some time and effort.
Post Reply

Return to “Ideas and Suggestions”