Page 1 of 1

Explain which energy type is used in runtime

Posted: Tue Sep 22, 2026 4:47 pm
by LuziferSenpai
In Prototype stage we can chooce between Watt and Joules, but in Runtime there is no info anywhere which energy type is used.

For example:
https://lua-api.factorio.com/latest/cla ... rning_fuel What type of energy is left? Is it watts or joules?
https://lua-api.factorio.com/latest/cla ... ergy_usage What type of energy does it use? Is it watts or joules?

This would be very helpful in knowning how to supply fuel to entities.

As am I currently struggling to figure out how to use the values correctly, to not overtick locomotives.
https://github.com/LuziferSenpai/factor ... s.lua#L270

As my fuel is 10MJ in prototype.
My current highest locomotives uses 5MW max_power in prototype.
And with how the documentation currently is, it would result in maybe alot of magic number?

Greetz,

Luzifer

Re: Explain which energy type is used in runtime

Posted: Tue Sep 22, 2026 4:53 pm
by Bilka
It's all joules. You can find the conversion formula used by the game to get from the prototype stage value to the runtime value on the prototype doc page for energy: https://lua-api.factorio.com/latest/types/Energy.html

Re: Explain which energy type is used in runtime

Posted: Tue Sep 22, 2026 5:08 pm
by LuziferSenpai
Could the docs then be extended, for when Energy usage/production is written somewhere, it links to https://lua-api.factorio.com/latest/types/Energy.html ?