Page 1 of 1

[2.0.13] Recycling speed formula inconsistent between items

Posted: Thu Oct 31, 2024 7:43 pm
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

Re: [2.0.13] Recycling speed formula inconsistent between items

Posted: Mon Nov 04, 2024 11:22 am
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?

Re: [2.0.13] Recycling speed formula inconsistent between items

Posted: Mon Nov 04, 2024 12:13 pm
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.

Re: [2.0.13] Recycling speed formula inconsistent between items

Posted: Tue Nov 05, 2024 5:06 am
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.