Page 1 of 1

[0.12.32] [kovarex] Incorrect display values in electrical graph

Posted: Mon May 02, 2016 3:35 pm
by JasonC
Present in at least 0.12.29 - 0.12.32.

If an entity was created more recently than the currently selected history length on the electrical consumption graph, the number displayed for its average power consumption is the average over its life time, rather than the average over the selected history length. However, its indicator bar and position in the sort order still matches its average consumption over the history time. Only the displayed number is incorrect.

For example, if an object was created 1 minute ago with a 1 MW demand, and the graph is set to 10 m, the displayed value will be 1 MW instead of 0.1 MW, even though it will be sorted in the correct order. Here, there are 5 radars (0.3 * 5 = 1.5 MW) that have existed longer than 1 hour, and 5 beacons (0.48 * 5 = 2.4 MW) that were recently created (graph says 2.3 because it took me a second to insert modules in them to get their power usage up):

Image

The beacons should not be 2.3 over 1 hour, they should be less. Note that they are after the radars in the sort order, and that their indicator bar appears correct, although the displayed value is higher.

Two saves are attached. The first, sort-order-test, does not have the beacons built yet. To reproduce:
  1. 5 radars have already been built (and I advanced the game speed to make them take up a few hours of history).
  2. Build 5 beacons and put modules in them.
  3. Immediately view the 1m or 10m consumption graph and watch the beacon's displayed usage increase to higher than the radar's as it stays on the bottom of the list.
The second, sort-order-test-2, is the same as the above but the beacons have just been built. Load this save and just immediately view the 10m consumption graph to see the issue.

This report is a spin off for the issue observed here.

Edit: I apologize, I've attached a required mod. I thought I removed all dependencies, but this is for the fuel supply chests for the generators. If it is an issue please let me know and I will redo the saves without it. The saves will still function without the mod, just not for very long.

Re: [0.12.32] [kovarex] Incorrect display values in electrical graph

Posted: Mon May 02, 2016 5:00 pm
by kovarex
Hm, I looked into the source file, and this is actually the way it is programmed to calculate the power depending on how long the entity is working, so it depends on the point when it first appeared in the graph.
On the contrary, in the production graph, it always divides the overall production by the timeframe regardless of when the entity started to be produced.

So I unified this for 0.12.33, to always show the value based on the timewindow.