Wiki/Vehicles/Water/Boat

Boats are one of the types of vehicle players can design and operate for their sea rescue service in Stormworks: Build and Rescue.
This page was last updated for V1.4.14 (29 Mar 2022).
== Overview of building a boat ==
A minimal standard boat requires:
# Buoyancy provided by a closed area within the ship
# An engine to provide power
# A propeller to turn power in to thrust (i.e move the boat!)
# A rudder to permit steering left and right
# A pilot seat to allow the captain to start the engine, control the throttle, and to steer
Stormworks provides a starter boat preset which can be loaded in the editor to save time, or you can continue reading to learn how to make your own from scratch.
== Buoyancy ==
The most important component of a typical boat is to ensure that it has a large enclosed area within the hull. This is typically below the main deck. It often contains the engine(s) for the vehicle. In overly simple terms, the amount of enclosed space in this area determines how much weight your boat can hold (its maximum displacement) - meaning how much weight the ship can carry before it starts to sink. If there is a 'hole' in this part of the ship, the boat will usually immediately sink when spawned in-game because it cannot hold its own weight.
== Engines ==
The simplest way to get a boat moving is with a built-in diesel engine. Pipes will be needed to connect fuel to the engine from fluid tanks; to connect the engine's exhaust to Fluid Exhaust pipes; to connect air from a fluid port or air filter to the engine's air intake; to connect the engine's power output to a propeller (possibly using a clutch and/or gearbox in between); and to connect coolant from the engine to a radiator or heat exchanger and back to the engine. The engine will also require electricity from a battery, a logic input to tell it when to run its starter, and a logic input for its throttle setting.
Note that engines tend to be quite heavy and can easily shift a boat's center of mass. It's recommended to keep engines as close to the bottom of the hull as possible to improve stability and to make it easier to flip back upright if does capsize.
== Propellers ==
Engines by themselves generate power, but converting that power into forward (and backward) movement requires propellers.
Note that propellers lined up above the center of mass may pitch the ship down into the water (in extreme cases causing the ship to dive, choke the engine, and stop), while propellers below the center of mass may pitch the ship up out of the water (in extreme cases causing it to hop around almost uncontrollably over waves). Propellers roughly in line with the center of mass will generally provide the greatest stability.
== Steering ==
Boat steering can be done in a variety of ways. Rudders are among the easiest approach, though thrust pivoting, unequal propulsion, and lateral propulsion are all options as well.
=== Rudders ===
Rudders allow the boat to turn by directing water to the sides of the boat as the boat moves forwards. This is their key limitation: they only work when the boat is moving forwards (or backwards). For boats that need to perform sharp turns or sometimes maneuver sideways, rudders are insufficient.
Normal rudders (not fin rudder) should be placed with the blocks at the top (on the underside of the boat) with the 'thin end' of the rudder pointing towards the back of the boat. In the Logic Data screen, rudders need to be connected to the A/D node of the pilot seat.
Rudders are often installed in a pair, with one at either side of the back of the boat (port and starboard). Note that if you use the symmetry tool when placing the rudders, they will counteract each other by trying to turn in opposite directions (as the symmetry tool flips them). They must be placed individually or else a separate logic arrangement to negate the turning instructions must be provided to one of the rudders.
=== Thrust pivoting ===
The built-in preset Starter Boat uses thrust pivoting. The engines at the back turn from one side to the other to steer the boat, causing their center of thrust to end up on different sides of the boat's center of mass, resulting in a yawing force. Similarly, according to its description, the azimuth thruster is intended for use on a robotic pivot so that it can provide lateral thrust to allow a ship to move sideways or turn sharply. Fluid jets can work similarly, using thrust deflectors to provide lateral force for turning.
=== Unequal propulsion ===
On a ship with at least two propellers, thrust on one propeller can be reduced, eliminated, or even reversed while the other propeller will both push the ship forward and turn it. With gearboxes or electric motors used to allow one propeller to reverse while the other goes forward, a ship can more or less turn on a dime.
=== Lateral propulsion ===
Some large real-life ships have side-oriented propellers to allow them to move sideways towards a dock. These can also be used for turning if they are offset from the center of mass.
== Pilot Seat ==
A control seat (often a pilot seat or helm) is the easiest way of setting up controls for a simple boat, although various throttles and buttons for control can be more satisfying.
A control seat, once placed, needs to be connected in the Logic Data screen to the components which it controls. W/S is usually used to control the throttle, while A/D is usually used to control the rudders, or power to lateral propellers.
Using the Select Tool, the pilot seat's Hotkey 1 can be set from 'push' to 'toggle' and used to control the on/off state of the engines. In the Logic Data screen, drag Hotkey 1 to the Engine On/Off node to connect it, then press '1' when in game to start the engines.
== Stability and capsizing ==
Capsizing refers to when a ship gets flipped upside down and can't recover. It is possible to design ships which cannot capsize and will automatically self-right even if turned completely upside down, such as submarines. Ships can also be designed with a variety of active measures to counteract being capsized.
=== Static stability ===
Since capsizing always starts with tipping too far to one side, a common approach to prevent it is to improve stability.
* Increase width: You can either make the ship wider, or use two or more hull sections side-by-side with the center of mass in the middle of them (see catamaran below). Note that this has the disadvantage of also making the ship harder to turn upright again unless you also make the ship taller while keeping the center of gravity low.
* Weights: You can add to the bottom of the ship, moving the center of mass downward. The lower these weights are, the more effective they will be, so making a weighted keel beneath the ship is a simple and effective approach to make the ship more stable. This has the advantage of also making the ship easier to turn back upright if it does flip over, though the added weight may somewhat reduce fuel efficiency, speed, cargo capacity, and range, and a long keel may make it challenging to move the ship into shallow waters.
=== Static balance ===
Ships may tip to one side ('list') when their center-of-mass is not directly below the center of the vehicle (center of buoyancy), increasing their risk of capsizing. This is most commonly a problem when heavy cargo on the vehicle is lopsided. Heavy cargo should be kept low and either centered or balanced with an equal weight of heavy cargo on the other side.
If your ship is tipping to one side upon spawn, your center of mass needs to be fixed. In the vehicle editor, there is an option on the right to show your center of mass, and weight blocks can be used to adjust it to one side or another.
If you have to deal with cargo sometimes causing your ship to tip to one side or the other, consider adding ballast tanks to each side of your ship. These can be filled with water to counterbalance any unequal roll forces, allowing you to correct the situation before the ship can be capsized. Note that ballast tanks fill/empty slowly and are not suitable for managing wave-induced roll (this requires dynamic stability).
=== Dynamic stability ===
Dynamic stability is used for managing roll that occurs primarily due to waves. All dynamic stability methods require either a microcontroller or PID controller. A variety of methods can be used:
* Fins: Fins placed on either side of the ship can be used to provide roll force to counteract any wave-induced roll. This will obviously only work when the ship is in motion.
* Fluid jets: A ship propelled by fluid jets can use their pitch trim value to provide some roll force to counteract wave-induced roll.
* Hydrofoils: Hydrofoils (control surfaces with a large area) can be used to not just prevent roll for stabilization, but also provide lift to get the ship out of the water, reducing drag as well as exposure to waves, thereby greatly enhancing speed, fuel efficiency, range, and stability.
=== Passive recovery ===
A well-designed ship can passively recover from being flipped upside down, like a submarine. To do this, the overall shape of the ship generally needs to either be round (like a submarine), or tall and flat-sided. In either case, the center of mass needs to be kept below the waterline to ensure that the ship will orient itself correctly, and the lower it is, the better. A ship with tall ceilings and large (enclosed!) empty rooms above the waterline has a significant advantage in getting itself turned upright.
As shown in the image to the right, A) is a submarine-type hull which will orient correctly as long as the center of mass (shown in pink) is below the center of buoyancy (the middle of the hull). B) is a taller submarine-type hull or hull similar to a blue water frigate or cutter except that it has a rounded top. Note that the center of mass needs to be much lower to ensure that it will not be stable on its side. C) is a typical hull shape which will offer some resistance to tipping initially since the center of mass is below the waterline (the red zone), but once a strong wave flips it over, it will be capsized.
The easiest approach to test if a ship is able to passively recover is as follows:
* Save your work and start a new vehicle.
* Go the selection grid > load content and select your ship.
* Use the L key to flip it upside down.
* Paste it in.
* Spawn the ship and see if it flips itself back upright on its own.
=== Active recovery ===
If a ship has capsized, there are a variety of design options which can be installed to allow it to flip itself upright again.
* Fluid jets: Any ship powered by a pair of fluid jets can potentially be flipped as long as it is still able to power the fluid jets. For diesel-powered ships, this can be achieved by having air inlets on both the top and bottom with filters in place to only allow air through, ensuring that the engine can always run whether or not the ship is capsized. The two fluid jets can be given opposite maximum vertical trim inputs to induce roll when they are powered, providing force to flip the ship.
* Roll thrusters: Similar to the above, ships which can maintain engine operation while capsized can power a pair of propellers on robotic pivots which are turned in opposite directions to induce a roll.
* Ballast: Ballast tanks can be pumped full of water to get the ship on its side. As long as the ballast tanks are large enough to get it sideways while capsized, and as long as the ship can passively recover from being sideways, this approach will allow it to recover. Note that ballast tanks tend to fill slowly. For maximum recovery speed, use multiple pumps which each go to their own tank.
== Troubleshooting ==
=== Engine won't start ===
Follow this checklist:
* If the engine won't start at all (no noise when attempting to start it), make sure the engine is connected to a battery, and that your starter control (button or seat input) is connected to the engine's starter logic.
** If you're using a starter button, make sure it is also connected to a battery.
** If your engine, starter, or starter button are connected to power through a circuit breaker, make sure the circuit breaker is on.
* If the engine's starter works (audible noise) but the ship doesn't move even when the starter is held on, make sure you've connected the engine to the propeller, that any clutches you may be using are oriented so the A side is toward the engine and B side toward the propeller (sides visible when hovering over the connectors on the clutch in the workbench editor), and make sure the clutch setting is well above 0 (0 clutch means no engine power would reach the prop). 
* If the engine starter is working but the engine won't continue to run without the starter, check the following:
** Make sure the throttle is above 0, preferably above 0.15 (typically close to minimum idling throttle), and ideally set to 1 during engine start-up.
** Make sure the engine exhaust is connected and going out into air (underwater exhaust, especially deep underwater, can create enough backpressure to choke the engine).
*** An overly-long exhaust line can also choke the engine. If the exhaust line is more than 20 blocks long, try a shorter line and see if that fixes it. If so, you can either use a shorter line, use pumps, or run at a lower RPS.
*** Catalytic converters can also significantly increase backpressure, so if your build uses converterss, try running the engine without them as a test.
** Make sure the engine air intake is connected and drawing from air. Like with the engine exhaust, an overly-long intake line can create problems; use the same approach as above to test if this is an issue and correct the problem if so.
** Repeat the same check for fuel, and verify that the vehicle does have some fuel to use.
** If an engine has too much resistance, it may be stalled. If you're using a low-powered engine on a large prop with a high power requirement, try installing a clutch, setting it a to low setting (e.g. 0 during startup) and seeing if the engine is able to start up. If so, you can try ramping up the clutch to see how much power the engine is able to deliver, but you may need to switch to a more powerful engine.
* If your engine bursts into flames almost immediately after starting, the coolant system isn't connected, or else the radiator/heat sink has something obstructing it.
* If your engine bursts into flames after running several seconds or a minute or so, the coolant system is inadequate. Try using a lower RPS, or a fluid heat radiator with the fan on, and with pumps bringing the coolant into and out of the radiator.
** Warning: Do not use a branching coolant system. Branches significantly reduce coolant flow. If you really want an additional fluid heat radiator, make it in series (coolant out->radiator in->radiator out->radiator in->radiator out->coolant in), not a parallel branching structure.
=== Steering problems ===
If you can't steer your rudders may not be connected to your pilot seat, or your rudders may be turning in opposite directions (you can see this happening if you look under the water).
=== Sinking ===
If your boat immediately sinks, you may have a gap in your hull somewhere. Hull compartments which are not fully closed can instantly fill with water, so they offer no buoyancy, and water can get in even if the hole itself is not below water. In contrast, open doors and hatches will fill slowly, and only when they are below water. An easy test for this is to put a fluid meter inside of the compartment and check the fluid capacity - if it comes back zero, the compartment is not sealed and you'll need to close the hole.
If your compartments are sealed but the ship is still sinking immediately upon spawn, it may be overburdened. This can be an issue when using extremely heavy components along with filling large amounts of your ship with cargo, like fuel on a tanker. Ensure you have enough volume filled with air to keep your ship afloat.
== Next Steps ==
Common requirements for a boat:
* Ladders! It is possible to jump on our ship (at least, if you've not made it too tall or buoyant), but you'll want to add ladders to make it easier to get on.
* Seats! Place passenger seats to allow passengers to be safely transported.
* Lights! Add lights for when it gets dark, or you won't be able to see what's happening.
* Navigation tools! Add a compass so you can tell which way you are headed in career mode. Add a GPS so you can work out your position when it's dark or foggy and you can't see nearby islands.
* Fluid cannons! Add a fluid cannon to fire water from your ship, allowing you to put out fires.
== Alternative styles of boat ==
=== Catamaran ===
A catamaran is made up of two hulls which touch the water. They tend to be very stable, making them less likely to flip. On the other hand, when they do flip they are much harder to upright. Catamaran examples can be found on Wikipedia.
=== Hydrofoil ===
A hydrofoil is a type of high-speed boat which has control surfaces below the waterline. These surfaces are used to provide enough lift to get the boat entirely out of the water, resting only on the hydrofoils to minimize drag. Hydrofoil examples can be found on Wikipedia.
Category:Vehicles