Flood Resist Duct Block
Добавить в игру через Steam
Нажмите «Подписаться»
На странице Steam войдите в аккаунт, если потребуется.
Подписаться
О материале
«Flood Resist Duct Block» — материал мастерской Barotrauma. Моды, подлодки, предметы и новые задания для экипажа. Данные Steam, описание автора и ссылка для установки через подписку. Совместимость редакцией не проверена.
Описание автора
Description
This duct block slows flooding from above and stops flooding from below.
Variants
Easier Flood Resist Duct Block is easier to configure. However, it uses more components and more difficult to understand the wiring.
Better Duct Block use fewer components, but only works if the hull volume different is insignificant.
Installation
-
Open your submarine with the submarine editor.
-
Find out the hull volume by selecting the hull (one at a time).
-
Calculate the Hull Volume Ratio. Hull Volume Ratio = Upper Hull Volume / Lower Hull Volume.
-
Set the value of the left memory component with the Hull Volume Ratio.
-
If the Hull Volume Ratio > 1, then Tolerance = Hull Volume Ratio, else Tolerance = 1.
-
Set the value of the right memory component with the Tolerance.
-
Choose a wait time. Longer wait time will work better on preventing flood but poorer on water draining.
-
Set the value of lower delay component with the wait time.
Explain
Goal
Create a duct block that helps to drain the water out of the ** submarine **.
Challenges
-
There is no reliable way to detect a hull breach.
-
There is no way to detect the water amount in hulls precisely. Water level (%) is an indirect way that tells you an approximate (rounded) water level in hulls. The sum of water level (%) of both sides will fluctuate if the duct block opens. For example, when 100% water level on upper hull is dropping, lower hull may gain 1% water level before the upper hull decrease 1%. The total water level will become 101% temporary.
-
The upper hull and the lower hull volume may be different. For example, if the upper hull is 3 times larger than the lower hull, 1% water level drop in the upper hull will result in 3% water level gain in the lower hull. The different in scale will affect the correctness of change of water level.
-
The wait time between retries is a trade-off. Increasing it will makes the duct block works better on preventing flooding from above, but works poorer on draining water.
Respective Solutions on Challenges
-
Use a back-off strategy as a workaround. The main goal is to drain the water out of the ** submarine **. So, if the total water level is increasing, the duct block is not helping at all. Detect the change of water level (%) when the duct block is opened. Back-off and close the duct block when it is increasing. Wait and retry later. Keep the duct block open otherwise.
-
Introduces tolerance to negate the fluctuation. The tolerance should be the upper bound of value when 1% water level is changing. To put it simply, if the Hull Volume Ratio > 1, then use the Hull Volume Ratio else use 1.
-
Multiply one of the water level signal with a ratio to make both of them the same scale (normalization). I choose to multiply the water level of the upper hull, so the ratio should be ** upper hull volume / lower hull volume **. For example, if the upper hull is 3 times larger than the lower hull, the ratio will be 3. After multiplication, 1% water level change in upper hull will result in 3 units change in the sum of total water level. 3% water level change in lower hull will result in 3 units change in the sum of total water level. They become the same scale.
-
Make the wait time between retries configurable, so we could adjust it depends on our needs.
Implementation
Please refer to the image, from top to bottom:
1st Row:
The memory component -- It contains the value of the Hull Volume Ratio.
The multiply component -- It multiples the upper hull water level (%) with the Hull Volume Ratio.
2nd Row:
The add component -- It sum the water level (%) of both side
The memory component -- It contains the value of tolerance
3rd Row:
The delay component -- It contains the value of 0.5. Its purpose is to capture the total water level 0.5 seconds before.
The greater component -- It compares the current total water level with 0.5 seconds before. Determine if the total water level is increasing or decreasing.
The substraction component -- It deducts the current water level to act as the tolerance. The tolerance is to negate the fluctuation during total water level change.
4th Row:
The delay component -- It controls the wait time between retires. The delay value should be half of the wait time.
5th Row:
The and component -- It is part of the wait time circuit. It enables the duct block to react to flooding immediately.
6th Row:
The and component -- It enables the duct block to always close when the lower deck is completely flooded.
The Regex component -- It checks if the lower deck is completely flooded.
Example
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.