Barotrauma

Barotrauma

Not enough ratings
Flood Resist Duct Block
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
37.111 KB
18 Jul, 2021 @ 4:25am
4 May, 2022 @ 4:50am
4 Change Notes ( view )

Subscribe to download
Flood Resist Duct Block

Description
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

  1. Open your submarine with the submarine editor.
  2. Find out the hull volume by selecting the hull (one at a time).
  3. Calculate the Hull Volume Ratio. Hull Volume Ratio = Upper Hull Volume / Lower Hull Volume.
  4. Set the value of the left memory component with the Hull Volume Ratio.
  5. If the Hull Volume Ratio > 1, then Tolerance = Hull Volume Ratio, else Tolerance = 1.
  6. Set the value of the right memory component with the Tolerance.
  7. Choose a wait time. Longer wait time will work better on preventing flood but poorer on water draining.
  8. 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

  1. There is no reliable way to detect a hull breach.
  2. 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.
  3. 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.
  4. 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

  1. 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.
  2. 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.
  3. 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.
  4. 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

Humpback Wiring Example
6 Comments
Richard Mc Nutbuster 21 Jul, 2021 @ 6:04am 
logic*
Richard Mc Nutbuster 21 Jul, 2021 @ 6:03am 
its alright, amazing bit of logig btw, although i did just go for the easier one
IT9  [author] 21 Jul, 2021 @ 5:23am 
The instruction to configure the wait time was wrong.

The correct value to be set in the delay component should be equal to the wait time. That is, 3 seconds delay will make the duct block to open and check the change of water level every 3 seconds.

I have updated the mod’s description.

Sorry for the confusion.
IT9  [author] 20 Jul, 2021 @ 6:11am 
I also created an easier to configure version of the duct block. You may take a look at Easier Flood Resist Duct Block
IT9  [author] 20 Jul, 2021 @ 6:09am 
I updated the description.

The original step 2 is as follow:

Buffers (Left memory component) -- The buffers should be the greater value between 1 and the Hull Volume Ratio.

My explaination was not well enough preivously. I will call the "Buffers" the "Tolerance" after I updated the description.

The value of Tolerance should be:

If Hull Volume Ratio > 1
then Tolerance = Hull Volume Ratio
else Tolerance = 1
Richard Mc Nutbuster 19 Jul, 2021 @ 9:27pm 
im not quite understanding step 2.