standardized energy sources for improved possibilities
Posted: Wed Nov 01, 2017 11:08 am
Please post your opinion on the described idea!
Introduction:
For example, let's take a look at the energy sources of (vanilla) solar panel, steam engine, electric and stone furnace:
steam-engine:
energy_source only specifies the output type of power (electric) but the power input type for a generator has to be hot liquid.
solar panel:
Same here, output type of power = electric, but type = "solar-panel" tells the game it's input type of power = solar energy
furnaces:
For furnaces, the implementation is already like I imagine: every furnace is of type="furnace", energy_source= tells the game where the required energy comes from.
If hot liquid, wind and solar power would be implemented as an energy_source additional to existing (electric, burner,...) above examples would be easily defined like this:
steam-engine:
solar panel:
Diesel generator:
solar boiler
solar car
Of course parameters for maximum power, min. and max. temp for hot liquids,... would be necessary but I just wanted to give a few examples to show what I'm talking writing about
(English is not my native language. If there are disturbing mistakes or parts even not understandable please notify me)
Introduction:
I'm an electric engineer, my modding-focus in factorio has always been on realistic energy sources (Maybe other parts of the game would also benefit from this type of standardization)
I've read tons of source code to learn from others, but every energy mod had something in common: A lua script, running for every tick and every unit for circumventing limitations of entity types (for example a diesel-generator with a lua script transforming fuel into steam).
I've once tried to create a solarthermic plant (a solar powered boiler). Only way I've found to implement it was a storage tank and a lua script filling with steam out of nowhere by a filling rate depending on game_darkness.
It works but after building hundreds of it, the lua script made the game running at half speed - that's why I've never published the mod.
I've read tons of source code to learn from others, but every energy mod had something in common: A lua script, running for every tick and every unit for circumventing limitations of entity types (for example a diesel-generator with a lua script transforming fuel into steam).
I've once tried to create a solarthermic plant (a solar powered boiler). Only way I've found to implement it was a storage tank and a lua script filling with steam out of nowhere by a filling rate depending on game_darkness.
It works but after building hundreds of it, the lua script made the game running at half speed - that's why I've never published the mod.
For example, let's take a look at the energy sources of (vanilla) solar panel, steam engine, electric and stone furnace:
steam-engine:
Code: Select all
type = "generator",
name = "steam-engine",
energy_source =
{
type = "electric",
usage_priority = "secondary-output"
}
solar panel:
Code: Select all
type = "solar-panel",
name = "solar-panel",
energy_source =
{
type = "electric",
usage_priority = "solar"
},
production = "60kW"
furnaces:
Code: Select all
type = "furnace",
name = "stone-furnace",
energy_source =
{
type = "burner",
fuel_category = "chemical",
}
Code: Select all
type = "furnace",
name = "electric-furnace"
energy_source =
{
type = "electric",
usage_priority = "secondary-input",
emissions = 0.005
}
If hot liquid, wind and solar power would be implemented as an energy_source additional to existing (electric, burner,...) above examples would be easily defined like this:
steam-engine:
Code: Select all
type = "generator",
name = "steam-engine",
energy_input_source =
{
type = "hot liquid"
}
energy_output_source =
{
type = "electric",
usage_priority = "secondary-output"
}
Code: Select all
type = "generator", //(!)
name = "solar-panel",
energy_input_source =
{
type = "solar"
}
energy_output_source =
{
type = "electric",
usage_priority = "solar"
},
production = "60kW"
Code: Select all
type = "generator",
name = "diesel-generator",
energy_input_source =
{
type = "burner",
fuel_category = "chemical",
}
energy_output_source =
{
type = "electric",
usage_priority = "secondary-output"
}
Code: Select all
type = "boiler,
name = "solar-boiler,
energy_input_source =
{
type = "solar",
}
//Edit: Removed energy_output_source for boiler, because type=boiler already defines what it does
Code: Select all
type = "car",
name = "solar-car"
energy_input_source =
{
type = "solar",
}
(English is not my native language. If there are disturbing mistakes or parts even not understandable please notify me)