User blog:TheAlphatheOmega/SimpleWarships Mod: First public test of Buoyancy/Dynamic Flooding mechanics



This video showcases the new buoyancy and dynamic flooding mechanics for the SimpleWarships mod. The test "ship" was made up of hull pieces(orange), watertight bulkheads(white), and "holes(blue)," and arranged into three mostly-watertight compartments.

The first run shows how the ship stays afloat with no holes to cause leakage, and the second and third runs add some "holes" to the ship in order to introduce flooding. In these runs, the dynamic flooding system comes into play.

In the second and third runs, the watertight compartments with holes in them rapidly flood, causing the ship to eventually list toward that direction. Later on in the runs, however, you can see how the ship seems to stop sinking rapidly, as the holed compartments become fully flooded and the water inside the hull pieces encounters the watertight bulkheads, blocking the flooding from progressing.

In the second and third runs, the ship would have eventually begun sinking again as water would find its way past the watertight bulkheads(which do not completely seal off the compartments, as seen in the video). However, this would have taken far more time and made for a rather long video, so I opted to just show you the more interesting stages of the tests instead of waiting.

Other important things to note are that I sometimes opened up the dev console in the video to show you the part masses. The numbers in the box represent the mass of each hull piece, which increases as water flows in. A dry hull piece has mass 999.99, and a fully flooded piece has mass 10000. In addition, you can see the ship flexing and undergoing stresses during sinking. I still have many things to tweak with these systems, but structural integrity WILL be a valid concern in SimpleWarships, so shipwrights will have to plan carefully!

Disclaimer: this script was made for custom pieces that will be far larger than the hull block placeholders used in this test, so ships will behave a bit more correctly than shown here. Examples include  not sinking so rapidly in the beginning, and having more pronounced lists to port/starboard, among other things.

This script is still a beta WIP, and behavior and physics can and probably will be tweaked in the future!