[Rseding91] [2.0.55] Quality not accumulated in stats when using input_counts

Bugs which we just recently fixed in our development version and will reach you in the next release.
JustGoFly
Inserter
Inserter
Posts: 24
Joined: Fri Dec 18, 2020 6:12 pm
Contact:

[Rseding91] [2.0.55] Quality not accumulated in stats when using input_counts

Post by JustGoFly »

Description
Quality is not inherently factored into standard input_count: When you use input_count on a decider combinator, it counts the total number of a specific item, regardless of its quality tier (Normal, Uncommon, Rare, etc.).

The code is written to load stats via:
local stats = force.get_item_production_statistics(getPlayerSurface(player))
The test below shows results for one player who complained that his science packs were not being counted correctly and shows 2000, when they are much higher. The manual test below show the bug.
The mod is Brave-New-Oarc and using the stats button in the gui, which runs lib/stats_gui.lua function buildStatsTable.

Results of test
stats.input_counts["space-science-pack"]
2000
⏱️ 0.077300ms
stats.get_input_count({name="space-science-pack", quality="normal"})
372000
⏱️ 0.034300ms
stats.get_input_count({name="space-science-pack", quality="uncommon"})
173000
⏱️ 0.027100ms
stats.get_input_count({name="space-science-pack", quality="rare"})
21000
⏱️ 0.024100ms
stats.get_input_count({name="space-science-pack", quality="epic"})
2000
⏱️ 0.029800ms
stats.get_input_count({name="space-science-pack", quality="legendary"})
0
Last edited by JustGoFly on Mon Jun 23, 2025 10:36 pm, edited 3 times in total.
Loewchen
Global Moderator
Global Moderator
Posts: 10219
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Quality not accumulated in stats when using input_counts

Post by Loewchen »

Post the save and steps to reproduce it with, describe the results and what you expect instead and add the version of the game to the title please, see 3638.
JustGoFly
Inserter
Inserter
Posts: 24
Joined: Fri Dec 18, 2020 6:12 pm
Contact:

Re: Quality not accumulated in stats when using input_counts

Post by JustGoFly »

Sorry I missed this:

Factorio 2.0.55,
Save attached

Load and click OARC button in top left, then go to STAT tab, look at Science in drop down.
If running in debugger, put break in lib/stats_gui.lib line 192.
Break on player 4 - which is Pirion, he has made space-science-pack of each quality as shown in OP.
This uses the input_counts. The second method below is to enumerate same for player 4, for each quality to show the difference.

In game example commands:

/c game.print(game.players[4].force.get_item_production_statistics(game.players[4].surface).input_counts["space-science-pack"])

and for each quality setting to compare against above:
/c game.print(game.players[4].force.get_item_production_statistics(game.players[4].surface).get_input_count({name="space-science-pack", quality="normal"}))

Note that this mod only supports NAUVIS, so the accumulation is not done across planets, or tested across planets.
Attachments
BNO_debug_stats_Pirion_quality.zip
(50.01 MiB) Downloaded 20 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 15817
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] [2.0.55] Quality not accumulated in stats when using input_counts

Post by Rseding91 »

Thanks for the report. This is now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved for the next release”