Improved fluid box leveling.

This commit is contained in:
Adamo 2020-11-15 22:39:47 -05:00
parent 06f37425c4
commit 4ecd8d1125
2 changed files with 34 additions and 4 deletions

View File

@ -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
Date: 2020-06-26

View File

@ -101,12 +101,25 @@ local set_burner_colors = function(entity)
)
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
boiler.target_temperature = chem_temp_max
boiler.fluid_box.height =
(boiler.fluid_box.height or 1)/gen_eff
boiler.output_fluid_box.height =
(boiler.output_fluid_box.height or 1)/gen_eff
local input_rise = boiler.fluid_box.height or 1
local output_rise = boiler.output_fluid_box.height or 1
boiler.fluid_box.height = input_rise/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,gen_eff
)
@ -136,8 +149,14 @@ for _,generator in pairs(data.raw.generator) do
(generator.effectivity or 1)
*gen_eff
if generator.fluid_box then
local input_rise = generator.fluid_box.height or 1
generator.fluid_box.height =
(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
if generator.name:find "steam" then
if generator.name:find "turbine" then