[1.1.89] Handcrafting some recipes takes 1 additional tick

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
Theis
Inserter
Inserter
Posts: 29
Joined: Tue Sep 13, 2022 9:57 am
Contact:

[1.1.89] Handcrafting some recipes takes 1 additional tick

Post by Theis »

Brief
Crafting recipes, with the character, such as iron-gear-wheel or transport-belt takes 31 ticks instead of 30 ticks. While recipes such firearm-magazine or underground-transport-belt take the expected 60 ticks.
Where?
This issue seem to be reserved to crafting with the character (handcrafting).
So not crafting using assemblers, chemical plants, etc.
Which recipes are affected?
This seems to affect any recipe costing 0.5, 2, 5 or 8 seconds.
However not recipes costing 1, 10 or 15 seconds.

This discrepancy is also why I consider it a bug.
Testing
I found this issue while developing a visual crafting timer. I timed the crafting using the code below inserting the result into a GUI element and then i used the mod Game Speed Controls to play exactly X ticks.

Code: Select all

local count = -1
local time = 0
for key, value in pairs(player.crafting_queue) do
      local recipe = game.recipe_prototypes[value.recipe]
      time = time + (recipe.energy * value.count)
      count = count + value.count
end
local energy = game.recipe_prototypes[player.crafting_queue[1].recipe].energy
time = time - player.crafting_queue_progress * energy + count / 60
The actual mod is include
Theis_tas_helper_0.9.3.zip
(626.75 KiB) Downloaded 45 times
.
seky16
Burner Inserter
Burner Inserter
Posts: 15
Joined: Tue Nov 17, 2020 4:13 pm
Contact:

Re: [1.1.89] Handcrafting most recipes cost 1 additional tick

Post by seky16 »

This is probably related to floating point arithmetics:
Image
Image
Rseding91
Factorio Staff
Factorio Staff
Posts: 14253
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.89] Handcrafting some recipes takes 1 additional tick

Post by Rseding91 »

Thanks for the report. The issue is a fundamental problem of how floating point numbers work and I don't see that ever changing so I'm going to put this into minor issues.
If you want to get ahold of me I'm almost always on Discord.
Theis
Inserter
Inserter
Posts: 29
Joined: Tue Sep 13, 2022 9:57 am
Contact:

Re: [1.1.89] Handcrafting some recipes takes 1 additional tick

Post by Theis »

Treating this as a minor issue is fair. As it doesn't interfere with general gameplay and is really just an inaccuracy. That said, i do still believe it is relevant to get it fixed.

For normal gameplay this issue doesn't matter that much. However it is relevant for some modded configurations, for speedrunning and for TAS'ing.
As the holder of the 2 fastest steelaxe% TAS, my interest is pretty obvious. By my calculations it slows down automation research by at least 3 seconds, in the 4 minutes it takes to finish that in my fastest TAS.
Post Reply

Return to “Minor issues”