Make production graphs cleaner

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

coppercoil
Filter Inserter
Filter Inserter
Posts: 502
Joined: Tue Jun 26, 2018 10:14 am
Contact:

Make production graphs cleaner

Post by coppercoil »

TL;DR
Prod2Prod.png
Prod2Prod.png (63.38 KiB) Viewed 3194 times
What ?
1. Remove high frequencies in the graphs.
2. Make graph lines smooth.
Why ?
Graphs will be cleaner and nicer.
User avatar
valneq
Smart Inserter
Smart Inserter
Posts: 1262
Joined: Fri Jul 12, 2019 7:43 am
Contact:

Re: Make production graphs cleaner

Post by valneq »

thing to consider: smoothing out the graphs will remove details that can be very informative
Koub
Global Moderator
Global Moderator
Posts: 7787
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Make production graphs cleaner

Post by Koub »

Hands would be cleaner, nicer, and smoother looking without finger, but way less practical :mrgreen: .
Functionality >> Looks.
Graphs don't need to look nice, but to inform us what's going on in our factory.
Koub - Please consider English is not my native language.
coppercoil
Filter Inserter
Filter Inserter
Posts: 502
Joined: Tue Jun 26, 2018 10:14 am
Contact:

Re: Make production graphs cleaner

Post by coppercoil »

Just switch to shorter time scale for details. Large scale already hides short peaks, so smoothing would be not so "destructive" as you think. I mean, graphs hide fine details by now, and players are fine with that :)
foamy
Filter Inserter
Filter Inserter
Posts: 432
Joined: Mon Aug 26, 2019 4:14 am
Contact:

Re: Make production graphs cleaner

Post by foamy »

coppercoil wrote: Wed Feb 03, 2021 9:55 pm Just switch to shorter time scale for details. Large scale already hides short peaks, so smoothing would be not so "destructive" as you think. I mean, graphs hide fine details by now, and players are fine with that :)
Problem there is that you can't examine arbitrary segments at high resolution, just the most recent one. :(
pichutarius
Fast Inserter
Fast Inserter
Posts: 158
Joined: Mon Feb 27, 2017 12:47 am
Contact:

Re: Make production graphs cleaner

Post by pichutarius »

My guess, currently it counts how many of each item is produced x minutes ago, and divide by x. Bigger x for bigger timescale and vice versa.

From math perspective, I wonder how to implement smoothing, probably need convolution with bell curve, and therefore cost ups. Its not that easy.
User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 794
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: Make production graphs cleaner

Post by ickputzdirwech »

The graphs are already smoothed. Anyone remember the old spiky fluid graphs?

Smoother graphs aren’t necessarily less functional. True they include less information. But if they have too many details it’s hard to interpret what they actually represent. Especially if you are interested in long time trends. I think I wouldn’t mind a bit more smoothing.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Koub
Global Moderator
Global Moderator
Posts: 7787
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Make production graphs cleaner

Post by Koub »

In that case, like in Excel charts, a feature "average over N points" with obviously possibility to set whatever N positive integer you'd like. Like that when "trend" needed, it's possible, when details needed, it's possible too.
Koub - Please consider English is not my native language.
User avatar
Taneeda
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Tue May 30, 2017 9:25 am
Contact:

Re: Make production graphs cleaner

Post by Taneeda »

+1

My first thought on this topic was "YES, please" :)
Koub wrote: Thu Feb 04, 2021 7:07 am In that case, like in Excel charts, a feature "average over N points" with obviously possibility to set whatever N positive integer you'd like. Like that when "trend" needed, it's possible, when details needed, it's possible too.
Why not add a slider to statistics panel to adjust N between 1..10, with default of 3? Same for electric stats panel...
Shit happens, don't worry, keep happy
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Make production graphs cleaner

Post by ssilk »

Technically this is nothing else than a function that takes more ore less points in a time-frame of the graph and uses the average, instead of each single point. It looks like it is loosing information , but this is in practice used very often, for example to see, if values are rising or falling.

For example when we have the load of the CPU’s in a cluster, then both is very interesting: you want to see, if there are peaks in the load and you want to see a general trend of the load. The first is needed to find events that causes such peaks, and the second is used to see, when it is time to add a new node to the cluster.

But as the stats in Factorio are currently working I don’t see, how that might be useful. To make sense for that graph, you need to see both types side by side.
...

What I really would like to see here are free configurable dashboards. Like with Grafana.
Image

And I would be able to say: when power under x for n seconds raise alarm. Or when pollution is over x turn mines off. Just need to create a new dashboard, add the right values, the type of the graph, set alarms, ready.

But that would cost many cpu-cycles to create, would slow down Factorio significantly. I think we need to live with the current compromise. But I don’t like it. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
mrvn
Smart Inserter
Smart Inserter
Posts: 5925
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Smooth graph in electrical network info and production statistics

Post by mrvn »

TL;DR
Add an option to the graphs in electrical network info and production statistics to make the lines smoother.
What ?
Add a slider "Smoothing: N" to the GUI. If one pixel in the graph covers 10 seconds then the value of each pixel is the avergage of the 10 * N seconds before the pixel. Depending on N this will smooth out spikes and make for a much more readable graph.

Note: Values for pixels will overlap by N-1. The value of the next pixel can be calculated with minimal overhead by adding (current value - value N-1 steps ago) / N. So regardless of N the cost of computing values will remain constant.
Why ?
With the way back-pressure works to stop assemblers there is a constant stop and go action depending on the ratios of buildings and speed of recipes. It's rare that anything has a constant consumption or production. Even increasing the time span of the graph so each pixel represents a longer timeframe doesn't get rid of the spikeyness of the graph. Some of it because there are longer duration spikes, like when a train is loaded and all the ore miners start up till the buffer chests are full again. So short term spikes get replaced by long term spikes.

Currently the graph can look like this:
graph.png
graph.png (31.99 KiB) Viewed 3029 times
With the lines overlapping and spiking like this they become unreadable. A smooth out line for each item in the graph would reduce the clutter and make it more useful.
Alternatives?
Instead of calculating a value for every pixel only compute those pixels that are labeled on the X axis and connect them with a dot.

Instead of drawing the value at time X draw the average from X to now. So the 1m graph would have the 60s average on the left, the 30s average in the middle and the current value on the right.
Last edited by mrvn on Sun Oct 24, 2021 6:38 pm, edited 1 time in total.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Smooth graph in electrical network info and production statistics

Post by mmmPI »

mrvn wrote: Sun Oct 24, 2021 5:15 pm With the lines overlapping and spiking like this they become unreadable. A smooth out line for each item in the graph would reduce the clutter and make it more useful.
You can select one or several item and then the graph only shows them.

but i agree with you it would be interesting to have better visual information.

Not sure i understand your proposition however making the line smoother and reducing the spikes is not desirable in my eyes, i think the tab should reflect as accurate as possible what is happening.

Then having options to interpret such as average, trend, +/- total production , and so on i'm favourable.
mrvn
Smart Inserter
Smart Inserter
Posts: 5925
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Smooth graph in electrical network info and production statistics

Post by mrvn »

mmmPI wrote: Sun Oct 24, 2021 5:43 pm
mrvn wrote: Sun Oct 24, 2021 5:15 pm With the lines overlapping and spiking like this they become unreadable. A smooth out line for each item in the graph would reduce the clutter and make it more useful.
You can select one or several item and then the graph only shows them.

but i agree with you it would be interesting to have better visual information.

Not sure i understand your proposition however making the line smoother and reducing the spikes is not desirable in my eyes, i think the tab should reflect as accurate as possible what is happening.

Then having options to interpret such as average, trend, +/- total production , and so on i'm favourable.
It would be selectable. Set N=1 (default) and you get the current graph. N=2 and each pixel is averaged with the previous value. The higher you select N the more smoothed out it is.

For me in the 1m view each pixel represents 0.2s or 12 ticks. So N=2 would show a 24 ticks average. N=5 would give 1s averages. Just now I have a case where a pretty power hungry electrolyser runs once per second. So I would want a fairly big N to smooth that. Unless I'm looking to see if anything stutters. That's why it needs to be a slider so you can easily set a value that works for you.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Smooth graph in electrical network info and production statistics

Post by mmmPI »

You can already read the power consumption of the 1 electrolyser if you select its icon under the power graph, it will show only its graph, and also on the table under the graph read the averaged value for last 5 sec 30 sec 1 minutes 10 minutes 1 hour and so on.

If it's impossible to distinguish because you use many eletrolysers of the same tier, you need to isolate a few on a power grid ( with solar for example). It will be easier to read their cycle.

What you want is that the graph offer the possibility to reflects a curve of the different averages on a period of N times ? instead of trying to represent consumption in real time ?
mrvn
Smart Inserter
Smart Inserter
Posts: 5925
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Smooth graph in electrical network info and production statistics

Post by mrvn »

I know that. But that is just the average over the whole time of the graph. One value. And if you have items close together they randomly switch positions and can be very hard to read and compare.

Try reading 2 or three numbers at the bottom at the same time? You basically have to make a screenshot or pause the game (which you can't in multiplayer). Comparing the number of X with that of Y 5 seconds ago like you can in a graph? Forget it.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Smooth graph in electrical network info and production statistics

Post by ssilk »

The only thing I could add here is
A) Factorio is not though for that, far beyond of what’s needed in vanilla.
B) the stats had been always a source for criticism.
C) there is the Graftorio mod https://mods.factorio.com/mod/graftorio2 which I can recommend to exactly produce those graphs and much more. It has of course the disadvantage of needing some CPU and it takes some time to configure it for your needs.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
mmmPI
Smart Inserter
Smart Inserter
Posts: 3673
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Smooth graph in electrical network info and production statistics

Post by mmmPI »

mrvn wrote: Mon Oct 25, 2021 12:11 am I know that. But that is just the average over the whole time of the graph. One value. And if you have items close together they randomly switch positions and can be very hard to read and compare.

Try reading 2 or three numbers at the bottom at the same time? You basically have to make a screenshot or pause the game (which you can't in multiplayer). Comparing the number of X with that of Y 5 seconds ago like you can in a graph? Forget it.
haaa you have to select the longer tab "250H" usually those are not jumping items, even the last 2 or 3 numbers at the bottom. Select the 3 desired machine and then switcback to the 5 second graph. You have only 3 graph visible, go to 10 minutes ,same, you have the average value written for each interval at the bottom and a spiky graph to help you realise what was averaged to give you the value.
UkcsAlias
Inserter
Inserter
Posts: 22
Joined: Mon Oct 04, 2021 11:07 am
Contact:

Re: Smooth graph in electrical network info and production statistics

Post by UkcsAlias »

ssilk wrote: Mon Oct 25, 2021 7:29 am A) Factorio is not though for that, far beyond of what’s needed in vanilla.
The only issue i see is that for long durations, rather than taking a static point, you are going to take a bigger set of data to calculate, which adds load.

But even here you can use keyframes for statistics. Each keyframe then can just take a certain value for each stat (average, max, min). The longer the graph, the more of those keyframes get averaged out (the 10min marker could have 4 keyframe values). It doesnt matter that the graph doesnt update every second at that point as thats not realy what you are looking for.

Base, peak and average load are all 3 a statistic that generaly are relavent to diagnose certain issues (lack of power during peaks can be buffered, for which the average might be interesting to get an idea of required buffer size. And the lowest gives a good identification of minimum load you will always consume). On large bases power can fluctuate a lot. And if you can isolate sections (which with power switches you can), you can gather some info about general load for each section. Which in turn can be used for some logic you can apply.

Sure, it might not be an optimal way to handle issues or monitor your factory. But its still a way that can aid to plenty of playstyles because it doesnt require perfect calculations. Especialy the casual player might want to get such info because of that.
But in the end, if it adds too much load, its going to be a bad idea anyway. This to me remains the most important aspect. The casual player might like such stats, the huge base builders might find the load it adds a major issue.

And maybe this is something that can be added in an expansion. Because who knows what will be added then? Do note that satisfactory relies quite a bit on the power graph while in that game factories are generaly more reliable at power usage because you can sink items (and therefor factories keep running). But then again, thats a game where instead of brownouts that slowly increase the problem, it instantly blacks out, which is a lot more harsh than this game.

I would say its something worthy enough to investigate for potential low cost solutions. But then again, im not a gigabase builder, so i am biased on that.
mrvn
Smart Inserter
Smart Inserter
Posts: 5925
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Smooth graph in electrical network info and production statistics

Post by mrvn »

UkcsAlias wrote: Mon Oct 25, 2021 5:44 pm The only issue i see is that for long durations, rather than taking a static point, you are going to take a bigger set of data to calculate, which adds load.
You aren't. You don't add up all the data points that go into each pixel. Instead it's a sliding window. As the graph advances the data point from "T-N" is subtracted and the data point for "T" is added. All the data points in between are carried over.

So for N > 1 the computation becomes twice as expensive but it's always the same no matter what N is except for a startup cost for the first pixel. That happens once and then the graph scrolls and only does one add and sub and a division per pixel scrolled.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Smooth graph in electrical network info and production statistics

Post by ssilk »

Using keyframes: yes, would be useful.

In general, if I had the knowledge of programming c++ I would completely rewrite the stats. 8-) :lol: :twisted:
Because they lack on so many edges. :cry:

In general I would turn the stats so, that the player is enabled to create his own set of dashboards. I like for example Grafana
Image
Seeing what’s possible there and what’s implemented in Factorio makes me sad.
Of course I know that it’s not possible to put so much effort into a game to program such nice types of graphs. Because that’s needed, otherwise (see graftorio mod) it takes easily 10-20% of the performance. But I think the stats could really get some love.

Some examples:
- consistent colors (player preferences assignable?)
- support of boxed items (relationship between items)
- remember the settings of the timeframe
- scrolling/zooming in timeframe, much longer records in high resolution (player can say how much memory should be used and how much should be cut for saving)
- own stats, e.g. total amount of power from adding all power sources, how much copper is used for producing copper wire, …
- different types of lines (visibility), displaying the item in the graph
- stats on own screen (veeeery useful with the above features)
- some kind of alarms from stats
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Post Reply

Return to “Ideas and Suggestions”