mirror of
https://asciireactor.com/factorio/adamo-physics.git
synced 2024-11-22 04:15:07 +00:00
Improved fluid box leveling.
This commit is contained in:
parent
06f37425c4
commit
4ecd8d1125
@ -1,3 +1,14 @@
|
|||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 0.2.0
|
||||||
|
Date: 2020-06-26
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- Updated to version 1.0
|
||||||
|
|
||||||
|
Entities:
|
||||||
|
- Tweaked fluid box algorithm to improve pipe level matching
|
||||||
|
and generator throughput.
|
||||||
|
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 0.1.0
|
Version: 0.1.0
|
||||||
Date: 2020-06-26
|
Date: 2020-06-26
|
||||||
|
@ -101,12 +101,25 @@ local set_burner_colors = function(entity)
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Assumes pipe had height 1 before being changed by this mod.
|
||||||
|
local pipe_rise = data.raw.pipe.pipe.fluid_box.height - 1
|
||||||
|
|
||||||
for _,boiler in pairs(data.raw.boiler) do
|
for _,boiler in pairs(data.raw.boiler) do
|
||||||
boiler.target_temperature = chem_temp_max
|
boiler.target_temperature = chem_temp_max
|
||||||
boiler.fluid_box.height =
|
local input_rise = boiler.fluid_box.height or 1
|
||||||
(boiler.fluid_box.height or 1)/gen_eff
|
local output_rise = boiler.output_fluid_box.height or 1
|
||||||
boiler.output_fluid_box.height =
|
boiler.fluid_box.height = input_rise/gen_eff
|
||||||
(boiler.output_fluid_box.height or 1)/gen_eff
|
boiler.output_fluid_box.height = output_rise/gen_eff
|
||||||
|
input_rise = (boiler.fluid_box.height or 1) - input_rise
|
||||||
|
output_rise = (boiler.output_fluid_box.height or 1) - output_rise
|
||||||
|
local input_drop = input_rise - pipe_rise
|
||||||
|
local output_drop = output_rise - pipe_rise
|
||||||
|
boiler.fluid_box.base_level =
|
||||||
|
(boiler.fluid_box.base_level or 0)
|
||||||
|
- input_drop
|
||||||
|
boiler.output_fluid_box.base_level =
|
||||||
|
(boiler.output_fluid_box.base_level or 0)
|
||||||
|
- output_drop
|
||||||
boiler.energy_consumption = energy_div(
|
boiler.energy_consumption = energy_div(
|
||||||
boiler.energy_consumption,gen_eff
|
boiler.energy_consumption,gen_eff
|
||||||
)
|
)
|
||||||
@ -136,8 +149,14 @@ for _,generator in pairs(data.raw.generator) do
|
|||||||
(generator.effectivity or 1)
|
(generator.effectivity or 1)
|
||||||
*gen_eff
|
*gen_eff
|
||||||
if generator.fluid_box then
|
if generator.fluid_box then
|
||||||
|
local input_rise = generator.fluid_box.height or 1
|
||||||
generator.fluid_box.height =
|
generator.fluid_box.height =
|
||||||
(generator.fluid_box.height or 1)/gen_eff
|
(generator.fluid_box.height or 1)/gen_eff
|
||||||
|
input_rise = (generator.fluid_box.height or 1) - input_rise
|
||||||
|
local input_drop = input_rise - pipe_rise
|
||||||
|
generator.fluid_box.base_level =
|
||||||
|
(generator.fluid_box.base_level or 0)
|
||||||
|
- input_drop
|
||||||
end
|
end
|
||||||
if generator.name:find "steam" then
|
if generator.name:find "steam" then
|
||||||
if generator.name:find "turbine" then
|
if generator.name:find "turbine" then
|
||||||
|
Loading…
Reference in New Issue
Block a user