low_power state shows in case of entity with electric energy source which has availableEnergy below 90,909% of the buffer size. That state is irrelevant for the performance computation. Crafting machines (assembling machines, furnaces, rocket silo) use performance value:
Code: Select all
craftingMachinePerformance = fractionOfRequestedEnergyDelivered * prototype.craftingSpeed * (1 + speedBonus)
fractionOfRequestedEnergyDelivered depends on the requested energy:
Code: Select all
requestedEnergy = prototype.energyUsage * (1 + consumptionBonus)
fractionOfRequestedEnergyDelivered = min(requestedEnergy, availableEnergy) / requestedEnergy
In case of a Lab, performance value:
Code: Select all
labPerfornance = fractionOfRequestedEnergyDelivered * prototype.researchingSpeed * (1 + force.labSpeedModifier) * (1 + speedBonus)
Combinators have binary performance (either 0 or 1): they update only if requestedEnergy >= availableEnergy.
Those are some coarse formulas, i cannot guarantee anything about them (also no support nor feedback will be given if anything changes), and for other entities they will be most likely completly wrong (for example inserter takes energy twice: once for rotation and once for changing hand distance, pump takes energy twice when pumping into a fluid wagon). In general the performance of a machine is related to the amount of energy entity wants versus what it has in the buffer. Some entities may have buffer just enough to feed them every tick
In general the performance computation for any entity depends only on the available energy and buffer size of the energy source during the given tick. If there are some defenses they simply have higher usage priority (if they were defined as such) which drives the electric energy update to transfer energy to them first (to top up their buffer) and only when their buffers are full and there is more energy available to transfer from producers: to fill energy buffers of entities with lower energy usage priority (following the energy fair share: if all entities on given priority need total of 100J and there is only 50J left available from producers, entities will get 50% of their requested value: entity entity A wanted 80J will get 40J while entity B that requested 20J will get 10J). Electric energy sources request min(bufferSize - availableEnergy, inputFlowLimit).
In the performance computation you can ignore the energy drain as it is the amount of energy taken out from the energy buffer just before the demand value is computed - drain is the last to be taken out from the buffer so if there is not enough energy in the buffer after entity update, the drain will not apply at all or will be reduced to the amount of energy remaining. If there was enough energy left for the drain that means the energy in the buffer before update was greater than requested by the entity so the fractionOfRequestedEnergyDelivered was equal to 1. For example assembling-machine-3 has 12,5kW of drain and takes 388kW (387,5kW in fact) when working (no modules). If you deliver just 375kW assembling-machine-3 will work at full performance because during update there was enough energy to get full performance and there was no energy left for the drain. In this state assembling machine will complain it has low power while still working at full performance. This is easy to verify using Electric Energy Interface: if you set it to produce 6250 [+reduce buffer] (which is equal to 6250*60 = 375000 -> 375kW) the assembling machine will be producing at the same rate as fully powered one but if you reduce the energy production below that you will notice in long term it starts to produce slighly less.