Crafting Efficiency


Adds technologies to increase the gain of wastefull and expensive processes, such as copper cable, steel, and gears

6 years ago
0.15
4

b Crafting time for adv. circuits is wrong (fixed in 0.0.2)

6 years ago
(updated 6 years ago)

In vanilla gears, circuits and copper wires all take 0.5 seconds to craft, while adv. circuits require 6 seconds. Your first efficiency research adds a recipe for two products each with a fixed crafting time of 0.83333, regardless of what item you craft. It works for gears, circuits and copper wires, but not for adv. circuits, as the time is dropped from 6 seconds to 0.83333 seconds with twice the output.
Your coding could simply use a factor to multiply with the vanilla crafting time for each research to make it adaptable.

€dit: Checked the coding in the technology.lua. You actually did already the way I suggested, but due an error in your code, crafting time is set with a base of 0.5 seconds. In recipe generation you used "data.raw["recipe"][baseRec].energy_required", while you need to use "data.raw.recipe[baseRec].energy_required".

I've tinkered around with your code a bit and my conclusion is that data.raw.recipe[baseRec].energy_required always result in 0.5 seconds, so I checked the generation of your baseRec in the data.lua.
There I saw that you use the local SciLvls for copper wires, but for everything else you used SciDat without updating the functon addEffTech.

Currently not sure what is borked and causing the wrong crafting time for adv. circuits. I'll check later again and respond in this thread, if I find something else to tell

Edit2: I guess issue was that you can't use data.raw.recipe[baseRec] in data.lua because the vanilla recipes are generated afterwards. A quick and dirty modification allowed me to include the vanilla crafting time in your calculations.
I added the line "local baseTime = 0.5" which will be the vanilla crafting time for each item, then I updated the AddEffTech to include the time. Also I updated the recipe-generator to "local nrg = ((i/1.5)+1)*baseTime". This fixed my issue with the false crafting time of adv. circuits.
I hope this helps with your bugfixing :-D Nice mod btw and keep the good work up

6 years ago

Sorry about that, I guess I didn't notice that while testing. I've implemented your "quick and dirty modification" into this update.

6 years ago

Nice! Glad I could help

New response