[2.0.13] Recycling speed formula inconsistent between items

This subforum contains all the issues which we already resolved.
pfr
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Dec 15, 2023 7:26 pm
Contact:

[2.0.13] Recycling speed formula inconsistent between items

Post by pfr »

Dear Wube,

It looks like the recycling time for an item is meant to be 16 times faster than the recipe craft time for that item (in practice, 8 times faster when taking the recycler 0.5 crafting speed into account). This is the case all items except the ones that have a recipe craft time of 0.5 seconds. Currently these items are recycled as if they have a 1 second craft time (they are recycled at a rate of 8 items/second).

From the lua code, it looks like recipes without a "energy_required" specified are defaulted to 0.5 seconds in most of the game, but in the Recycler code if "energy_required" is not present it defaults to 1 second. I'm assuming this was mainly meant for items that don't have a primary crafting recipe, like Ice cubes, but it has the effect of making these 0.5 second craft time items have an inconsistent recycling time to items that take longer to craft.

Apologies if this is not a bug and is intended for game balance.

Thanks,
PFR
User avatar
V453000
Factorio Staff
Factorio Staff
Posts: 277
Joined: Fri Sep 04, 2015 5:51 pm
Contact:

Re: [2.0.13] Recycling speed formula inconsistent between items

Post by V453000 »

Hi thank you for the bug report, but would you mind to elaborate? Both ice cubes and iron gear wheels do seem to have energy_required in 1/16th which seems go go in line with other items?
User avatar
Stringweasel
Filter Inserter
Filter Inserter
Posts: 419
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Re: [2.0.13] Recycling speed formula inconsistent between items

Post by Stringweasel »

In `quality/prototypes/recycling.lua:216` this line is incorrectly assuming the default value of energy_required is 1, while it's actually 0.5. This can explain what pfr is seeing.

Code: Select all

energy_required = (data.raw.recipe[item.name] and data.raw.recipe[item.name].energy_required or 1 )/16,
I didn't verify in-game though, the code just seems suspicious.
Alt-F4 Author | Factorio Modder
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby
Official Contributor to Space Exploration
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3272
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.13] Recycling speed formula inconsistent between items

Post by boskid »

This is slightly breaking but i think it is an acceptable type of deal to avoid weird recycling time changes when a mod would set energy_required to default value, not expecting this to have any effects.

Fixed for 2.0.15.
Post Reply

Return to “Resolved Problems and Bugs”