Explain which energy type is used in runtime

Place to report issues and suggest improvements to the API documentation.
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 406
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Explain which energy type is used in runtime

Post 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
Factorio & Minecraft Modder
Webdesigner
Anime/Manga Enjoyer


Factorio Mods
Github
Modpack Assembler
Bilka
Factorio Staff
Factorio Staff
Posts: 3902
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Explain which energy type is used in runtime

Post 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
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 406
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Re: Explain which energy type is used in runtime

Post 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 ?
Factorio & Minecraft Modder
Webdesigner
Anime/Manga Enjoyer


Factorio Mods
Github
Modpack Assembler
Post Reply

Return to “Documentation Improvement Requests”